3 dlight_t cl_dlights[MAX_DLIGHTS];
5 void cl_light_start(void)
9 void cl_light_shutdown(void)
13 void cl_light_newmap(void)
15 memset (cl_dlights, 0, sizeof(cl_dlights));
18 void CL_Light_Init(void)
20 R_RegisterModule("CL_Light", cl_light_start, cl_light_shutdown, cl_light_newmap);
29 void CL_AllocDlight (entity_render_t *ent, vec3_t org, float radius, float red, float green, float blue, float decay, float lifetime)
34 // first look for an exact key match
38 for (i = 0;i < MAX_DLIGHTS;i++, dl++)
43 // then look for anything else
45 for (i = 0;i < MAX_DLIGHTS;i++, dl++)
53 memset (dl, 0, sizeof(*dl));
55 VectorCopy(org, dl->origin);
61 dl->die = cl.time + lifetime;
71 void CL_DecayLights (void)
77 time = cl.time - cl.oldtime;
81 for (i=0 ; i<MAX_DLIGHTS ; i++, dl++)
85 if (dl->die < cl.time)
91 c_dlights++; // count every dlight in use
93 dl->radius -= time*dl->decay;