[renderer] Return number of nearby dynamic lights

It allows for a minor optimization when allocating resources for those
lights.
This commit is contained in:
Bill Currie 2023-08-01 23:28:24 +09:00
parent a50bc1c6ef
commit 7487a00b36
2 changed files with 3 additions and 2 deletions

View file

@ -76,7 +76,7 @@ void R_LoadSkys (const char *);
void R_ClearEfrags (void);
void R_FindNearLights (vec4f_t pos, int count, dlight_t **lights);
int R_FindNearLights (vec4f_t pos, int count, dlight_t **lights);
dlight_t *R_AllocDlight (int key);
void R_DecayLights (double frametime);
void R_ClearDlights (void);

View file

@ -52,7 +52,7 @@ vec3_t ambientcolor;
unsigned int r_maxdlights;
static int r_dlightframecount;
void
int
R_FindNearLights (vec4f_t pos, int count, dlight_t **lights)
{
float *scores = alloca (count * sizeof (float));
@ -104,6 +104,7 @@ R_FindNearLights (vec4f_t pos, int count, dlight_t **lights)
}
for (j = num; j < count; j++)
lights[j] = 0;
return num;
}
void