Skip to content

Commit

Permalink
vk: fix compilation after upstream merge
Browse files Browse the repository at this point in the history
  • Loading branch information
w23 committed Nov 2, 2023
1 parent 1f9b489 commit c869223
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 11 deletions.
9 changes: 9 additions & 0 deletions ref/vk/TODO.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# 2023-11-02 E323
- [x] lol meta: read and sort issues
- [x] merge from upstream
- [ ] hevsuit glitches
- [ ] massage shaders: consolidate all bindings explicitly
- [ ] skip sorting-by-texture when loading brush models (=> geometry count explosion; i.e. kusochki count will explode too)
- [ ] kusochki-vs-materials
- [ ] -vkverbose arg for turning all debug logs before detailed cvars are read

# 2023-10-31 E322
- [x] load png blue noise files
- [-] translucent animated thing -> needs shader rework
Expand Down
18 changes: 8 additions & 10 deletions ref/vk/common_geometry.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ static void BoundPoly( int numverts, float *verts, vec3_t mins, vec3_t maxs )
}
}

static void SubdividePolygon_r( msurface_t *warpface, int numverts, float *verts )
static void SubdividePolygon_r( model_t *loadmodel, msurface_t *warpface, int numverts, float *verts )
{
vec3_t front[SUBDIVIDE_SIZE], back[SUBDIVIDE_SIZE];
mextrasurf_t *warpinfo = warpface->info;
Expand All @@ -41,7 +41,6 @@ static void SubdividePolygon_r( msurface_t *warpface, int numverts, float *verts
float sample_size;
vec3_t mins, maxs;
glpoly_t *poly;
model_t *loadmodel = gEngine.Mod_GetCurrentLoadingModel();

if( numverts > ( SUBDIVIDE_SIZE - 4 ))
gEngine.Host_Error( "Mod_SubdividePolygon: too many vertexes on face ( %i )\n", numverts );
Expand Down Expand Up @@ -96,13 +95,13 @@ static void SubdividePolygon_r( msurface_t *warpface, int numverts, float *verts
}
}

SubdividePolygon_r( warpface, f, front[0] );
SubdividePolygon_r( warpface, b, back[0] );
SubdividePolygon_r( loadmodel, warpface, f, front[0] );
SubdividePolygon_r( loadmodel, warpface, b, back[0] );
return;
}

if( numverts != 4 )
ClearBits( warpface->flags, SURF_DRAWTURB_QUADS );
ClearBits( warpface->flags, SURF_DRAWTURB_QUADS );

// add a point in the center to help keep warp valid
poly = Mem_Calloc( loadmodel->mempool, sizeof( glpoly_t ) + (numverts - 4) * VERTEXSIZE * sizeof( float ));
Expand All @@ -124,8 +123,8 @@ static void SubdividePolygon_r( msurface_t *warpface, int numverts, float *verts
{
s = DotProduct( verts, warpface->texinfo->vecs[0] ) + warpface->texinfo->vecs[0][3];
t = DotProduct( verts, warpface->texinfo->vecs[1] ) + warpface->texinfo->vecs[1][3];
s /= warpface->texinfo->texture->width;
t /= warpface->texinfo->texture->height;
s /= warpface->texinfo->texture->width;
t /= warpface->texinfo->texture->height;
}

poly->verts[i][3] = s;
Expand Down Expand Up @@ -162,13 +161,12 @@ boundaries so that turbulent and sky warps
can be done reasonably.
================
*/
void GL_SubdivideSurface( msurface_t *fa )
void GL_SubdivideSurface( model_t *loadmodel, msurface_t *fa )
{
vec3_t verts[SUBDIVIDE_SIZE];
int numverts;
int i, lindex;
float *vec;
model_t *loadmodel = gEngine.Mod_GetCurrentLoadingModel();

// convert edges back to a normal polygon
numverts = 0;
Expand All @@ -185,5 +183,5 @@ void GL_SubdivideSurface( msurface_t *fa )
SetBits( fa->flags, SURF_DRAWTURB_QUADS ); // predict state

// do subdivide
SubdividePolygon_r( fa, numverts, verts[0] );
SubdividePolygon_r( loadmodel, fa, numverts, verts[0] );
}
2 changes: 1 addition & 1 deletion ref/vk/vk_rmain.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ static void R_InitSkyClouds( struct mip_s *mt, struct texture_s *tx, qboolean cu
PRINT_NOT_IMPLEMENTED();
}

extern void GL_SubdivideSurface( msurface_t *fa );
extern void GL_SubdivideSurface( model_t *loadmodel, msurface_t *fa );

static void Mod_UnloadTextures( model_t *mod )
{
Expand Down

0 comments on commit c869223

Please sign in to comment.