mirror of
https://github.com/yogstation13/Yogstation.git
synced 2025-02-26 09:04:50 +00:00
* Makes the HEY LISTEN dialog a bit quieter Now it only prints to admins. It's still logged and everything, for those who want to shave off the <100 ms it takes the server to usually handle this atmos equalization stuff. TBH this is such a, weird debug line, I don't really know why it was kept in as a big dumb to_chat(world) for so long. * Makes the subsystem init dialog look nicer Now, instead of displaying performance times to the whole `world`, an approximate loading % is printed to everyone (with admins getting the old dialog in span_notice style). EDIT: Fixes some stuff Gamer complained about EDIT EDIT: I don't get how SHOULD_CALL_PARENT works * Update yogstation/code/controllers/subsystem/yogs.dm Co-authored-by: nmajask <nmajask@gmail.com> Co-authored-by: Jamie D <993128+JamieD1@users.noreply.github.com> Co-authored-by: nmajask <nmajask@gmail.com>
91 lines
2.1 KiB
Plaintext
91 lines
2.1 KiB
Plaintext
GLOBAL_LIST_EMPTY(lighting_update_lights) // List of lighting sources queued for update.
|
|
GLOBAL_LIST_EMPTY(lighting_update_corners) // List of lighting corners queued for update.
|
|
GLOBAL_LIST_EMPTY(lighting_update_objects) // List of lighting objects queued for update.
|
|
|
|
SUBSYSTEM_DEF(lighting)
|
|
name = "Lighting"
|
|
wait = 2
|
|
init_order = INIT_ORDER_LIGHTING
|
|
flags = SS_TICKER
|
|
|
|
loading_points = 6 SECONDS // Yogs -- loading times
|
|
|
|
/datum/controller/subsystem/lighting/stat_entry(msg)
|
|
msg = "L:[GLOB.lighting_update_lights.len]|C:[GLOB.lighting_update_corners.len]|O:[GLOB.lighting_update_objects.len]"
|
|
return ..()
|
|
|
|
|
|
/datum/controller/subsystem/lighting/Initialize(timeofday)
|
|
if(!initialized)
|
|
if (CONFIG_GET(flag/starlight))
|
|
for(var/I in GLOB.sortedAreas)
|
|
var/area/A = I
|
|
if (A.dynamic_lighting == DYNAMIC_LIGHTING_IFSTARLIGHT)
|
|
A.luminosity = 0
|
|
|
|
create_all_lighting_objects()
|
|
initialized = TRUE
|
|
|
|
fire(FALSE, TRUE)
|
|
|
|
return ..()
|
|
|
|
/datum/controller/subsystem/lighting/fire(resumed, init_tick_checks)
|
|
MC_SPLIT_TICK_INIT(3)
|
|
if(!init_tick_checks)
|
|
MC_SPLIT_TICK
|
|
var/i = 0
|
|
for (i in 1 to GLOB.lighting_update_lights.len)
|
|
var/datum/light_source/L = GLOB.lighting_update_lights[i]
|
|
|
|
L.update_corners()
|
|
|
|
L.needs_update = LIGHTING_NO_UPDATE
|
|
|
|
if(init_tick_checks)
|
|
CHECK_TICK
|
|
else if (MC_TICK_CHECK)
|
|
break
|
|
if (i)
|
|
GLOB.lighting_update_lights.Cut(1, i+1)
|
|
i = 0
|
|
|
|
if(!init_tick_checks)
|
|
MC_SPLIT_TICK
|
|
|
|
for (i in 1 to GLOB.lighting_update_corners.len)
|
|
var/datum/lighting_corner/C = GLOB.lighting_update_corners[i]
|
|
|
|
C.update_objects()
|
|
C.needs_update = FALSE
|
|
if(init_tick_checks)
|
|
CHECK_TICK
|
|
else if (MC_TICK_CHECK)
|
|
break
|
|
if (i)
|
|
GLOB.lighting_update_corners.Cut(1, i+1)
|
|
i = 0
|
|
|
|
|
|
if(!init_tick_checks)
|
|
MC_SPLIT_TICK
|
|
|
|
for (i in 1 to GLOB.lighting_update_objects.len)
|
|
var/atom/movable/lighting_object/O = GLOB.lighting_update_objects[i]
|
|
|
|
if (QDELETED(O))
|
|
continue
|
|
|
|
O.update()
|
|
O.needs_update = FALSE
|
|
if(init_tick_checks)
|
|
CHECK_TICK
|
|
else if (MC_TICK_CHECK)
|
|
break
|
|
if (i)
|
|
GLOB.lighting_update_objects.Cut(1, i+1)
|
|
|
|
|
|
/datum/controller/subsystem/lighting/Recover()
|
|
initialized = SSlighting.initialized
|
|
..() |