Skip to content

Commit

Permalink
Merge pull request #1094 from 0lvin/light_code_style
Browse files Browse the repository at this point in the history
Rename functions r_dlightframecount parameter to lightframecount
  • Loading branch information
Yamagi committed Apr 1, 2024
2 parents 9569f41 + 764c977 commit 48a4e53
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
12 changes: 6 additions & 6 deletions src/client/refresh/files/surf.c
Expand Up @@ -80,7 +80,7 @@ if surface is affected by this light
=============
*/
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)
{
cplane_t *splitplane;
Expand All @@ -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)
{
R_MarkLights (light, bit, node->children[0], r_dlightframecount,
R_MarkLights (light, bit, node->children[0], lightframecount,
mark_surface_lights);
return;
}

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);
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);
R_MarkLights(light, bit, node->children[1], r_dlightframecount,
R_MarkLights(light, bit, node->children[1], lightframecount,
mark_surface_lights);
}

Expand Down
6 changes: 3 additions & 3 deletions src/client/refresh/gl1/gl1_light.c
Expand Up @@ -119,7 +119,7 @@ R_RenderDlights(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;
int i;
Expand Down Expand Up @@ -148,10 +148,10 @@ R_MarkSurfaceLights(dlight_t *light, int bit, mnode_t *node, int r_dlightframeco
continue;
}

if (surf->dlightframe != r_dlightframecount)
if (surf->dlightframe != lightframecount)
{
surf->dlightbits = 0;
surf->dlightframe = r_dlightframecount;
surf->dlightframe = lightframecount;
}

surf->dlightbits |= bit;
Expand Down
2 changes: 1 addition & 1 deletion src/client/refresh/gl1/header/local.h
Expand Up @@ -279,7 +279,7 @@ void R_AddSkySurface(msurface_t *fa);
void R_ClearSkyBox(void);
void R_DrawSkyBox(void);
void R_MarkSurfaceLights(dlight_t *light, int bit, mnode_t *node,
int r_dlightframecount);
int lightframecount);

void COM_StripExtension(char *in, char *out);

Expand Down
4 changes: 2 additions & 2 deletions src/client/refresh/ref_shared.h
Expand Up @@ -213,8 +213,8 @@ extern mleaf_t *Mod_PointInLeaf(const vec3_t p, mnode_t *node);
#define DLIGHT_CUTOFF 64

typedef void (*marksurfacelights_t)(dlight_t *light, int bit, mnode_t *node,
int r_dlightframecount);
extern void R_MarkLights (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 lightframecount,
marksurfacelights_t mark_surface_lights);
extern struct image_s *R_TextureAnimation(const entity_t *currententity,
const mtexinfo_t *tex);
Expand Down
6 changes: 3 additions & 3 deletions src/client/refresh/soft/sw_light.c
Expand Up @@ -30,7 +30,7 @@ DYNAMIC LIGHTS
*/

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;
int i;
Expand All @@ -39,10 +39,10 @@ R_MarkSurfaceLights(dlight_t *light, int bit, mnode_t *node, int r_dlightframeco
surf = r_worldmodel->surfaces + node->firstsurface;
for (i = 0; i < node->numsurfaces; i++, surf++)
{
if (surf->dlightframe != r_dlightframecount)
if (surf->dlightframe != lightframecount)
{
surf->dlightbits = 0;
surf->dlightframe = r_dlightframecount;
surf->dlightframe = lightframecount;
}
surf->dlightbits |= bit;
}
Expand Down

0 comments on commit 48a4e53

Please sign in to comment.