mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2025-12-29 11:31:38 +00:00
Misc tweaks (#3625)
changes: Fastboot now turns off AO. Removed some unused code from atmospheric machinery init. Removed global list of all lighting overlays as it was unused. Lighting now tracks the total number of light sources in the world. Lighting now tracks the percentage of lighting updates done via. instant updates.
This commit is contained in:
@@ -10,11 +10,6 @@ Pipelines + Other Objects -> Pipe network
|
||||
|
||||
*/
|
||||
/obj/machinery/atmospherics
|
||||
|
||||
var/auto_init = 0
|
||||
|
||||
var/no_special_init = FALSE
|
||||
|
||||
anchored = 1
|
||||
idle_power_usage = 0
|
||||
active_power_usage = 0
|
||||
@@ -53,9 +48,6 @@ Pipelines + Other Objects -> Pipe network
|
||||
// atmos_init() and Initialize() must be separate, as atmos_init() can be called multiple times after the machine has been initialized.
|
||||
|
||||
/obj/machinery/atmospherics/Initialize(mapload, ...)
|
||||
if (no_special_init)
|
||||
return ..()
|
||||
|
||||
. = ..()
|
||||
if (mapload)
|
||||
atmos_init()
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
var/radio_filter_in
|
||||
|
||||
var/welded = 0
|
||||
//no_special_init = TRUE
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_scrubber/on
|
||||
use_power = 1
|
||||
|
||||
@@ -10,8 +10,9 @@ var/datum/controller/subsystem/lighting/SSlighting
|
||||
priority = SS_PRIORITY_LIGHTING
|
||||
init_order = SS_INIT_LIGHTING
|
||||
|
||||
var/list/lighting_overlays // List of all lighting overlays in the world.
|
||||
var/list/lighting_corners // List of all lighting corners in the world.
|
||||
var/total_lighting_overlays = 0
|
||||
var/total_lighting_sources = 0
|
||||
var/list/lighting_corners = list() // List of all lighting corners in the world.
|
||||
|
||||
var/list/light_queue = list() // lighting sources queued for update.
|
||||
var/lq_idex = 1
|
||||
@@ -24,6 +25,9 @@ var/datum/controller/subsystem/lighting/SSlighting
|
||||
var/tmp/processed_corners = 0
|
||||
var/tmp/processed_overlays = 0
|
||||
|
||||
var/total_ss_updates = 0
|
||||
var/total_instant_updates = 0
|
||||
|
||||
#ifdef USE_INTELLIGENT_LIGHTING_UPDATES
|
||||
var/force_queued = TRUE
|
||||
var/force_override = FALSE // For admins.
|
||||
@@ -31,12 +35,13 @@ var/datum/controller/subsystem/lighting/SSlighting
|
||||
|
||||
/datum/controller/subsystem/lighting/New()
|
||||
NEW_SS_GLOBAL(SSlighting)
|
||||
LAZYINITLIST(lighting_corners)
|
||||
LAZYINITLIST(lighting_overlays)
|
||||
|
||||
/datum/controller/subsystem/lighting/stat_entry()
|
||||
var/list/out = list(
|
||||
"O:[lighting_overlays.len] C:[lighting_corners.len]\n",
|
||||
#ifdef USE_INTELLIGENT_LIGHTING_UPDATES
|
||||
"IUR: [total_ss_updates ? round(total_instant_updates/(total_instant_updates+total_ss_updates)*100, 0.1) : "NaN"]%\n",
|
||||
#endif
|
||||
"\tT:{L:[total_lighting_sources] C:[lighting_corners.len] O:[total_lighting_overlays]}\n",
|
||||
"\tP:{L:[light_queue.len - (lq_idex - 1)]|C:[corner_queue.len - (cq_idex - 1)]|O:[overlay_queue.len - (oq_idex - 1)]}\n",
|
||||
"\tL:{L:[processed_lights]|C:[processed_corners]|O:[processed_overlays]}\n"
|
||||
)
|
||||
@@ -54,6 +59,8 @@ var/datum/controller/subsystem/lighting/SSlighting
|
||||
|
||||
/datum/controller/subsystem/lighting/proc/handle_roundstart()
|
||||
force_queued = FALSE
|
||||
total_ss_updates = 0
|
||||
total_instant_updates = 0
|
||||
|
||||
#endif
|
||||
|
||||
@@ -115,6 +122,7 @@ var/datum/controller/subsystem/lighting/SSlighting
|
||||
var/datum/light_source/L = curr_lights[lq_idex++]
|
||||
|
||||
if (L.needs_update != LIGHTING_NO_UPDATE)
|
||||
total_ss_updates += 1
|
||||
L.update_corners()
|
||||
|
||||
L.needs_update = LIGHTING_NO_UPDATE
|
||||
@@ -158,7 +166,7 @@ var/datum/controller/subsystem/lighting/SSlighting
|
||||
while (oq_idex <= curr_overlays.len)
|
||||
var/atom/movable/lighting_overlay/O = curr_overlays[oq_idex++]
|
||||
|
||||
if (O.needs_update)
|
||||
if (!QDELETED(O) && O.needs_update)
|
||||
O.update_overlay()
|
||||
O.needs_update = FALSE
|
||||
|
||||
@@ -175,11 +183,12 @@ var/datum/controller/subsystem/lighting/SSlighting
|
||||
|
||||
/datum/controller/subsystem/lighting/Recover()
|
||||
lighting_corners = SSlighting.lighting_corners
|
||||
lighting_overlays = SSlighting.lighting_overlays
|
||||
total_lighting_overlays = SSlighting.total_lighting_overlays
|
||||
total_lighting_sources = SSlighting.total_lighting_sources
|
||||
|
||||
src.light_queue = SSlighting.light_queue
|
||||
src.corner_queue = SSlighting.corner_queue
|
||||
src.overlay_queue = SSlighting.overlay_queue
|
||||
light_queue = SSlighting.light_queue
|
||||
corner_queue = SSlighting.corner_queue
|
||||
overlay_queue = SSlighting.overlay_queue
|
||||
|
||||
lq_idex = SSlighting.lq_idex
|
||||
cq_idex = SSlighting.cq_idex
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
var/ao_queued = AO_UPDATE_NONE
|
||||
|
||||
/turf/proc/regenerate_ao()
|
||||
if (config.fastboot)
|
||||
return
|
||||
for (var/thing in RANGE_TURFS(1, src))
|
||||
var/turf/T = thing
|
||||
if (T.permit_ao)
|
||||
@@ -62,6 +64,8 @@
|
||||
. = cache[key] = I
|
||||
|
||||
/turf/proc/queue_ao(rebuild = TRUE)
|
||||
if (config.fastboot)
|
||||
return
|
||||
if (!ao_queued)
|
||||
SSocclusion.queue += src
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
#endif
|
||||
|
||||
/atom/movable/lighting_overlay/New()
|
||||
SSlighting.lighting_overlays += src
|
||||
SSlighting.total_lighting_overlays++
|
||||
|
||||
var/turf/T = loc // If this runtimes atleast we'll know what's creating overlays in things that aren't turfs.
|
||||
T.lighting_overlay = src
|
||||
@@ -31,8 +31,7 @@
|
||||
return QDEL_HINT_LETMELIVE // STOP DELETING ME
|
||||
|
||||
//L_PROF(loc, "overlay_destroy")
|
||||
SSlighting.lighting_overlays -= src
|
||||
SSlighting.overlay_queue -= src
|
||||
SSlighting.total_lighting_overlays--
|
||||
|
||||
var/turf/T = loc
|
||||
if (istype(T))
|
||||
|
||||
@@ -48,6 +48,7 @@
|
||||
var/skip_falloff = FALSE // ONLY for use with sunlight, behavior is undefined if TRUE on regular sources.
|
||||
|
||||
/datum/light_source/New(atom/owner, atom/top)
|
||||
SSlighting.total_lighting_sources++
|
||||
source_atom = owner // Set our new owner.
|
||||
|
||||
LAZYADD(source_atom.light_sources, src)
|
||||
@@ -72,6 +73,7 @@
|
||||
// Kill ourselves.
|
||||
/datum/light_source/Destroy(force)
|
||||
//L_PROF(source_atom, "source_destroy")
|
||||
SSlighting.total_lighting_sources--
|
||||
|
||||
remove_lum()
|
||||
if (source_atom)
|
||||
@@ -96,6 +98,7 @@
|
||||
SSlighting.light_queue += src; \
|
||||
} \
|
||||
else { \
|
||||
SSlighting.total_instant_updates += 1; \
|
||||
update_corners(TRUE); \
|
||||
needs_update = LIGHTING_NO_UPDATE; \
|
||||
} \
|
||||
|
||||
Reference in New Issue
Block a user