Skip to content

Commit

Permalink
ref: soft: remove useless R_CountDynamicLights function
Browse files Browse the repository at this point in the history
  • Loading branch information
a1batross committed Jan 27, 2024
1 parent 5696c9c commit 963d9b8
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 23 deletions.
20 changes: 0 additions & 20 deletions ref/soft/r_light.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,26 +174,6 @@ void R_PushDlights( void )
}
}

/*
=============
R_CountSurfaceDlights
=============
*/
int R_CountSurfaceDlights( msurface_t *surf )
{
int i, numDlights = 0;

for( i = 0; i < MAX_DLIGHTS; i++ )
{
if(!( surf->dlightbits & BIT( i )))
continue; // not lit by this light

numDlights++;
}

return numDlights;
}

/*
=======================================================================
Expand Down
1 change: 0 additions & 1 deletion ref/soft/r_local.h
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,6 @@ void R_AnimateLight( void );
void R_GetLightSpot( vec3_t lightspot );
void R_MarkLights( dlight_t *light, int bit, mnode_t *node );
colorVec R_LightVec( const vec3_t start, const vec3_t end, vec3_t lightspot, vec3_t lightvec );
int R_CountSurfaceDlights( msurface_t *surf );
colorVec R_LightPoint( const vec3_t p0 );
#endif
//
Expand Down
4 changes: 2 additions & 2 deletions ref/soft/r_surf.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ static void R_BuildLightMap( void );
R_AddDynamicLights
===============
*/
void R_AddDynamicLights( msurface_t *surf )
static void R_AddDynamicLights( msurface_t *surf )
{
float dist, rad, minlight;
int lnum, s, t, sd, td, smax, tmax;
Expand All @@ -86,7 +86,7 @@ void R_AddDynamicLights( msurface_t *surf )
uint *bl;

// no dlighted surfaces here
//if( !R_CountSurfaceDlights( surf )) return;
if( !surf->dlightbits ) return;

sample_size = gEngfuncs.Mod_SampleSizeForFace( surf );
smax = (info->lightextents[0] / sample_size) + 1;
Expand Down

0 comments on commit 963d9b8

Please # to comment.