Rename functions r_dlightframecount parameter to lightframecount

Renders has global variable with such name that used as parameters
for R_MarkLights shared function.

Fixes:
 * https://github.com/yquake2/yquake2remaster/issues/17
 * https://github.com/yquake2/yquake2/issues/1093
This commit is contained in:
BraXi 2024-03-23 23:10:19 +02:00 committed by Denis Pauk
parent e72ef48ae7
commit 764c977106
5 changed files with 15 additions and 15 deletions

View file

@ -80,7 +80,7 @@ if surface is affected by this light
============= =============
*/ */
void void
R_MarkLights(dlight_t *light, int bit, mnode_t *node, int r_dlightframecount, R_MarkLights(dlight_t *light, int bit, mnode_t *node, int lightframecount,
marksurfacelights_t mark_surface_lights) marksurfacelights_t mark_surface_lights)
{ {
cplane_t *splitplane; cplane_t *splitplane;
@ -97,23 +97,23 @@ R_MarkLights(dlight_t *light, int bit, mnode_t *node, int r_dlightframecount,
if (dist > intensity - DLIGHT_CUTOFF) // (dist > light->intensity) if (dist > intensity - DLIGHT_CUTOFF) // (dist > light->intensity)
{ {
R_MarkLights (light, bit, node->children[0], r_dlightframecount, R_MarkLights (light, bit, node->children[0], lightframecount,
mark_surface_lights); mark_surface_lights);
return; return;
} }
if (dist < -intensity + DLIGHT_CUTOFF) // (dist < -light->intensity) if (dist < -intensity + DLIGHT_CUTOFF) // (dist < -light->intensity)
{ {
R_MarkLights(light, bit, node->children[1], r_dlightframecount, R_MarkLights(light, bit, node->children[1], lightframecount,
mark_surface_lights); mark_surface_lights);
return; return;
} }
mark_surface_lights(light, bit, node, r_dlightframecount); mark_surface_lights(light, bit, node, lightframecount);
R_MarkLights(light, bit, node->children[0], r_dlightframecount, R_MarkLights(light, bit, node->children[0], lightframecount,
mark_surface_lights); mark_surface_lights);
R_MarkLights(light, bit, node->children[1], r_dlightframecount, R_MarkLights(light, bit, node->children[1], lightframecount,
mark_surface_lights); mark_surface_lights);
} }

View file

@ -119,7 +119,7 @@ R_RenderDlights(void)
} }
void void
R_MarkSurfaceLights(dlight_t *light, int bit, mnode_t *node, int r_dlightframecount) R_MarkSurfaceLights(dlight_t *light, int bit, mnode_t *node, int lightframecount)
{ {
msurface_t *surf; msurface_t *surf;
int i; int i;
@ -148,10 +148,10 @@ R_MarkSurfaceLights(dlight_t *light, int bit, mnode_t *node, int r_dlightframeco
continue; continue;
} }
if (surf->dlightframe != r_dlightframecount) if (surf->dlightframe != lightframecount)
{ {
surf->dlightbits = 0; surf->dlightbits = 0;
surf->dlightframe = r_dlightframecount; surf->dlightframe = lightframecount;
} }
surf->dlightbits |= bit; surf->dlightbits |= bit;

View file

@ -279,7 +279,7 @@ void R_AddSkySurface(msurface_t *fa);
void R_ClearSkyBox(void); void R_ClearSkyBox(void);
void R_DrawSkyBox(void); void R_DrawSkyBox(void);
void R_MarkSurfaceLights(dlight_t *light, int bit, mnode_t *node, void R_MarkSurfaceLights(dlight_t *light, int bit, mnode_t *node,
int r_dlightframecount); int lightframecount);
void COM_StripExtension(char *in, char *out); void COM_StripExtension(char *in, char *out);

View file

@ -213,8 +213,8 @@ extern mleaf_t *Mod_PointInLeaf(const vec3_t p, mnode_t *node);
#define DLIGHT_CUTOFF 64 #define DLIGHT_CUTOFF 64
typedef void (*marksurfacelights_t)(dlight_t *light, int bit, mnode_t *node, typedef void (*marksurfacelights_t)(dlight_t *light, int bit, mnode_t *node,
int r_dlightframecount); int lightframecount);
extern void R_MarkLights (dlight_t *light, int bit, mnode_t *node, int r_dlightframecount, extern void R_MarkLights(dlight_t *light, int bit, mnode_t *node, int lightframecount,
marksurfacelights_t mark_surface_lights); marksurfacelights_t mark_surface_lights);
extern struct image_s *R_TextureAnimation(const entity_t *currententity, extern struct image_s *R_TextureAnimation(const entity_t *currententity,
const mtexinfo_t *tex); const mtexinfo_t *tex);

View file

@ -30,7 +30,7 @@ DYNAMIC LIGHTS
*/ */
static void static void
R_MarkSurfaceLights(dlight_t *light, int bit, mnode_t *node, int r_dlightframecount) R_MarkSurfaceLights(dlight_t *light, int bit, mnode_t *node, int lightframecount)
{ {
msurface_t *surf; msurface_t *surf;
int i; int i;
@ -39,10 +39,10 @@ R_MarkSurfaceLights(dlight_t *light, int bit, mnode_t *node, int r_dlightframeco
surf = r_worldmodel->surfaces + node->firstsurface; surf = r_worldmodel->surfaces + node->firstsurface;
for (i = 0; i < node->numsurfaces; i++, surf++) for (i = 0; i < node->numsurfaces; i++, surf++)
{ {
if (surf->dlightframe != r_dlightframecount) if (surf->dlightframe != lightframecount)
{ {
surf->dlightbits = 0; surf->dlightbits = 0;
surf->dlightframe = r_dlightframecount; surf->dlightframe = lightframecount;
} }
surf->dlightbits |= bit; surf->dlightbits |= bit;
} }