mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-02-22 03:31:34 +00:00
[renderer] Return number of nearby dynamic lights
It allows for a minor optimization when allocating resources for those lights.
This commit is contained in:
parent
a50bc1c6ef
commit
7487a00b36
2 changed files with 3 additions and 2 deletions
|
@ -76,7 +76,7 @@ void R_LoadSkys (const char *);
|
||||||
|
|
||||||
void R_ClearEfrags (void);
|
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);
|
dlight_t *R_AllocDlight (int key);
|
||||||
void R_DecayLights (double frametime);
|
void R_DecayLights (double frametime);
|
||||||
void R_ClearDlights (void);
|
void R_ClearDlights (void);
|
||||||
|
|
|
@ -52,7 +52,7 @@ vec3_t ambientcolor;
|
||||||
unsigned int r_maxdlights;
|
unsigned int r_maxdlights;
|
||||||
static int r_dlightframecount;
|
static int r_dlightframecount;
|
||||||
|
|
||||||
void
|
int
|
||||||
R_FindNearLights (vec4f_t pos, int count, dlight_t **lights)
|
R_FindNearLights (vec4f_t pos, int count, dlight_t **lights)
|
||||||
{
|
{
|
||||||
float *scores = alloca (count * sizeof (float));
|
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++)
|
for (j = num; j < count; j++)
|
||||||
lights[j] = 0;
|
lights[j] = 0;
|
||||||
|
return num;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
Loading…
Reference in a new issue