Files
Yogstation/code/controllers/subsystem/icon_smooth.dm
fira c30f297c11 MC backport (#16992)
* Break things

* fix bad replace in test code
2022-12-31 15:30:57 +00:00

45 lines
913 B
Plaintext

SUBSYSTEM_DEF(icon_smooth)
name = "Icon Smoothing"
init_order = INIT_ORDER_ICON_SMOOTHING
wait = 1
priority = FIRE_PRIOTITY_SMOOTHING
flags = SS_TICKER
loading_points = 3.3 SECONDS // Yogs -- loading times
var/list/smooth_queue = list()
var/list/deferred = list()
/datum/controller/subsystem/icon_smooth/fire()
var/list/cached = smooth_queue
while(cached.len)
var/atom/A = cached[cached.len]
cached.len--
if (A.flags_1 & INITIALIZED_1)
smooth_icon(A)
else
deferred += A
if (MC_TICK_CHECK)
return
if (!cached.len)
if (deferred.len)
smooth_queue = deferred
deferred = cached
else
can_fire = 0
/datum/controller/subsystem/icon_smooth/Initialize()
smooth_zlevel(1,TRUE)
smooth_zlevel(2,TRUE)
var/queue = smooth_queue
smooth_queue = list()
for(var/V in queue)
var/atom/A = V
if(!A || A.z <= 2)
continue
smooth_icon(A)
CHECK_TICK
return SS_INIT_SUCCESS