diff --git a/code/__DEFINES/subsystems.dm b/code/__DEFINES/subsystems.dm index a52b3585edc..5c87a89b618 100644 --- a/code/__DEFINES/subsystems.dm +++ b/code/__DEFINES/subsystems.dm @@ -284,6 +284,7 @@ * * callback the callback to call on timer finish * * wait deciseconds to run the timer for * * flags flags for this timer, see: code\__DEFINES\subsystems.dm + * * timer_subsystem the subsystem to insert this timer into */ #define addtimer(args...) _addtimer(args, file = __FILE__, line = __LINE__) diff --git a/code/_compile_options.dm b/code/_compile_options.dm index 752dce5206e..7a6680dc4b2 100644 --- a/code/_compile_options.dm +++ b/code/_compile_options.dm @@ -43,6 +43,11 @@ */ //#define REAGENTS_TESTING +// Displays static object lighting updates +// Also enables some debug vars on sslighting that can be used to modify +// How extensively we prune lighting corners to update +#define VISUALIZE_LIGHT_UPDATES + #define VISUALIZE_ACTIVE_TURFS //Highlights atmos active turfs in green #define TRACK_MAX_SHARE //Allows max share tracking, for use in the atmos debugging ui #endif //ifdef TESTING diff --git a/code/controllers/subsystem/lighting.dm b/code/controllers/subsystem/lighting.dm index 6e65c9056c7..f79136f678b 100644 --- a/code/controllers/subsystem/lighting.dm +++ b/code/controllers/subsystem/lighting.dm @@ -6,6 +6,10 @@ SUBSYSTEM_DEF(lighting) 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. +#ifdef VISUALIZE_LIGHT_UPDATES + var/allow_duped_values = FALSE + var/allow_duped_corners = FALSE +#endif /datum/controller/subsystem/lighting/stat_entry(msg) msg = "L:[length(sources_queue)]|C:[length(corners_queue)]|O:[length(objects_queue)]" diff --git a/code/controllers/subsystem/timer.dm b/code/controllers/subsystem/timer.dm index 9a043ffba41..c632d9d4f04 100644 --- a/code/controllers/subsystem/timer.dm +++ b/code/controllers/subsystem/timer.dm @@ -569,6 +569,7 @@ SUBSYSTEM_DEF(timer) * * callback the callback to call on timer finish * * wait deciseconds to run the timer for * * flags flags for this timer, see: code\__DEFINES\subsystems.dm + * * timer_subsystem the subsystem to insert this timer into */ /proc/_addtimer(datum/callback/callback, wait = 0, flags = 0, datum/controller/subsystem/timer/timer_subsystem, file, line) if (!callback) diff --git a/code/modules/lighting/lighting_object.dm b/code/modules/lighting/lighting_object.dm index cd590008720..04990095209 100644 --- a/code/modules/lighting/lighting_object.dm +++ b/code/modules/lighting/lighting_object.dm @@ -50,6 +50,12 @@ GLOBAL_LIST_EMPTY(default_lighting_underlays_by_z) return ..() /datum/lighting_object/proc/update() +#ifdef VISUALIZE_LIGHT_UPDATES + affected_turf.add_atom_colour(COLOR_BLUE_LIGHT, ADMIN_COLOUR_PRIORITY) + animate(affected_turf, 10, color = null) + addtimer(CALLBACK(affected_turf, /atom/proc/remove_atom_colour, ADMIN_COLOUR_PRIORITY, COLOR_BLUE_LIGHT), 10, TIMER_UNIQUE|TIMER_OVERRIDE) +#endif + // To the future coder who sees this and thinks // "Why didn't he just use a loop?" // Well my man, it's because the loop performed like shit.