From e142e098b475a0e45b9b3fe3aaea7044a4a73bc5 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Tue, 27 Sep 2022 23:52:53 +0200 Subject: [PATCH] [MIRROR] Removes overlay queuing, saves 6/7 seconds of initialize. Lightly modifies stat tracking macros [MDB IGNORE] (#16449) * Removes overlay queuing, saves 6/7 seconds of initialize. Lightly modifies stat tracking macros * merge conflict * other changes Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com> Co-authored-by: tastyfish --- code/__DEFINES/flags.dm | 36 ++-- code/__DEFINES/stat_tracking.dm | 7 +- code/__DEFINES/subsystems.dm | 34 ++-- code/__HELPERS/icons.dm | 2 - code/_globalvars/bitfields.dm | 1 - code/controllers/subsystem/overlays.dm | 166 +++++------------- code/datums/datacore.dm | 2 - code/datums/holocall.dm | 1 - code/game/machinery/firealarm.dm | 8 +- code/game/objects/effects/decals/decal.dm | 10 ++ .../game/objects/items/robot/items/storage.dm | 3 - code/game/objects/items/storage/wallets.dm | 1 - code/modules/admin/verbs/ert.dm | 1 - code/modules/admin/verbs/mapping.dm | 2 - .../antagonists/_common/antag_datum.dm | 1 - .../client/preferences/middleware/species.dm | 1 - .../industrial_lift/industrial_lift.dm | 4 + .../mob/dead/new_player/preferences_setup.dm | 1 - .../living/simple_animal/hostile/zombie.dm | 1 - code/modules/unit_tests/create_and_destroy.dm | 3 + .../unit_tests/screenshot_humanoids.dm | 1 - code/modules/unit_tests/screenshot_saturnx.dm | 1 - .../mob/dead/new_player/preferences_setup.dm | 1 - .../mob/dead/new_player/preferences_setup.dm | 2 - 24 files changed, 95 insertions(+), 195 deletions(-) diff --git a/code/__DEFINES/flags.dm b/code/__DEFINES/flags.dm index 8c0d6fe1a84..817f36f972f 100644 --- a/code/__DEFINES/flags.dm +++ b/code/__DEFINES/flags.dm @@ -24,42 +24,40 @@ GLOBAL_LIST_INIT(bitflags, list(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 204 #define CONDUCT_1 (1<<1) /// For machines and structures that should not break into parts, eg, holodeck stuff #define NODECONSTRUCT_1 (1<<2) -/// atom queued to SSoverlay -#define OVERLAY_QUEUED_1 (1<<3) /// item has priority to check when entering or leaving -#define ON_BORDER_1 (1<<4) +#define ON_BORDER_1 (1<<3) ///Whether or not this atom shows screentips when hovered over -#define NO_SCREENTIPS_1 (1<<5) +#define NO_SCREENTIPS_1 (1<<4) /// Prevent clicking things below it on the same turf eg. doors/ fulltile windows -#define PREVENT_CLICK_UNDER_1 (1<<6) +#define PREVENT_CLICK_UNDER_1 (1<<5) ///specifies that this atom is a hologram that isnt real -#define HOLOGRAM_1 (1<<7) +#define HOLOGRAM_1 (1<<6) ///Whether /atom/Initialize() has already run for the object -#define INITIALIZED_1 (1<<8) +#define INITIALIZED_1 (1<<7) /// was this spawned by an admin? used for stat tracking stuff. -#define ADMIN_SPAWNED_1 (1<<9) +#define ADMIN_SPAWNED_1 (1<<8) /// should not get harmed if this gets caught by an explosion? -#define PREVENT_CONTENTS_EXPLOSION_1 (1<<10) +#define PREVENT_CONTENTS_EXPLOSION_1 (1<<9) /// Should this object be paintable with very dark colors? -#define ALLOW_DARK_PAINTS_1 (1<<11) +#define ALLOW_DARK_PAINTS_1 (1<<10) /// Should this object be unpaintable? -#define UNPAINTABLE_1 (1<<12) +#define UNPAINTABLE_1 (1<<11) /// Is the thing currently spinning? -#define IS_SPINNING_1 (1<<13) +#define IS_SPINNING_1 (1<<12) /// Is this atom on top of another atom, and as such has click priority? -#define IS_ONTOP_1 (1<<14) +#define IS_ONTOP_1 (1<<13) /// Is this atom immune to being dusted by the supermatter? -#define SUPERMATTER_IGNORES_1 (1<<15) +#define SUPERMATTER_IGNORES_1 (1<<14) /// If a turf can be made dirty at roundstart. This is also used in areas. -#define CAN_BE_DIRTY_1 (1<<16) +#define CAN_BE_DIRTY_1 (1<<15) /// Should we use the initial icon for display? Mostly used by overlay only objects -#define HTML_USE_INITAL_ICON_1 (1<<17) +#define HTML_USE_INITAL_ICON_1 (1<<16) /// Can players recolor this in-game via vendors (and maybe more if support is added)? -#define IS_PLAYER_COLORABLE_1 (1<<18) +#define IS_PLAYER_COLORABLE_1 (1<<17) /// Whether or not this atom has contextual screentips when hovered OVER -#define HAS_CONTEXTUAL_SCREENTIPS_1 (1<<19) +#define HAS_CONTEXTUAL_SCREENTIPS_1 (1<<18) // Whether or not this atom is storing contents for a disassociated storage object -#define HAS_DISASSOCIATED_STORAGE_1 (1<<20) +#define HAS_DISASSOCIATED_STORAGE_1 (1<<19) // Update flags for [/atom/proc/update_appearance] /// Update the atom's name diff --git a/code/__DEFINES/stat_tracking.dm b/code/__DEFINES/stat_tracking.dm index c46bb56ab45..b08cdc9cfa6 100644 --- a/code/__DEFINES/stat_tracking.dm +++ b/code/__DEFINES/stat_tracking.dm @@ -8,12 +8,11 @@ #define STAT_LOG_ENTRY(entrylist, entryname) \ var/list/STAT_ENTRY = entrylist[entryname] || (entrylist[entryname] = new /list(STAT_ENTRY_LENGTH));\ STAT_ENTRY[STAT_ENTRY_TIME] += STAT_TIME;\ - var/STAT_INCR_AMOUNT = min(1, 2**round((STAT_ENTRY[STAT_ENTRY_COUNT] || 0)/SHORT_REAL_LIMIT));\ - if (STAT_INCR_AMOUNT == 1 || prob(100/STAT_INCR_AMOUNT)) {\ - STAT_ENTRY[STAT_ENTRY_COUNT] += STAT_INCR_AMOUNT;\ - };\ + STAT_ENTRY[STAT_ENTRY_COUNT] += 1; // Cost tracking macros, to be used in one proc +// The static lists are under the assumption that costs and counting are global lists, and will therefor +// Break during world init #define INIT_COST(costs, counting) \ var/list/_costs = costs; \ var/list/_counting = counting; \ diff --git a/code/__DEFINES/subsystems.dm b/code/__DEFINES/subsystems.dm index 0c526620a2c..f98d209fb3b 100644 --- a/code/__DEFINES/subsystems.dm +++ b/code/__DEFINES/subsystems.dm @@ -258,28 +258,22 @@ //! ## Overlays subsystem -///Compile all the overlays for an atom from the cache lists -// |= on overlays is not actually guaranteed to not add same appearances but we're optimistically using it anyway. -#define COMPILE_OVERLAYS(A)\ - do {\ - var/list/ad = A.add_overlays;\ - var/list/rm = A.remove_overlays;\ - if(LAZYLEN(rm)){\ - A.overlays -= rm;\ - rm.Cut();\ - }\ - if(LAZYLEN(ad)){\ - A.overlays |= ad;\ - ad.Cut();\ - }\ - for(var/I in A.alternate_appearances){\ - var/datum/atom_hud/alternate_appearance/AA = A.alternate_appearances[I];\ +#define POST_OVERLAY_CHANGE(changed_on) \ + if(length(changed_on.overlays) >= MAX_ATOM_OVERLAYS) { \ + var/text_lays = overlays2text(changed_on.overlays); \ + stack_trace("Too many overlays on [changed_on.type] - [length(changed_on.overlays)], refusing to update and cutting.\ + \n What follows is a printout of all existing overlays at the time of the overflow \n[text_lays]"); \ + changed_on.overlays.Cut(); \ + changed_on.add_overlay(mutable_appearance('icons/testing/greyscale_error.dmi')); \ + } \ + if(alternate_appearances) { \ + for(var/I in changed_on.alternate_appearances){\ + var/datum/atom_hud/alternate_appearance/AA = changed_on.alternate_appearances[I];\ if(AA.transfer_overlays){\ - AA.copy_overlays(A, TRUE);\ + AA.copy_overlays(changed_on, TRUE);\ }\ - }\ - A.flags_1 &= ~OVERLAY_QUEUED_1;\ - } while (FALSE) + } \ + } /** Create a new timer and add it to the queue. diff --git a/code/__HELPERS/icons.dm b/code/__HELPERS/icons.dm index 6b74a883c06..02bf3f5916e 100644 --- a/code/__HELPERS/icons.dm +++ b/code/__HELPERS/icons.dm @@ -1024,7 +1024,6 @@ GLOBAL_LIST_EMPTY(friendly_animal_types) body.equip_outfit_and_loadout(outfit, prefs, TRUE) //SKYRAT EDIT CHANGE var/icon/out_icon = icon('icons/effects/effects.dmi', "nothing") - COMPILE_OVERLAYS(body) for(var/D in showDirs) var/icon/partial = getFlatIcon(body, defdir=D) out_icon.Insert(partial,dir=D) @@ -1054,7 +1053,6 @@ GLOBAL_LIST_EMPTY(friendly_animal_types) var/initial_human_dir = existing_human.dir existing_human.dir = SOUTH var/icon/out_icon = icon('icons/effects/effects.dmi', "nothing") - COMPILE_OVERLAYS(existing_human) for(var/direction in directions_to_output) var/icon/partial = getFlatIcon(existing_human, defdir = direction) out_icon.Insert(partial, dir = direction) diff --git a/code/_globalvars/bitfields.dm b/code/_globalvars/bitfields.dm index 73f59e91fbd..77766d47d28 100644 --- a/code/_globalvars/bitfields.dm +++ b/code/_globalvars/bitfields.dm @@ -126,7 +126,6 @@ DEFINE_BITFIELD(flags_1, list( "NODECONSTRUCT_1" = NODECONSTRUCT_1, "NO_SCREENTIPS_1" = NO_SCREENTIPS_1, "ON_BORDER_1" = ON_BORDER_1, - "OVERLAY_QUEUED_1" = OVERLAY_QUEUED_1, "PREVENT_CLICK_UNDER_1" = PREVENT_CLICK_UNDER_1, "PREVENT_CONTENTS_EXPLOSION_1" = PREVENT_CONTENTS_EXPLOSION_1, "SUPERMATTER_IGNORES_1" = SUPERMATTER_IGNORES_1, diff --git a/code/controllers/subsystem/overlays.dm b/code/controllers/subsystem/overlays.dm index 5b4f4ca1bb5..a5c268f2ad9 100644 --- a/code/controllers/subsystem/overlays.dm +++ b/code/controllers/subsystem/overlays.dm @@ -1,71 +1,16 @@ SUBSYSTEM_DEF(overlays) name = "Overlay" - flags = SS_TICKER - wait = 1 - priority = FIRE_PRIORITY_OVERLAYS - init_order = INIT_ORDER_OVERLAY - - var/list/queue + flags = SS_NO_FIRE|SS_NO_INIT var/list/stats /datum/controller/subsystem/overlays/PreInit() - queue = list() stats = list() -/datum/controller/subsystem/overlays/Initialize() - initialized = TRUE - fire(mc_check = FALSE) - return SS_INIT_SUCCESS - - -/datum/controller/subsystem/overlays/stat_entry(msg) - msg = "Ov:[length(queue)]" - return ..() - - /datum/controller/subsystem/overlays/Shutdown() text2file(render_stats(stats), "[GLOB.log_directory]/overlay.log") - /datum/controller/subsystem/overlays/Recover() - queue = SSoverlays.queue - - -/datum/controller/subsystem/overlays/fire(resumed = FALSE, mc_check = TRUE) - var/list/queue = src.queue - var/static/count = 0 - if (count) - var/c = count - count = 0 //so if we runtime on the Cut, we don't try again. - queue.Cut(1,c+1) - - for (var/atom/atom_to_compile as anything in queue) - count++ - if(!atom_to_compile) - continue - STAT_START_STOPWATCH - COMPILE_OVERLAYS(atom_to_compile) - UNSETEMPTY(atom_to_compile.add_overlays) - UNSETEMPTY(atom_to_compile.remove_overlays) - STAT_STOP_STOPWATCH - STAT_LOG_ENTRY(stats, atom_to_compile.type) - if(length(atom_to_compile.overlays) >= MAX_ATOM_OVERLAYS) - //Break it real GOOD - var/text_lays = overlays2text(atom_to_compile.overlays) - stack_trace("Too many overlays on [atom_to_compile.type] - [length(atom_to_compile.overlays)], refusing to update and cutting.\ - \n What follows is a printout of all existing overlays at the time of the overflow \n[text_lays]") - atom_to_compile.overlays.Cut() - //Let them know they fucked up - atom_to_compile.add_overlay(mutable_appearance('icons/testing/greyscale_error.dmi')) - continue - if(mc_check) - if(MC_TICK_CHECK) - break - else - CHECK_TICK - if (count) - queue.Cut(1,count+1) - count = 0 + stats = SSoverlays.stats /// Converts an overlay list into text for debug printing /// Of note: overlays aren't actually mutable appearances, they're just appearances @@ -92,13 +37,12 @@ SUBSYSTEM_DEF(overlays) iconbro.icon = icon return iconbro.appearance -/atom/proc/build_appearance_list(old_overlays) - var/static/image/appearance_bro = new() - var/list/new_overlays = list() - if (!islist(old_overlays)) - old_overlays = list(old_overlays) - for (var/overlay in old_overlays) +/atom/proc/build_appearance_list(build_overlays) + if (!islist(build_overlays)) + build_overlays = list(build_overlays) + for (var/overlay in build_overlays) if(!overlay) + build_overlays -= overlay continue if (istext(overlay)) #ifdef UNIT_TESTS @@ -109,64 +53,37 @@ SUBSYSTEM_DEF(overlays) stack_trace("Invalid overlay: Icon object '[icon_file]' [REF(icon)] used in '[src]' [type] is missing icon state [overlay].") continue #endif - new_overlays += iconstate2appearance(icon, overlay) + build_overlays -= overlay + build_overlays += iconstate2appearance(icon, overlay) else if(isicon(overlay)) - new_overlays += icon2appearance(overlay) - else - if(isloc(overlay)) - var/atom/A = overlay - if (A.flags_1 & OVERLAY_QUEUED_1) - COMPILE_OVERLAYS(A) - appearance_bro.appearance = overlay //this works for images and atoms too! - if(!ispath(overlay)) - var/image/I = overlay - appearance_bro.dir = I.dir - new_overlays += appearance_bro.appearance - return new_overlays + build_overlays -= overlay + build_overlays += icon2appearance(overlay) + return build_overlays -#define NOT_QUEUED_ALREADY (!(flags_1 & OVERLAY_QUEUED_1)) -#define QUEUE_FOR_COMPILE flags_1 |= OVERLAY_QUEUED_1; SSoverlays.queue += src; /atom/proc/cut_overlays() - LAZYINITLIST(remove_overlays) - remove_overlays = overlays.Copy() - add_overlays = null + STAT_START_STOPWATCH + overlays = null + POST_OVERLAY_CHANGE(src) + STAT_STOP_STOPWATCH + STAT_LOG_ENTRY(SSoverlays.stats, type) - //If not already queued for work and there are overlays to remove - if(NOT_QUEUED_ALREADY && remove_overlays.len) - QUEUE_FOR_COMPILE - -/atom/proc/cut_overlay(list/overlays) +/atom/proc/cut_overlay(list/remove_overlays) if(!overlays) return - overlays = build_appearance_list(overlays) - LAZYINITLIST(add_overlays) - LAZYINITLIST(remove_overlays) - var/a_len = add_overlays.len - var/r_len = remove_overlays.len - remove_overlays += overlays - add_overlays -= overlays + STAT_START_STOPWATCH + overlays -= build_appearance_list(remove_overlays) + POST_OVERLAY_CHANGE(src) + STAT_STOP_STOPWATCH + STAT_LOG_ENTRY(SSoverlays.stats, type) - var/fa_len = add_overlays.len - var/fr_len = remove_overlays.len - - //If not already queued and there is work to be done - if(NOT_QUEUED_ALREADY && (fa_len != a_len || fr_len != r_len )) - QUEUE_FOR_COMPILE - UNSETEMPTY(add_overlays) - -/atom/proc/add_overlay(list/overlays) +/atom/proc/add_overlay(list/add_overlays) if(!overlays) return - - overlays = build_appearance_list(overlays) - - LAZYINITLIST(add_overlays) //always initialized after this point - var/a_len = add_overlays.len - - add_overlays += overlays - var/fa_len = add_overlays.len - if(NOT_QUEUED_ALREADY && fa_len != a_len) - QUEUE_FOR_COMPILE + STAT_START_STOPWATCH + overlays += build_appearance_list(add_overlays) + POST_OVERLAY_CHANGE(src) + STAT_STOP_STOPWATCH + STAT_LOG_ENTRY(SSoverlays.stats, type) /atom/proc/copy_overlays(atom/other, cut_old) //copys our_overlays from another atom if(!other) @@ -174,18 +91,21 @@ SUBSYSTEM_DEF(overlays) cut_overlays() return + STAT_START_STOPWATCH var/list/cached_other = other.overlays.Copy() - if(cached_other) - if(cut_old || !LAZYLEN(overlays)) - remove_overlays = overlays - add_overlays = cached_other - if(NOT_QUEUED_ALREADY) - QUEUE_FOR_COMPILE - else if(cut_old) - cut_overlays() - -#undef NOT_QUEUED_ALREADY -#undef QUEUE_FOR_COMPILE + if(cut_old) + if(cached_other) + overlays = cached_other + else + overlays = null + POST_OVERLAY_CHANGE(src) + STAT_STOP_STOPWATCH + STAT_LOG_ENTRY(SSoverlays.stats, type) + else if(cached_other) + overlays += cached_other + POST_OVERLAY_CHANGE(src) + STAT_STOP_STOPWATCH + STAT_LOG_ENTRY(SSoverlays.stats, type) //TODO: Better solution for these? /image/proc/add_overlay(x) diff --git a/code/datums/datacore.dm b/code/datums/datacore.dm index ced5f1edeb4..bdd60690328 100644 --- a/code/datums/datacore.dm +++ b/code/datums/datacore.dm @@ -274,8 +274,6 @@ GLOBAL_DATUM_INIT(data_core, /datum/datacore, new) var/static/record_id_num = 1001 var/id = num2hex(record_id_num++,6) - // We need to compile the overlays now, otherwise we're basically copying an empty icon. - COMPILE_OVERLAYS(H) var/mutable_appearance/character_appearance = new(H.appearance) //These records should ~really~ be merged or something diff --git a/code/datums/holocall.dm b/code/datums/holocall.dm index d5013794e25..10c10744691 100644 --- a/code/datums/holocall.dm +++ b/code/datums/holocall.dm @@ -322,7 +322,6 @@ if(outfit_type) mannequin.equipOutfit(outfit_type,TRUE) mannequin.setDir(SOUTH) - COMPILE_OVERLAYS(mannequin) . = image(mannequin) unset_busy_human_dummy("HOLODISK_PRESET") diff --git a/code/game/machinery/firealarm.dm b/code/game/machinery/firealarm.dm index 2f9d776f6b6..b008837ef64 100644 --- a/code/game/machinery/firealarm.dm +++ b/code/game/machinery/firealarm.dm @@ -126,32 +126,26 @@ if(machine_stat & NOPOWER) return - . += "fire_overlay" + . += mutable_appearance(icon, "fire_overlay") if(is_station_level(z)) - . += "fire_[SSsecurity_level.get_current_level_as_number()]" . += mutable_appearance(icon, "fire_[SSsecurity_level.get_current_level_as_number()]") . += emissive_appearance(icon, "fire_[SSsecurity_level.get_current_level_as_number()]", alpha = src.alpha) else - . += "fire_[SEC_LEVEL_GREEN]" . += mutable_appearance(icon, "fire_[SEC_LEVEL_GREEN]") . += emissive_appearance(icon, "fire_[SEC_LEVEL_GREEN]", alpha = src.alpha) if(!(my_area?.fire || LAZYLEN(my_area?.active_firelocks))) if(my_area?.fire_detect) //If this is false, leave the green light missing. A good hint to anyone paying attention. - . += "fire_off" . += mutable_appearance(icon, "fire_off") . += emissive_appearance(icon, "fire_off", alpha = src.alpha) else if(obj_flags & EMAGGED) - . += "fire_emagged" . += mutable_appearance(icon, "fire_emagged") . += emissive_appearance(icon, "fire_emagged", alpha = src.alpha) else - . += "fire_on" . += mutable_appearance(icon, "fire_on") . += emissive_appearance(icon, "fire_on", alpha = src.alpha) if(!panel_open && my_area?.fire_detect && my_area?.fire) //It just looks horrible with the panel open - . += "fire_detected" . += mutable_appearance(icon, "fire_detected") . += emissive_appearance(icon, "fire_detected", alpha = src.alpha) //Pain diff --git a/code/game/objects/effects/decals/decal.dm b/code/game/objects/effects/decals/decal.dm index 85bdeffd9ad..629e72ad9d7 100644 --- a/code/game/objects/effects/decals/decal.dm +++ b/code/game/objects/effects/decals/decal.dm @@ -44,3 +44,13 @@ CRASH("Turf decal initialized in an object/nullspace") T.AddElement(/datum/element/decal, icon, icon_state, dir, null, null, alpha, color, null, FALSE, null) return INITIALIZE_HINT_QDEL + +#ifdef UNIT_TESTS +// If we don't do this, turf decals will end up stacking up on a tile, and break the overlay limit +// I hate it too bestie +/obj/effect/turf_decal/Destroy() + if(GLOB.running_create_and_destroy) + var/turf/T = loc + T.RemoveElement(/datum/element/decal, icon, icon_state, dir, null, null, alpha, color, null, FALSE, null) + return ..() +#endif diff --git a/code/game/objects/items/robot/items/storage.dm b/code/game/objects/items/robot/items/storage.dm index b8cac897969..4fa426c40c3 100644 --- a/code/game/objects/items/robot/items/storage.dm +++ b/code/game/objects/items/robot/items/storage.dm @@ -132,7 +132,6 @@ . = ..() var/mutable_appearance/arm = mutable_appearance(icon = icon, icon_state = "borg_beaker_apparatus_arm") if(stored) - COMPILE_OVERLAYS(stored) stored.pixel_x = 0 stored.pixel_y = 0 var/mutable_appearance/stored_copy = new /mutable_appearance(stored) @@ -209,7 +208,6 @@ icon_state = null // hides the original icon (otherwise it's drawn underneath) var/mutable_appearance/bag if(stored) - COMPILE_OVERLAYS(stored) var/mutable_appearance/stored_organ = new /mutable_appearance(stored) stored_organ.layer = FLOAT_LAYER stored_organ.plane = FLOAT_PLANE @@ -247,7 +245,6 @@ . = ..() var/mutable_appearance/arm = mutable_appearance(icon, "borg_hardware_apparatus_arm1") if(stored) - COMPILE_OVERLAYS(stored) stored.pixel_x = -3 stored.pixel_y = 0 if(!istype(stored, /obj/item/circuitboard)) diff --git a/code/game/objects/items/storage/wallets.dm b/code/game/objects/items/storage/wallets.dm index 9ff803ff6dc..10cb32b58a5 100644 --- a/code/game/objects/items/storage/wallets.dm +++ b/code/game/objects/items/storage/wallets.dm @@ -97,7 +97,6 @@ cached_flat_icon = null if(!front_id) return - COMPILE_OVERLAYS(front_id) . += mutable_appearance(front_id.icon, front_id.icon_state) . += front_id.overlays . += mutable_appearance(icon, "wallet_overlay") diff --git a/code/modules/admin/verbs/ert.dm b/code/modules/admin/verbs/ert.dm index 45b3bb9d839..b7c9b19b866 100644 --- a/code/modules/admin/verbs/ert.dm +++ b/code/modules/admin/verbs/ert.dm @@ -46,7 +46,6 @@ equipAntagOnDummy(mannequin, ert) - COMPILE_OVERLAYS(mannequin) CHECK_TICK var/icon/preview_icon = icon('icons/effects/effects.dmi', "nothing") preview_icon.Scale(48+32, 16+32) diff --git a/code/modules/admin/verbs/mapping.dm b/code/modules/admin/verbs/mapping.dm index 4a0f418104b..186f04b6cd3 100644 --- a/code/modules/admin/verbs/mapping.dm +++ b/code/modules/admin/verbs/mapping.dm @@ -309,7 +309,6 @@ GLOBAL_VAR_INIT(say_disabled, FALSE) qdel(I) randomize_human(D) D.dress_up_as_job(JB, TRUE) - COMPILE_OVERLAYS(D) var/icon/I = icon(getFlatIcon(D), frame = 1) final.Insert(I, JB.title) qdel(D) @@ -338,7 +337,6 @@ GLOBAL_VAR_INIT(say_disabled, FALSE) randomize_human(D) if(JB.outfit) D.equipOutfit(JB.outfit, TRUE) - COMPILE_OVERLAYS(D) var/icon/I = icon(getFlatIcon(D), frame = 1) job_key_to_icon[JB.title] = I qdel(D) diff --git a/code/modules/antagonists/_common/antag_datum.dm b/code/modules/antagonists/_common/antag_datum.dm index 1cccf2fc4f3..d4dca92ddeb 100644 --- a/code/modules/antagonists/_common/antag_datum.dm +++ b/code/modules/antagonists/_common/antag_datum.dm @@ -354,7 +354,6 @@ GLOBAL_LIST_EMPTY(antagonists) /datum/antagonist/proc/render_preview_outfit(datum/outfit/outfit, mob/living/carbon/human/dummy) dummy = dummy || new /mob/living/carbon/human/dummy/consistent dummy.equipOutfit(outfit, visualsOnly = TRUE) - COMPILE_OVERLAYS(dummy) var/icon = getFlatIcon(dummy) // We don't want to qdel the dummy right away, since its items haven't initialized yet. diff --git a/code/modules/client/preferences/middleware/species.dm b/code/modules/client/preferences/middleware/species.dm index 02efe1e223a..a87dc16a792 100644 --- a/code/modules/client/preferences/middleware/species.dm +++ b/code/modules/client/preferences/middleware/species.dm @@ -21,7 +21,6 @@ dummy.set_species(species_type) dummy.equipOutfit(/datum/outfit/job/assistant/consistent, visualsOnly = TRUE) dummy.dna.species.prepare_human_for_preview(dummy) - COMPILE_OVERLAYS(dummy) var/icon/dummy_icon = getFlatIcon(dummy) dummy_icon.Scale(64, 64) diff --git a/code/modules/industrial_lift/industrial_lift.dm b/code/modules/industrial_lift/industrial_lift.dm index b9222d46997..bbbf081a976 100644 --- a/code/modules/industrial_lift/industrial_lift.dm +++ b/code/modules/industrial_lift/industrial_lift.dm @@ -17,6 +17,8 @@ GLOBAL_LIST_EMPTY(lifts) canSmoothWith = list(SMOOTH_GROUP_INDUSTRIAL_LIFT) obj_flags = CAN_BE_HIT | BLOCK_Z_OUT_DOWN appearance_flags = PIXEL_SCALE|KEEP_TOGETHER //no TILE_BOUND since we're potentially multitile + // If we don't do this, we'll build our overlays early, and fuck up how we're rendered + blocks_emissive = 0 ///ID used to determine what lift types we can merge with var/lift_id = BASIC_LIFT_ID @@ -246,6 +248,8 @@ GLOBAL_LIST_EMPTY(lifts) forceMove(locate(min_x, min_y, z))//move to the lower left corner set_movement_registrations(locs - old_loc) + blocks_emissive = EMISSIVE_BLOCK_GENERIC + update_appearance() return TRUE ///returns an unordered list of all lift platforms adjacent to us. used so our lift_master_datum can control all connected platforms. diff --git a/code/modules/mob/dead/new_player/preferences_setup.dm b/code/modules/mob/dead/new_player/preferences_setup.dm index 24add57d6cb..55c7b4fd0dc 100644 --- a/code/modules/mob/dead/new_player/preferences_setup.dm +++ b/code/modules/mob/dead/new_player/preferences_setup.dm @@ -106,6 +106,5 @@ mannequin.job = preview_job.title mannequin.dress_up_as_job(preview_job, TRUE) - COMPILE_OVERLAYS(mannequin) return mannequin.appearance */ diff --git a/code/modules/mob/living/simple_animal/hostile/zombie.dm b/code/modules/mob/living/simple_animal/hostile/zombie.dm index 01ce6f84442..a920142a787 100644 --- a/code/modules/mob/living/simple_animal/hostile/zombie.dm +++ b/code/modules/mob/living/simple_animal/hostile/zombie.dm @@ -40,7 +40,6 @@ var/mob/living/carbon/human/dummy/dummy = new dummy.equipOutfit(outfit) dummy.set_species(/datum/species/zombie) - COMPILE_OVERLAYS(dummy) icon = getFlatIcon(dummy) qdel(dummy) */ diff --git a/code/modules/unit_tests/create_and_destroy.dm b/code/modules/unit_tests/create_and_destroy.dm index 1f9a48fe487..db7f3868af3 100644 --- a/code/modules/unit_tests/create_and_destroy.dm +++ b/code/modules/unit_tests/create_and_destroy.dm @@ -3,6 +3,7 @@ //You absolutely must run last priority = TEST_DEL_WORLD +GLOBAL_VAR_INIT(running_create_and_destroy, FALSE) /datum/unit_test/create_and_destroy/Run() //We'll spawn everything here var/turf/spawn_at = run_loc_floor_bottom_left @@ -114,6 +115,7 @@ var/list/cached_contents = spawn_at.contents.Copy() var/baseturf_count = length(spawn_at.baseturfs) + GLOB.running_create_and_destroy = TRUE for(var/type_path in typesof(/atom/movable, /turf) - ignore) //No areas please if(ispath(type_path, /turf)) spawn_at.ChangeTurf(type_path, /turf/baseturf_skipover) @@ -138,6 +140,7 @@ for(var/atom/to_kill in to_del) qdel(to_kill) + GLOB.running_create_and_destroy = FALSE //Hell code, we're bound to have ended the round somehow so let's stop if from ending while we work SSticker.delay_end = TRUE //Prevent the garbage subsystem from harddeling anything, if only to save time diff --git a/code/modules/unit_tests/screenshot_humanoids.dm b/code/modules/unit_tests/screenshot_humanoids.dm index b070b6d8fae..eb302e55755 100644 --- a/code/modules/unit_tests/screenshot_humanoids.dm +++ b/code/modules/unit_tests/screenshot_humanoids.dm @@ -30,7 +30,6 @@ /datum/unit_test/screenshot_humanoids/proc/get_flat_icon_for_all_directions(atom/thing) var/icon/output = icon('icons/effects/effects.dmi', "nothing") - COMPILE_OVERLAYS(thing) for (var/direction in GLOB.cardinals) var/icon/partial = getFlatIcon(thing, defdir = direction, no_anim = TRUE) diff --git a/code/modules/unit_tests/screenshot_saturnx.dm b/code/modules/unit_tests/screenshot_saturnx.dm index 1c7087bc784..cae9a2de6f5 100644 --- a/code/modules/unit_tests/screenshot_saturnx.dm +++ b/code/modules/unit_tests/screenshot_saturnx.dm @@ -14,7 +14,6 @@ /datum/unit_test/screenshot_saturnx/proc/get_flat_icon_for_all_directions(atom/thing) var/icon/output = icon('icons/effects/effects.dmi', "nothing") - COMPILE_OVERLAYS(thing) for (var/direction in GLOB.cardinals) var/icon/partial = getFlatIcon(thing, defdir = direction) diff --git a/modular_skyrat/master_files/code/modules/mob/dead/new_player/preferences_setup.dm b/modular_skyrat/master_files/code/modules/mob/dead/new_player/preferences_setup.dm index adf4227c04e..8f3ff29d9ae 100644 --- a/modular_skyrat/master_files/code/modules/mob/dead/new_player/preferences_setup.dm +++ b/modular_skyrat/master_files/code/modules/mob/dead/new_player/preferences_setup.dm @@ -35,5 +35,4 @@ gent.aroused = AROUSAL_FULL gent.update_sprite_suffix() mannequin.update_body() - COMPILE_OVERLAYS(mannequin) return mannequin.appearance diff --git a/modular_skyrat/modules/customization/modules/mob/dead/new_player/preferences_setup.dm b/modular_skyrat/modules/customization/modules/mob/dead/new_player/preferences_setup.dm index d26dc0e5669..543a0c15cc1 100644 --- a/modular_skyrat/modules/customization/modules/mob/dead/new_player/preferences_setup.dm +++ b/modular_skyrat/modules/customization/modules/mob/dead/new_player/preferences_setup.dm @@ -108,7 +108,6 @@ mannequin.underwear_visibility = UNDERWEAR_HIDE_UNDIES | UNDERWEAR_HIDE_SHIRT | UNDERWEAR_HIDE_SOCKS mannequin.update_body() //Unfortunately, due to a certain case we need to update this just in case - COMPILE_OVERLAYS(mannequin) parent.show_character_previews(new /mutable_appearance(mannequin)) unset_busy_human_dummy(DUMMY_HUMAN_SLOT_PREFERENCES) @@ -243,7 +242,6 @@ body.equipOutfit(outfit, TRUE) var/icon/out_icon = icon('icons/effects/effects.dmi', "nothing") - COMPILE_OVERLAYS(body) for(var/D in showDirs) var/icon/partial = getFlatIcon(body, defdir=D) out_icon.Insert(partial,dir=D)