Fix various warnings

This commit is contained in:
Tim Angus committed 2025-09-07 17:03:20 +01:00
1 parent 549b686e22
commit f976711fb4
58 files changed
+384 -425

No files matched your search

+3 -3
View File
@@ -531,12 +531,12 @@ void RB_RenderDrawSurfList( drawSurf_t *drawSurfs, int numDrawSurfs ) {
backEnd.pc.c_surfaces += numDrawSurfs;
for (i = 0, drawSurf = drawSurfs ; i < numDrawSurfs ; i++, drawSurf++) {
if ( drawSurf->sort == oldSort ) {
if ( drawSurf->sort == (unsigned)oldSort ) {
// fast path, same as previous sort
rb_surfaceTable[ *drawSurf->surface ]( drawSurf->surface );
continue;
}
oldSort = drawSurf->sort;
oldSort = (int)drawSurf->sort;
R_DecomposeSort( drawSurf->sort, &entityNum, &shader, &fogNum, &dlighted );
//
@@ -670,7 +670,7 @@ void RB_RenderDrawSurfList( drawSurf_t *drawSurfs, int numDrawSurfs ) {
}
if (r_drawSun->integer) {
RB_DrawSun(0.1, tr.sunShader);
RB_DrawSun(0.1f, tr.sunShader);
}
// darken down any stencil shadows
-3
View File
@@ -138,7 +138,6 @@ static void R_LoadLightmaps( lump_t *l ) {
byte image[LIGHTMAP_SIZE*LIGHTMAP_SIZE*4];
int i, j;
float maxIntensity = 0;
double sumIntensity = 0;
len = l->filelen;
if ( !len ) {
@@ -193,8 +192,6 @@ static void R_LoadLightmaps( lump_t *l ) {
image[j*4+1] = out[1] * 255;
image[j*4+2] = out[2] * 255;
image[j*4+3] = 255;
sumIntensity += intensity;
}
} else {
for ( j = 0 ; j < LIGHTMAP_SIZE * LIGHTMAP_SIZE; j++ ) {
+2 -2
View File
@@ -193,9 +193,9 @@ void RE_SetColor( const float *rgba ) {
}
cmd->commandId = RC_SET_COLOR;
if ( !rgba ) {
static float colorWhite[4] = { 1, 1, 1, 1 };
static float white[4] = { 1.0f, 1.0f, 1.0f, 1.0f };
rgba = colorWhite;
rgba = white;
}
cmd->color[0] = rgba[0];
+5 -8
View File
@@ -113,7 +113,6 @@ static void MakeMeshNormals( int width, int height, drawVert_t ctrl[MAX_GRID_SIZ
int i, j, k, dist;
vec3_t normal;
vec3_t sum;
int count = 0;
vec3_t base;
vec3_t delta;
int x, y;
@@ -153,7 +152,6 @@ static int neighbors[8][2] = {
for ( i = 0 ; i < width ; i++ ) {
for ( j = 0 ; j < height ; j++ ) {
count = 0;
dv = &ctrl[j][i];
VectorCopy( dv->xyz, base );
for ( k = 0 ; k < 8 ; k++ ) {
@@ -202,7 +200,6 @@ static int neighbors[8][2] = {
continue;
}
VectorAdd( normal, sum, sum );
count++;
}
//if ( count == 0 ) {
// printf("bad normal\n");
@@ -391,7 +388,7 @@ srfGridMesh_t *R_SubdividePatchToGrid( int width, int height,
for ( i = 0 ; i < height ; i++ ) {
vec3_t midxyz;
vec3_t midxyz2;
vec3_t dir;
vec3_t dirVector;
vec3_t projected;
float d;
@@ -406,11 +403,11 @@ srfGridMesh_t *R_SubdividePatchToGrid( int width, int height,
// texture warping, but it gives a lot less polygons than
// dist-from-midpoint
VectorSubtract( midxyz, ctrl[i][j].xyz, midxyz );
VectorSubtract( ctrl[i][j+2].xyz, ctrl[i][j].xyz, dir );
VectorNormalize( dir );
VectorSubtract( ctrl[i][j+2].xyz, ctrl[i][j].xyz, dirVector );
VectorNormalize( dirVector );
d = DotProduct( midxyz, dir );
VectorScale( dir, d, projected );
d = DotProduct( midxyz, dirVector );
VectorScale( dirVector, d, projected );
VectorSubtract( midxyz, projected, midxyz2);
len = VectorLengthSquared( midxyz2 ); // we will do the sqrt later
if ( len > maxLen ) {
-2
View File
@@ -855,7 +855,6 @@ static qboolean SurfIsOffscreen( const drawSurf_t *drawSurf, vec4_t clipDest[128
int dlighted;
vec4_t clip, eye;
int i;
unsigned int pointOr = 0;
unsigned int pointAnd = (unsigned int)~0;
R_RotateForViewer();
@@ -885,7 +884,6 @@ static qboolean SurfIsOffscreen( const drawSurf_t *drawSurf, vec4_t clipDest[128
}
}
pointAnd &= pointFlags;
pointOr |= pointFlags;
}
// trivially reject
+1 -1
View File
@@ -58,7 +58,7 @@ static int c_vertexes; // for seeing how long our average strips are
static int c_begins;
static void R_DrawStripElements( int numIndexes, const glIndex_t *indexes, void ( APIENTRY *element )(GLint) ) {
int i;
int last[3] = { -1, -1, -1 };
glIndex_t last[3];
qboolean even;
c_begins++;
+1 -1
View File
@@ -417,7 +417,7 @@ Autosprite2Deform
Autosprite2 will pivot a rectangular quad along the center of its long axis
=====================
*/
int edgeVerts[6][2] = {
glIndex_t edgeVerts[6][2] = {
{ 0, 1 },
{ 0, 2 },
{ 0, 3 },
+18 -18
View File
@@ -1953,7 +1953,7 @@ static void FixRenderCommandList( int newShader ) {
{
int i;
drawSurf_t *drawSurf;
shader_t *shader;
shader_t *pShader;
int fogNum;
int entityNum;
int dlightMap;
@@ -1961,7 +1961,7 @@ static void FixRenderCommandList( int newShader ) {
const drawSurfsCommand_t *ds_cmd = (const drawSurfsCommand_t *)curCmd;
for( i = 0, drawSurf = ds_cmd->drawSurfs; i < ds_cmd->numDrawSurfs; i++, drawSurf++ ) {
R_DecomposeSort( drawSurf->sort, &entityNum, &shader, &fogNum, &dlightMap );
R_DecomposeSort( drawSurf->sort, &entityNum, &pShader, &fogNum, &dlightMap );
sortedIndex = (( drawSurf->sort >> QSORT_SHADERNUM_SHIFT ) & (MAX_SHADERS-1));
if( sortedIndex >= newShader ) {
sortedIndex++;
@@ -2879,56 +2879,56 @@ A second parameter will cause it to print in sorted order
void R_ShaderList_f (void) {
int i;
int count;
shader_t *shader;
shader_t *pShader;
ri.Printf (PRINT_ALL, "-----------------------\n");
count = 0;
for ( i = 0 ; i < tr.numShaders ; i++ ) {
if ( ri.Cmd_Argc() > 1 ) {
shader = tr.sortedShaders[i];
pShader = tr.sortedShaders[i];
} else {
shader = tr.shaders[i];
pShader = tr.shaders[i];
}
ri.Printf( PRINT_ALL, "%i ", shader->numUnfoggedPasses );
ri.Printf( PRINT_ALL, "%i ", pShader->numUnfoggedPasses );
if (shader->lightmapIndex >= 0 ) {
if (pShader->lightmapIndex >= 0 ) {
ri.Printf (PRINT_ALL, "L ");
} else {
ri.Printf (PRINT_ALL, " ");
}
if ( shader->multitextureEnv == GL_ADD ) {
if ( pShader->multitextureEnv == GL_ADD ) {
ri.Printf( PRINT_ALL, "MT(a) " );
} else if ( shader->multitextureEnv == GL_MODULATE ) {
} else if ( pShader->multitextureEnv == GL_MODULATE ) {
ri.Printf( PRINT_ALL, "MT(m) " );
} else if ( shader->multitextureEnv == GL_DECAL ) {
} else if ( pShader->multitextureEnv == GL_DECAL ) {
ri.Printf( PRINT_ALL, "MT(d) " );
} else {
ri.Printf( PRINT_ALL, " " );
}
if ( shader->explicitlyDefined ) {
if ( pShader->explicitlyDefined ) {
ri.Printf( PRINT_ALL, "E " );
} else {
ri.Printf( PRINT_ALL, " " );
}
if ( shader->optimalStageIteratorFunc == RB_StageIteratorGeneric ) {
if ( pShader->optimalStageIteratorFunc == RB_StageIteratorGeneric ) {
ri.Printf( PRINT_ALL, "gen " );
} else if ( shader->optimalStageIteratorFunc == RB_StageIteratorSky ) {
} else if ( pShader->optimalStageIteratorFunc == RB_StageIteratorSky ) {
ri.Printf( PRINT_ALL, "sky " );
} else if ( shader->optimalStageIteratorFunc == RB_StageIteratorLightmappedMultitexture ) {
} else if ( pShader->optimalStageIteratorFunc == RB_StageIteratorLightmappedMultitexture ) {
ri.Printf( PRINT_ALL, "lmmt" );
} else if ( shader->optimalStageIteratorFunc == RB_StageIteratorVertexLitTexture ) {
} else if ( pShader->optimalStageIteratorFunc == RB_StageIteratorVertexLitTexture ) {
ri.Printf( PRINT_ALL, "vlt " );
} else {
ri.Printf( PRINT_ALL, " " );
}
if ( shader->defaultShader ) {
ri.Printf (PRINT_ALL, ": %s (DEFAULTED)\n", shader->name);
if ( pShader->defaultShader ) {
ri.Printf (PRINT_ALL, ": %s (DEFAULTED)\n", pShader->name);
} else {
ri.Printf (PRINT_ALL, ": %s\n", shader->name);
ri.Printf (PRINT_ALL, ": %s\n", pShader->name);
}
count++;
}
+2 -8
View File
@@ -46,7 +46,7 @@ static int numEdgeDefs[SHADER_MAX_VERTEXES];
static int facing[SHADER_MAX_INDEXES/3];
static vec3_t shadowXyz[SHADER_MAX_VERTEXES];
void R_AddEdgeDef( int i1, int i2, int facing ) {
void R_AddEdgeDef( int i1, int i2, int localFacing ) {
int c;
c = numEdgeDefs[ i1 ];
@@ -54,7 +54,7 @@ void R_AddEdgeDef( int i1, int i2, int facing ) {
return; // overflow
}
edgeDefs[ i1 ][ c ].i2 = i2;
edgeDefs[ i1 ][ c ].facing = facing;
edgeDefs[ i1 ][ c ].facing = localFacing;
numEdgeDefs[ i1 ]++;
}
@@ -94,15 +94,12 @@ void R_RenderShadowEdges( void ) {
int c, c2;
int j, k;
int i2;
int c_edges, c_rejected;
int hit[2];
// an edge is NOT a silhouette edge if its face doesn't face the light,
// or if it has a reverse paired edge that also faces the light.
// A well behaved polyhedron would have exactly two faces for each edge,
// but lots of models have dangling edges or overfanned edges
c_edges = 0;
c_rejected = 0;
for ( i = 0 ; i < tess.numVertexes ; i++ ) {
c = numEdgeDefs[ i ];
@@ -131,9 +128,6 @@ void R_RenderShadowEdges( void ) {
qglVertex3fv( tess.xyz[ i2 ] );
qglVertex3fv( shadowXyz[ i2 ] );
qglEnd();
c_edges++;
} else {
c_rejected++;
}
}
}