From 677464d04d7aa345e11e26d0a6073740ffa3bb1b Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Sat, 10 Aug 2024 13:44:49 +0300 Subject: [PATCH] ref: rename glpoly_t to glpoly2_t to make the changes more obvious and easier to notice --- common/com_model.h | 12 ++++++------ ref/gl/gl_decals.c | 8 ++++---- ref/gl/gl_local.h | 2 +- ref/gl/gl_rsurf.c | 14 +++++++------- ref/gl/gl_warp.c | 6 +++--- ref/soft/r_decals.c | 8 ++++---- ref/soft/r_local.h | 2 +- 7 files changed, 26 insertions(+), 26 deletions(-) diff --git a/common/com_model.h b/common/com_model.h index 63a30def..81ce38ae 100644 --- a/common/com_model.h +++ b/common/com_model.h @@ -132,10 +132,10 @@ typedef struct // before: malloc( sizeof( glpoly_t ) + ( numverts - 4 ) * VERTEXSIZE * sizeof( float )) // after (C): malloc( sizeof( glpoly_t ) + numverts * VERTEXSIZE * sizeof( float )) // after (C++): malloc( sizeof( glpoly_t ) + ( numverts - 1 ) * VERTEXSIZE * sizeof( float )) -typedef struct glpoly_s +typedef struct glpoly2_s { - struct glpoly_s *next; - struct glpoly_s *chain; + struct glpoly2_s *next; + struct glpoly2_s *chain; int numverts; int flags; // for SURF_UNDERWATER #ifdef __cplusplus @@ -143,7 +143,7 @@ typedef struct glpoly_s #else float verts[][VERTEXSIZE]; // variable sized (xyz s1t1 s2t2) #endif -} glpoly_t; +} glpoly2_t; typedef struct mnode_s { @@ -182,7 +182,7 @@ struct decal_s short entityIndex; // Entity this is attached to // Xash3D specific vec3_t position; // location of the decal center in world space. - glpoly_t *polys; // precomputed decal vertices + glpoly2_t *polys; // precomputed decal vertices intptr_t reserved[4]; // just for future expansions or mod-makers }; @@ -255,7 +255,7 @@ struct msurface_s int light_s, light_t; // gl lightmap coordinates - glpoly_t *polys; // multiple if warped + glpoly2_t *polys; // multiple if warped struct msurface_s *texturechain; mtexinfo_t *texinfo; diff --git a/ref/gl/gl_decals.c b/ref/gl/gl_decals.c index 5d8689f1..d1695597 100644 --- a/ref/gl/gl_decals.c +++ b/ref/gl/gl_decals.c @@ -492,10 +492,10 @@ R_DecalCreatePoly creates mesh for decal on first rendering ==================== */ -static glpoly_t *R_DecalCreatePoly( decalinfo_t *decalinfo, decal_t *pdecal, msurface_t *surf ) +static glpoly2_t *R_DecalCreatePoly( decalinfo_t *decalinfo, decal_t *pdecal, msurface_t *surf ) { int lnumverts; - glpoly_t *poly; + glpoly2_t *poly; float *v; int i; @@ -507,7 +507,7 @@ static glpoly_t *R_DecalCreatePoly( decalinfo_t *decalinfo, decal_t *pdecal, msu // allocate glpoly // REFTODO: com_studiocache pool! - poly = Mem_Calloc( r_temppool, sizeof( glpoly_t ) + lnumverts * VERTEXSIZE * sizeof( float )); + poly = Mem_Calloc( r_temppool, sizeof( glpoly2_t ) + lnumverts * VERTEXSIZE * sizeof( float )); poly->next = pdecal->polys; poly->flags = surf->flags; pdecal->polys = poly; @@ -829,7 +829,7 @@ void R_DecalShoot( int textureIndex, int entityIndex, int modelIndex, vec3_t pos // triangles the same way. float *R_DecalSetupVerts( decal_t *pDecal, msurface_t *surf, int texture, int *outCount ) { - glpoly_t *p = pDecal->polys; + glpoly2_t *p = pDecal->polys; int i, count; float *v, *v2; diff --git a/ref/gl/gl_local.h b/ref/gl/gl_local.h index 69074d49..e6f58fc8 100644 --- a/ref/gl/gl_local.h +++ b/ref/gl/gl_local.h @@ -433,7 +433,7 @@ void R_DrawWaterSurfaces( void ); void R_DrawBrushModel( cl_entity_t *e ); void GL_SubdivideSurface( model_t *mod, msurface_t *fa ); void GL_BuildPolygonFromSurface( model_t *mod, msurface_t *fa ); -void DrawGLPoly( glpoly_t *p, float xScale, float yScale ); +void DrawGLPoly( glpoly2_t *p, float xScale, float yScale ); texture_t *R_TextureAnimation( msurface_t *s ); void GL_SetupFogColorForSurfaces( void ); void R_DrawAlphaTextureChains( void ); diff --git a/ref/gl/gl_rsurf.c b/ref/gl/gl_rsurf.c index 05a84e79..f21ce00b 100644 --- a/ref/gl/gl_rsurf.c +++ b/ref/gl/gl_rsurf.c @@ -132,7 +132,7 @@ static void SubdividePolygon_r( model_t *loadmodel, msurface_t *warpface, int nu int i, j, k, f, b; float sample_size; vec3_t mins, maxs; - glpoly_t *poly; + glpoly2_t *poly; if( numverts > ( SUBDIVIDE_SIZE - 4 )) gEngfuncs.Host_Error( "%s: too many vertexes on face ( %i )\n", __func__, numverts ); @@ -196,7 +196,7 @@ static void SubdividePolygon_r( model_t *loadmodel, msurface_t *warpface, int nu 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 * VERTEXSIZE * sizeof( float )); + poly = Mem_Calloc( loadmodel->mempool, sizeof( glpoly2_t ) + numverts * VERTEXSIZE * sizeof( float )); poly->next = warpface->polys; poly->flags = warpface->flags; warpface->polys = poly; @@ -302,7 +302,7 @@ void GL_BuildPolygonFromSurface( model_t *mod, msurface_t *fa ) float sample_size; texture_t *tex; gl_texture_t *glt; - glpoly_t *poly; + glpoly2_t *poly; if( !mod || !fa->texinfo || !fa->texinfo->texture ) return; // bad polygon ? @@ -328,7 +328,7 @@ void GL_BuildPolygonFromSurface( model_t *mod, msurface_t *fa ) fa->polys = NULL; // quake simple models (healthkits etc) need to be reconstructed their polys because LM coords has changed after the map change - poly = Mem_Realloc( mod->mempool, poly, sizeof( glpoly_t ) + lnumverts * VERTEXSIZE * sizeof( float )); + poly = Mem_Realloc( mod->mempool, poly, sizeof( glpoly2_t ) + lnumverts * VERTEXSIZE * sizeof( float )); poly->next = fa->polys; poly->flags = fa->flags; fa->polys = poly; @@ -773,7 +773,7 @@ static void R_BuildLightMap( msurface_t *surf, byte *dest, int stride, qboolean DrawGLPoly ================ */ -void DrawGLPoly( glpoly_t *p, float xScale, float yScale ) +void DrawGLPoly( glpoly2_t *p, float xScale, float yScale ) { float *v; float sOffset, sy; @@ -851,7 +851,7 @@ DrawGLPolyChain Render lightmaps ================ */ -static void DrawGLPolyChain( glpoly_t *p, float soffset, float toffset ) +static void DrawGLPolyChain( glpoly2_t *p, float soffset, float toffset ) { qboolean dynamic = true; @@ -3527,7 +3527,7 @@ static void R_DrawTriangleOutlines( void ) { int i, j; msurface_t *surf; - glpoly_t *p; + glpoly2_t *p; float *v; if( !gl_wireframe.value ) diff --git a/ref/gl/gl_warp.c b/ref/gl/gl_warp.c index 1d97ace0..079eae13 100644 --- a/ref/gl/gl_warp.c +++ b/ref/gl/gl_warp.c @@ -283,13 +283,13 @@ R_AddSkyBoxSurface void R_AddSkyBoxSurface( msurface_t *fa ) { vec3_t verts[MAX_CLIP_VERTS]; - glpoly_t *p; + glpoly2_t *p; float *v; int i; if( FBitSet( tr.world->flags, FWORLD_SKYSPHERE ) && fa->polys && !FBitSet( tr.world->flags, FWORLD_CUSTOM_SKYBOX )) { - glpoly_t *p = fa->polys; + glpoly2_t *p = fa->polys; // draw the sky poly pglBegin( GL_POLYGON ); @@ -569,7 +569,7 @@ void EmitWaterPolys( msurface_t *warp, qboolean reverse ) { float *v, nv, waveHeight; float s, t, os, ot; - glpoly_t *p; + glpoly2_t *p; int i; const qboolean useQuads = FBitSet( warp->flags, SURF_DRAWTURB_QUADS ) && glConfig.context == CONTEXT_TYPE_GL; diff --git a/ref/soft/r_decals.c b/ref/soft/r_decals.c index 3f673bcb..98364d03 100644 --- a/ref/soft/r_decals.c +++ b/ref/soft/r_decals.c @@ -511,10 +511,10 @@ R_DecalCreatePoly creates mesh for decal on first rendering ==================== */ -static glpoly_t *R_DecalCreatePoly( decalinfo_t *decalinfo, decal_t *pdecal, msurface_t *surf ) +static glpoly2_t *R_DecalCreatePoly( decalinfo_t *decalinfo, decal_t *pdecal, msurface_t *surf ) { int lnumverts; - glpoly_t *poly; + glpoly2_t *poly; float *v; int i; @@ -527,7 +527,7 @@ static glpoly_t *R_DecalCreatePoly( decalinfo_t *decalinfo, decal_t *pdecal, msu // allocate glpoly // REFTODO: com_studiocache pool! - poly = Mem_Calloc( r_temppool, sizeof( glpoly_t ) + lnumverts * VERTEXSIZE * sizeof( float )); + poly = Mem_Calloc( r_temppool, sizeof( glpoly2_t ) + lnumverts * VERTEXSIZE * sizeof( float )); poly->next = pdecal->polys; poly->flags = surf->flags; pdecal->polys = poly; @@ -853,7 +853,7 @@ void GAME_EXPORT R_DecalShoot( int textureIndex, int entityIndex, int modelIndex // triangles the same way. float * GAME_EXPORT R_DecalSetupVerts( decal_t *pDecal, msurface_t *surf, int texture, int *outCount ) { - glpoly_t *p = pDecal->polys; + glpoly2_t *p = pDecal->polys; int i, count; float *v, *v2; diff --git a/ref/soft/r_local.h b/ref/soft/r_local.h index e057fa0e..cd56b720 100644 --- a/ref/soft/r_local.h +++ b/ref/soft/r_local.h @@ -500,7 +500,7 @@ void R_DrawWaterSurfaces( void ); void R_DrawBrushModel( cl_entity_t *e ); void GL_SubdivideSurface( msurface_t *fa ); void GL_BuildPolygonFromSurface( model_t *mod, msurface_t *fa ); -void DrawGLPoly( glpoly_t *p, float xScale, float yScale ); +void DrawGLPoly( glpoly2_t *p, float xScale, float yScale ); texture_t *R_TextureAnimation( msurface_t *s ); void GL_SetupFogColorForSurfaces( void ); void R_DrawAlphaTextureChains( void );