mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-20 03:25:49 +01:00
more optimisation!
This commit is contained in:
@@ -2,25 +2,34 @@ var/datum/controller/subsystem/icon_smooth/SSicon_smooth
|
||||
|
||||
/datum/controller/subsystem/icon_smooth
|
||||
name = "Icon Smoothing"
|
||||
priority = -5
|
||||
wait = 5
|
||||
init_order = -5
|
||||
wait = 1
|
||||
priority = 35
|
||||
flags = SS_TICKER
|
||||
|
||||
var/list/smooth_queue = list()
|
||||
|
||||
/datum/controller/subsystem/icon_smooth/New()
|
||||
NEW_SS_GLOBAL(SSicon_smooth)
|
||||
|
||||
/datum/controller/subsystem/icon_smooth/fire()
|
||||
for(var/atom in smooth_queue)
|
||||
ss_smooth_icon(atom)
|
||||
smooth_queue -= atom
|
||||
while(smooth_queue.len)
|
||||
var/atom/A = smooth_queue[smooth_queue.len]
|
||||
smooth_queue.len--
|
||||
smooth_icon(A)
|
||||
if (MC_TICK_CHECK)
|
||||
return
|
||||
if (!smooth_queue.len)
|
||||
can_fire = 0
|
||||
|
||||
/datum/controller/subsystem/icon_smooth/Initialize()
|
||||
smooth_zlevel(1,TRUE)
|
||||
smooth_zlevel(2,TRUE)
|
||||
for(var/V in smooth_queue)
|
||||
var/queue = smooth_queue
|
||||
smooth_queue = list()
|
||||
for(var/V in queue)
|
||||
var/atom/A = V
|
||||
if(A.z == 1 || A.z == 2)
|
||||
smooth_queue -= A
|
||||
if(!A || A.z <= 2)
|
||||
continue
|
||||
smooth_icon(A)
|
||||
..()
|
||||
|
||||
Reference in New Issue
Block a user