mirror of
https://github.com/yogstation13/Yogstation.git
synced 2025-02-26 09:04:50 +00:00
Merge remote-tracking branch 'yogstation13/master' into preferences
This commit is contained in:
@@ -79,7 +79,6 @@ SUBSYSTEM_DEF(air)
|
||||
|
||||
/datum/controller/subsystem/air/fire(resumed = 0)
|
||||
var/timer = TICK_USAGE_REAL
|
||||
var/delta_time = wait * 0.1
|
||||
|
||||
if(currentpart == SSAIR_REBUILD_PIPENETS)
|
||||
var/list/pipenet_rebuilds = pipenets_needing_rebuilt
|
||||
@@ -96,7 +95,7 @@ SUBSYSTEM_DEF(air)
|
||||
timer = TICK_USAGE_REAL
|
||||
if(!resumed)
|
||||
cached_cost = 0
|
||||
process_pipenets(delta_time, resumed)
|
||||
process_pipenets(resumed)
|
||||
cached_cost += TICK_USAGE_REAL - timer
|
||||
if(state != SS_RUNNING)
|
||||
return
|
||||
@@ -108,7 +107,7 @@ SUBSYSTEM_DEF(air)
|
||||
timer = TICK_USAGE_REAL
|
||||
if(!resumed)
|
||||
cached_cost = 0
|
||||
process_atmos_machinery(delta_time, resumed)
|
||||
process_atmos_machinery(resumed)
|
||||
cached_cost += TICK_USAGE_REAL - timer
|
||||
if(state != SS_RUNNING)
|
||||
return
|
||||
@@ -164,7 +163,7 @@ SUBSYSTEM_DEF(air)
|
||||
timer = TICK_USAGE_REAL
|
||||
if(!resumed)
|
||||
cached_cost = 0
|
||||
process_hotspots(delta_time, resumed)
|
||||
process_hotspots(resumed)
|
||||
if(state != SS_RUNNING)
|
||||
return
|
||||
cost_hotspots = MC_AVERAGE(cost_hotspots, TICK_DELTA_TO_MS(cached_cost))
|
||||
@@ -184,7 +183,7 @@ SUBSYSTEM_DEF(air)
|
||||
|
||||
|
||||
|
||||
/datum/controller/subsystem/air/proc/process_pipenets(delta_time, resumed = 0)
|
||||
/datum/controller/subsystem/air/proc/process_pipenets(resumed = 0)
|
||||
if (!resumed)
|
||||
src.currentrun = networks.Copy()
|
||||
//cache for sanic speed (lists are references anyways)
|
||||
@@ -193,7 +192,7 @@ SUBSYSTEM_DEF(air)
|
||||
var/datum/thing = currentrun[currentrun.len]
|
||||
currentrun.len--
|
||||
if(thing)
|
||||
thing.process(delta_time)
|
||||
thing.process()
|
||||
else
|
||||
networks.Remove(thing)
|
||||
if(MC_TICK_CHECK)
|
||||
@@ -203,7 +202,7 @@ SUBSYSTEM_DEF(air)
|
||||
if(istype(atmos_machine, /obj/machinery/atmospherics))
|
||||
pipenets_needing_rebuilt += atmos_machine
|
||||
|
||||
/datum/controller/subsystem/air/proc/process_atmos_machinery(delta_time, resumed = FALSE)
|
||||
/datum/controller/subsystem/air/proc/process_atmos_machinery(resumed = FALSE)
|
||||
if (!resumed)
|
||||
src.currentrun = atmos_machinery.Copy()
|
||||
//cache for sanic speed (lists are references anyways)
|
||||
@@ -211,7 +210,7 @@ SUBSYSTEM_DEF(air)
|
||||
while(currentrun.len)
|
||||
var/obj/machinery/M = currentrun[currentrun.len]
|
||||
currentrun.len--
|
||||
if(!M || (M.process_atmos(delta_time) == PROCESS_KILL))
|
||||
if(!M || (M.process_atmos() == PROCESS_KILL))
|
||||
atmos_machinery.Remove(M)
|
||||
if(MC_TICK_CHECK)
|
||||
return
|
||||
@@ -229,7 +228,7 @@ SUBSYSTEM_DEF(air)
|
||||
if(MC_TICK_CHECK)
|
||||
return
|
||||
|
||||
/datum/controller/subsystem/air/proc/process_hotspots(delta_time, resumed = FALSE)
|
||||
/datum/controller/subsystem/air/proc/process_hotspots(resumed = FALSE)
|
||||
if (!resumed)
|
||||
src.currentrun = hotspots.Copy()
|
||||
//cache for sanic speed (lists are references anyways)
|
||||
@@ -238,7 +237,7 @@ SUBSYSTEM_DEF(air)
|
||||
var/obj/effect/hotspot/H = currentrun[currentrun.len]
|
||||
currentrun.len--
|
||||
if (H)
|
||||
H.process(delta_time)
|
||||
H.process()
|
||||
else
|
||||
hotspots -= H
|
||||
if(MC_TICK_CHECK)
|
||||
|
||||
@@ -37,7 +37,5 @@ SUBSYSTEM_DEF(input)
|
||||
user.set_macros()
|
||||
|
||||
/datum/controller/subsystem/input/fire()
|
||||
var/list/clients = GLOB.clients // Let's sing the list cache song
|
||||
for(var/i in 1 to clients.len)
|
||||
var/client/C = clients[i]
|
||||
C.keyLoop()
|
||||
for(var/mob/user as anything in GLOB.player_list)
|
||||
user.focus?.keyLoop(user.client)
|
||||
|
||||
@@ -1,17 +1,16 @@
|
||||
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
|
||||
var/static/list/sources_queue = list() // List of lighting sources queued for update.
|
||||
var/static/list/corners_queue = list() // List of lighting corners queued for update.
|
||||
var/static/list/objects_queue = list() // List of lighting objects queued for update.
|
||||
|
||||
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]"
|
||||
msg = "L:[length(sources_queue)]|C:[length(corners_queue)]|O:[length(objects_queue)]"
|
||||
return ..()
|
||||
|
||||
|
||||
@@ -34,9 +33,10 @@ SUBSYSTEM_DEF(lighting)
|
||||
MC_SPLIT_TICK_INIT(3)
|
||||
if(!init_tick_checks)
|
||||
MC_SPLIT_TICK
|
||||
var/list/queue = sources_queue
|
||||
var/i = 0
|
||||
for (i in 1 to GLOB.lighting_update_lights.len)
|
||||
var/datum/light_source/L = GLOB.lighting_update_lights[i]
|
||||
for (i in 1 to length(queue))
|
||||
var/datum/light_source/L = queue[i]
|
||||
|
||||
L.update_corners()
|
||||
|
||||
@@ -47,31 +47,34 @@ SUBSYSTEM_DEF(lighting)
|
||||
else if (MC_TICK_CHECK)
|
||||
break
|
||||
if (i)
|
||||
GLOB.lighting_update_lights.Cut(1, i+1)
|
||||
queue.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]
|
||||
queue = corners_queue
|
||||
for (i in 1 to length(queue))
|
||||
var/datum/lighting_corner/C = queue[i]
|
||||
|
||||
C.needs_update = FALSE //update_objects() can call qdel if the corner is storing no data
|
||||
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)
|
||||
queue.Cut(1, i+1)
|
||||
i = 0
|
||||
|
||||
|
||||
if(!init_tick_checks)
|
||||
MC_SPLIT_TICK
|
||||
|
||||
for (i in 1 to GLOB.lighting_update_objects.len)
|
||||
var/datum/lighting_object/O = GLOB.lighting_update_objects[i]
|
||||
queue = objects_queue
|
||||
for (i in 1 to length(queue))
|
||||
var/datum/lighting_object/O = queue[i]
|
||||
|
||||
if (QDELETED(O))
|
||||
continue
|
||||
@@ -83,7 +86,7 @@ SUBSYSTEM_DEF(lighting)
|
||||
else if (MC_TICK_CHECK)
|
||||
break
|
||||
if (i)
|
||||
GLOB.lighting_update_objects.Cut(1, i+1)
|
||||
queue.Cut(1, i+1)
|
||||
|
||||
|
||||
/datum/controller/subsystem/lighting/Recover()
|
||||
|
||||
@@ -45,6 +45,8 @@ SUBSYSTEM_DEF(statpanels)
|
||||
while(length(currentrun))
|
||||
var/client/target = currentrun[length(currentrun)]
|
||||
currentrun.len--
|
||||
if(!target)
|
||||
continue
|
||||
if(!target.statbrowser_ready)
|
||||
continue
|
||||
if(target.stat_tab == "Status" && num_fires % status_wait == 0)
|
||||
|
||||
@@ -559,7 +559,7 @@ SUBSYSTEM_DEF(timer)
|
||||
if (callBack.object == GLOBAL_PROC)
|
||||
. = "GLOBAL_PROC"
|
||||
else
|
||||
. = "[callBack.object.type]"
|
||||
. = "[callBack?.object?.type]"
|
||||
|
||||
/**
|
||||
* Create a new timer and insert it in the queue.
|
||||
|
||||
@@ -83,6 +83,8 @@ SUBSYSTEM_DEF(vis_overlays)
|
||||
var/list/overlays_to_remove = list()
|
||||
for(var/i in thing.managed_vis_overlays - unique_vis_overlays)
|
||||
var/obj/effect/overlay/vis/overlay = i
|
||||
if(!overlay)
|
||||
continue
|
||||
add_vis_overlay(thing, overlay.icon, overlay.icon_state, overlay.layer, overlay.plane, turn(overlay.dir, rotation), overlay.alpha, overlay.appearance_flags)
|
||||
overlays_to_remove += overlay
|
||||
for(var/i in thing.managed_vis_overlays & unique_vis_overlays)
|
||||
|
||||
Reference in New Issue
Block a user