diff --git a/src/client/refresh/files/light.c b/src/client/refresh/files/light.c index 5f64918a..c088d52e 100644 --- a/src/client/refresh/files/light.c +++ b/src/client/refresh/files/light.c @@ -495,10 +495,9 @@ R_BuildLightMap(const msurface_t *surf, byte *dest, int stride, const byte *dest { int smax, tmax; int r, g, b, a, max; - int i, j, size; + int i, j, size, nummaps; byte *lightmap; float scale[4]; - int nummaps; float *bl; if (surf->texinfo->flags & diff --git a/src/client/refresh/gl3/gl3_light.c b/src/client/refresh/gl3/gl3_light.c index 6ab4e32b..45ffd441 100644 --- a/src/client/refresh/gl3/gl3_light.c +++ b/src/client/refresh/gl3/gl3_light.c @@ -74,13 +74,13 @@ GL3_BuildLightMap(msurface_t *surf, int offsetInLMbuf, int stride) { int smax, tmax; int r, g, b, a, max; - int i, j, size, map, numMaps; + int i, j, size, map, nummaps; byte *lightmap; if (surf->texinfo->flags & (SURF_SKY | SURF_TRANSPARENT | SURF_WARP)) { - Com_Error(ERR_DROP, "GL3_BuildLightMap called for non-lit surface"); + Com_Error(ERR_DROP, "%s called for non-lit surface", __func__); } smax = (surf->extents[0] >> surf->lmshift) + 1; @@ -95,23 +95,23 @@ GL3_BuildLightMap(msurface_t *surf, int offsetInLMbuf, int stride) } // count number of lightmaps surf actually has - for (numMaps = 0; numMaps < MAX_LIGHTMAPS_PER_SURFACE && surf->styles[numMaps] != 255; ++numMaps) + for (nummaps = 0; nummaps < MAX_LIGHTMAPS_PER_SURFACE && surf->styles[nummaps] != 255; ++nummaps) {} if (!surf->samples) { // no lightmap samples? set at least one lightmap to fullbright, rest to 0 as normal - if (numMaps == 0) numMaps = 1; // make sure at least one lightmap is set to fullbright + if (nummaps == 0) nummaps = 1; // make sure at least one lightmap is set to fullbright for (map = 0; map < MAX_LIGHTMAPS_PER_SURFACE; ++map) { // we always create 4 (MAX_LIGHTMAPS_PER_SURFACE) lightmaps. - // if surf has less (numMaps < 4), the remaining ones are zeroed out. + // if surf has less (nummaps < 4), the remaining ones are zeroed out. // this makes sure that all 4 lightmap textures in gl3state.lightmap_textureIDs[i] have the same layout // and the shader can use the same texture coordinates for all of them - int c = (map < numMaps) ? 255 : 0; + int c = (map < nummaps) ? 255 : 0; byte* dest = gl3_lms.lightmap_buffers[map] + offsetInLMbuf; for (i = 0; i < tmax; i++, dest += stride) @@ -128,13 +128,13 @@ GL3_BuildLightMap(msurface_t *surf, int offsetInLMbuf, int stride) // Note: dynamic lights aren't handled here anymore, they're handled in the shader - // as we don't apply scale here anymore, nor blend the numMaps lightmaps together, + // as we don't apply scale here anymore, nor blend the nummaps lightmaps together, // the code has gotten a lot easier and we can copy directly from surf->samples to dest // without converting to float first etc lightmap = surf->samples; - for(map=0; maptexinfo->flags & (SURF_SKY | SURF_TRANSPARENT | SURF_WARP)) { - Com_Error(ERR_DROP, "GL4_BuildLightMap called for non-lit surface"); + Com_Error(ERR_DROP, "%s called for non-lit surface", __func__); } smax = (surf->extents[0] >> surf->lmshift) + 1; @@ -95,23 +95,23 @@ GL4_BuildLightMap(msurface_t *surf, int offsetInLMbuf, int stride) } // count number of lightmaps surf actually has - for (numMaps = 0; numMaps < MAX_LIGHTMAPS_PER_SURFACE && surf->styles[numMaps] != 255; ++numMaps) + for (nummaps = 0; nummaps < MAX_LIGHTMAPS_PER_SURFACE && surf->styles[nummaps] != 255; ++nummaps) {} if (!surf->samples) { // no lightmap samples? set at least one lightmap to fullbright, rest to 0 as normal - if (numMaps == 0) numMaps = 1; // make sure at least one lightmap is set to fullbright + if (nummaps == 0) nummaps = 1; // make sure at least one lightmap is set to fullbright for (map = 0; map < MAX_LIGHTMAPS_PER_SURFACE; ++map) { // we always create 4 (MAX_LIGHTMAPS_PER_SURFACE) lightmaps. - // if surf has less (numMaps < 4), the remaining ones are zeroed out. + // if surf has less (nummaps < 4), the remaining ones are zeroed out. // this makes sure that all 4 lightmap textures in gl4state.lightmap_textureIDs[i] have the same layout // and the shader can use the same texture coordinates for all of them - int c = (map < numMaps) ? 255 : 0; + int c = (map < nummaps) ? 255 : 0; byte* dest = gl4_lms.lightmap_buffers[map] + offsetInLMbuf; for (i = 0; i < tmax; i++, dest += stride) @@ -128,13 +128,13 @@ GL4_BuildLightMap(msurface_t *surf, int offsetInLMbuf, int stride) // Note: dynamic lights aren't handled here anymore, they're handled in the shader - // as we don't apply scale here anymore, nor blend the numMaps lightmaps together, + // as we don't apply scale here anymore, nor blend the nummaps lightmaps together, // the code has gotten a lot easier and we can copy directly from surf->samples to dest // without converting to float first etc lightmap = surf->samples; - for(map=0; map