-/*
-==================
-R_UpdateLights
-==================
-*/
-void R_UpdateLights(void)
-{
- float frac;
- int i, j, k, l;
-
-// light animations
-// 'm' is normal light, 'a' is no light, 'z' is double bright
- i = (int)(cl.time * 10);
- frac = (cl.time * 10) - i;
- for (j = 0;j < MAX_LIGHTSTYLES;j++)
- {
- if (!cl_lightstyle || !cl_lightstyle[j].length)
- {
- d_lightstylevalue[j] = 256;
- continue;
- }
- k = i % cl_lightstyle[j].length;
- l = (i-1) % cl_lightstyle[j].length;
- k = cl_lightstyle[j].map[k] - 'a';
- l = cl_lightstyle[j].map[l] - 'a';
- d_lightstylevalue[j] = ((k*frac)+(l*(1-frac)))*22;
- }
-
- r_numdlights = 0;
- c_dlights = 0;
-
- if (!r_dynamic.integer || !cl_dlights)
- return;
-
- // TODO: optimize to not scan whole cl_dlights array if possible
- for (i = 0;i < MAX_DLIGHTS;i++)
- {
- if (cl_dlights[i].radius > 0)
- {
- R_RTLight_UpdateFromDLight(&cl_dlights[i].rtlight, &cl_dlights[i], false);
- // FIXME: use pointer instead of copy
- r_dlight[r_numdlights++] = cl_dlights[i];
- c_dlights++; // count every dlight in use
- }
- }
-}
-