2
0
mirror of https://github.com/FWGS/xash3d-fwgs synced 2024-12-27 11:16:43 +01:00

ref: rename glpoly_t to glpoly2_t to make the changes more obvious and easier to notice

This commit is contained in:
Alibek Omarov 2024-08-10 13:44:49 +03:00
parent d2d6ed8bd4
commit 677464d04d
7 changed files with 26 additions and 26 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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 );

View File

@ -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 )

View File

@ -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;

View File

@ -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;

View File

@ -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 );