mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-07-17 19:07:26 +01:00
Lighting performance tweaks (#2200)
Port of tgstation/tgstation#26975. Changes the lighting engine to apply lighting changes in one step using stored lum value differences instead of two steps (remove_lum, add_lum). Seems to show a speedup in lighting updates as well as a reduction in server memory usage due to aggressive freeing of unneeded lists. Lighting overlays also default to fullbright instead of fulldark so movable area transitions look less strange.
This commit is contained in:
@@ -55,7 +55,7 @@ var/datum/controller/subsystem/lighting/SSlighting
|
||||
if (!A.dynamic_lighting)
|
||||
continue
|
||||
|
||||
new /atom/movable/lighting_overlay(T, TRUE)
|
||||
new /atom/movable/lighting_overlay(T)
|
||||
overlaycount++
|
||||
|
||||
CHECK_TICK
|
||||
@@ -95,17 +95,9 @@ var/datum/controller/subsystem/lighting/SSlighting
|
||||
var/datum/light_source/L = curr_lights[curr_lights.len]
|
||||
curr_lights.len--
|
||||
|
||||
if(QDELETED(L) || L.check() || L.force_update)
|
||||
L.remove_lum()
|
||||
if(!QDELETED(L))
|
||||
L.apply_lum()
|
||||
L.update_corners()
|
||||
|
||||
else if(L.vis_update) //We smartly update only tiles that became (in) visible to use.
|
||||
L.smart_vis_update()
|
||||
|
||||
L.vis_update = FALSE
|
||||
L.force_update = FALSE
|
||||
L.needs_update = FALSE
|
||||
L.needs_update = LIGHTING_NO_UPDATE
|
||||
|
||||
processed_lights++
|
||||
|
||||
|
||||
Reference in New Issue
Block a user