MCPcopy Create free account
hub / github.com/assaultcube/AC / dodynlights

Function dodynlights

source/src/worldlight.cpp:302–337  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

300}
301
302void dodynlights()
303{
304 if(dlights.empty()) return;
305 const block *area = NULL;
306 loopv(dlights)
307 {
308 dlight &d = dlights[i];
309 if(lastmillis >= d.expire)
310 {
311 freeblock(d.area);
312 dlights.remove(i--);
313 continue;
314 }
315 if(d.owner)
316 {
317 vec oldo(d.o);
318 d.o = d.owner->o;
319 d.o.add(d.offset);
320 if(d.o != oldo) preparedynlight(dlights[i]);
321 }
322 }
323 loopv(dlights)
324 {
325 dlight &d = dlights[i];
326 persistent_entity l((int)d.o.x, (int)d.o.y, (int)d.o.z, LIGHT, d.reach, d.r, d.g, d.b);
327 calclightsource(l, d.calcintensity(), false);
328 if(area)
329 {
330 if(insidearea(*area, *d.area)) continue;
331 if(!insidearea(*d.area, *area)) postlightarea(*area);
332 }
333 area = d.area;
334 }
335 if(area) postlightarea(*area);
336 lastcalclight = totalmillis;
337}
338
339void undodynlights()
340{

Callers 1

gl_drawframeFunction · 0.85

Calls 2

postlightareaFunction · 0.85
emptyMethod · 0.45

Tested by

no test coverage detected