MCPcopy Create free account
hub / github.com/diasurgical/DevilutionX / ProcessLightList

Function ProcessLightList

Source/lighting.cpp:557–589  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

555}
556
557void ProcessLightList()
558{
559#ifdef _DEBUG
560 if (DisableLighting)
561 return;
562#endif
563 if (!UpdateLighting)
564 return;
565 for (int i = 0; i < ActiveLightCount; i++) {
566 Light &light = Lights[ActiveLights[i]];
567 if (light.isInvalid) {
568 DoUnLight(light.position.tile, light.radius);
569 }
570 if (light.hasChanged) {
571 DoUnLight(light.position.old, light.oldRadius);
572 light.hasChanged = false;
573 }
574 }
575 for (int i = 0; i < ActiveLightCount; i++) {
576 const Light &light = Lights[ActiveLights[i]];
577 if (light.isInvalid) {
578 ActiveLightCount--;
579 std::swap(ActiveLights[ActiveLightCount], ActiveLights[i]);
580 i--;
581 continue;
582 }
583 if (TileHasAny(dPiece[light.position.tile.x][light.position.tile.y], TileProperties::Solid))
584 continue; // Monster hidden in a wall, don't spoil the surprise
585 DoLighting(light.position.tile, light.radius, light.position.offset);
586 }
587
588 UpdateLighting = false;
589}
590
591void SavePreLighting()
592{

Callers 3

LoadGameFunction · 0.85
GameLogicFunction · 0.85
LoadGameLevelFunction · 0.85

Calls 4

DoUnLightFunction · 0.85
TileHasAnyFunction · 0.85
DoLightingFunction · 0.85
swapFunction · 0.50

Tested by

no test coverage detected