Adaptive lighting updates (#1679)

This PR simplifies the lighting update system (removes update_type) and instead makes the lighting system decide which update method to use based on server load.

Instant updates are used during low-load, scheduled during high.

Also removes: update_lights_now() (redundant), diff_light() (unused).
This commit is contained in:
Lohikar
2017-01-30 16:37:56 -06:00
committed by skull132
parent 51f9c63589
commit 1d5287dad0
9 changed files with 90 additions and 102 deletions
+2 -1
View File
@@ -26,6 +26,7 @@
/datum/controller/process/lighting/statProcess()
..()
stat(null, "Current server tick usage is [world.tick_usage], threshold is [TICK_LIMIT].")
stat(null, "[all_lighting_overlays.len] overlays ([all_lighting_corners.len] corners)")
stat(null, "Lights: [lighting_update_lights.len] queued, [curr_lights.len] processing")
stat(null, "Corners: [lighting_update_corners.len] queued, [curr_corners.len] processing")
@@ -43,7 +44,7 @@
var/datum/light_source/L = curr_lights[curr_lights.len]
curr_lights.len--
if(L.check() || L.destroyed || L.force_update)
if(L.destroyed || L.check() || L.force_update)
L.remove_lum()
if(!L.destroyed)
L.apply_lum()