mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-11 02:01:22 +00:00
[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 <crazychris32@gmail.com>
This commit is contained in:
@@ -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)
|
#define CONDUCT_1 (1<<1)
|
||||||
/// For machines and structures that should not break into parts, eg, holodeck stuff
|
/// For machines and structures that should not break into parts, eg, holodeck stuff
|
||||||
#define NODECONSTRUCT_1 (1<<2)
|
#define NODECONSTRUCT_1 (1<<2)
|
||||||
/// atom queued to SSoverlay
|
|
||||||
#define OVERLAY_QUEUED_1 (1<<3)
|
|
||||||
/// item has priority to check when entering or leaving
|
/// 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
|
///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
|
/// 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
|
///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
|
///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.
|
/// 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?
|
/// 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?
|
/// 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?
|
/// Should this object be unpaintable?
|
||||||
#define UNPAINTABLE_1 (1<<12)
|
#define UNPAINTABLE_1 (1<<11)
|
||||||
/// Is the thing currently spinning?
|
/// 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?
|
/// 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?
|
/// 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.
|
/// 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
|
/// 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)?
|
/// 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
|
/// 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
|
// 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 flags for [/atom/proc/update_appearance]
|
||||||
/// Update the atom's name
|
/// Update the atom's name
|
||||||
|
|||||||
@@ -8,12 +8,11 @@
|
|||||||
#define STAT_LOG_ENTRY(entrylist, entryname) \
|
#define STAT_LOG_ENTRY(entrylist, entryname) \
|
||||||
var/list/STAT_ENTRY = entrylist[entryname] || (entrylist[entryname] = new /list(STAT_ENTRY_LENGTH));\
|
var/list/STAT_ENTRY = entrylist[entryname] || (entrylist[entryname] = new /list(STAT_ENTRY_LENGTH));\
|
||||||
STAT_ENTRY[STAT_ENTRY_TIME] += STAT_TIME;\
|
STAT_ENTRY[STAT_ENTRY_TIME] += STAT_TIME;\
|
||||||
var/STAT_INCR_AMOUNT = min(1, 2**round((STAT_ENTRY[STAT_ENTRY_COUNT] || 0)/SHORT_REAL_LIMIT));\
|
STAT_ENTRY[STAT_ENTRY_COUNT] += 1;
|
||||||
if (STAT_INCR_AMOUNT == 1 || prob(100/STAT_INCR_AMOUNT)) {\
|
|
||||||
STAT_ENTRY[STAT_ENTRY_COUNT] += STAT_INCR_AMOUNT;\
|
|
||||||
};\
|
|
||||||
|
|
||||||
// Cost tracking macros, to be used in one proc
|
// 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) \
|
#define INIT_COST(costs, counting) \
|
||||||
var/list/_costs = costs; \
|
var/list/_costs = costs; \
|
||||||
var/list/_counting = counting; \
|
var/list/_counting = counting; \
|
||||||
|
|||||||
@@ -258,28 +258,22 @@
|
|||||||
|
|
||||||
//! ## Overlays subsystem
|
//! ## Overlays subsystem
|
||||||
|
|
||||||
///Compile all the overlays for an atom from the cache lists
|
#define POST_OVERLAY_CHANGE(changed_on) \
|
||||||
// |= on overlays is not actually guaranteed to not add same appearances but we're optimistically using it anyway.
|
if(length(changed_on.overlays) >= MAX_ATOM_OVERLAYS) { \
|
||||||
#define COMPILE_OVERLAYS(A)\
|
var/text_lays = overlays2text(changed_on.overlays); \
|
||||||
do {\
|
stack_trace("Too many overlays on [changed_on.type] - [length(changed_on.overlays)], refusing to update and cutting.\
|
||||||
var/list/ad = A.add_overlays;\
|
\n What follows is a printout of all existing overlays at the time of the overflow \n[text_lays]"); \
|
||||||
var/list/rm = A.remove_overlays;\
|
changed_on.overlays.Cut(); \
|
||||||
if(LAZYLEN(rm)){\
|
changed_on.add_overlay(mutable_appearance('icons/testing/greyscale_error.dmi')); \
|
||||||
A.overlays -= rm;\
|
} \
|
||||||
rm.Cut();\
|
if(alternate_appearances) { \
|
||||||
}\
|
for(var/I in changed_on.alternate_appearances){\
|
||||||
if(LAZYLEN(ad)){\
|
var/datum/atom_hud/alternate_appearance/AA = changed_on.alternate_appearances[I];\
|
||||||
A.overlays |= ad;\
|
|
||||||
ad.Cut();\
|
|
||||||
}\
|
|
||||||
for(var/I in A.alternate_appearances){\
|
|
||||||
var/datum/atom_hud/alternate_appearance/AA = A.alternate_appearances[I];\
|
|
||||||
if(AA.transfer_overlays){\
|
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.
|
Create a new timer and add it to the queue.
|
||||||
|
|||||||
@@ -1024,7 +1024,6 @@ GLOBAL_LIST_EMPTY(friendly_animal_types)
|
|||||||
body.equip_outfit_and_loadout(outfit, prefs, TRUE) //SKYRAT EDIT CHANGE
|
body.equip_outfit_and_loadout(outfit, prefs, TRUE) //SKYRAT EDIT CHANGE
|
||||||
|
|
||||||
var/icon/out_icon = icon('icons/effects/effects.dmi', "nothing")
|
var/icon/out_icon = icon('icons/effects/effects.dmi', "nothing")
|
||||||
COMPILE_OVERLAYS(body)
|
|
||||||
for(var/D in showDirs)
|
for(var/D in showDirs)
|
||||||
var/icon/partial = getFlatIcon(body, defdir=D)
|
var/icon/partial = getFlatIcon(body, defdir=D)
|
||||||
out_icon.Insert(partial,dir=D)
|
out_icon.Insert(partial,dir=D)
|
||||||
@@ -1054,7 +1053,6 @@ GLOBAL_LIST_EMPTY(friendly_animal_types)
|
|||||||
var/initial_human_dir = existing_human.dir
|
var/initial_human_dir = existing_human.dir
|
||||||
existing_human.dir = SOUTH
|
existing_human.dir = SOUTH
|
||||||
var/icon/out_icon = icon('icons/effects/effects.dmi', "nothing")
|
var/icon/out_icon = icon('icons/effects/effects.dmi', "nothing")
|
||||||
COMPILE_OVERLAYS(existing_human)
|
|
||||||
for(var/direction in directions_to_output)
|
for(var/direction in directions_to_output)
|
||||||
var/icon/partial = getFlatIcon(existing_human, defdir = direction)
|
var/icon/partial = getFlatIcon(existing_human, defdir = direction)
|
||||||
out_icon.Insert(partial, dir = direction)
|
out_icon.Insert(partial, dir = direction)
|
||||||
|
|||||||
@@ -126,7 +126,6 @@ DEFINE_BITFIELD(flags_1, list(
|
|||||||
"NODECONSTRUCT_1" = NODECONSTRUCT_1,
|
"NODECONSTRUCT_1" = NODECONSTRUCT_1,
|
||||||
"NO_SCREENTIPS_1" = NO_SCREENTIPS_1,
|
"NO_SCREENTIPS_1" = NO_SCREENTIPS_1,
|
||||||
"ON_BORDER_1" = ON_BORDER_1,
|
"ON_BORDER_1" = ON_BORDER_1,
|
||||||
"OVERLAY_QUEUED_1" = OVERLAY_QUEUED_1,
|
|
||||||
"PREVENT_CLICK_UNDER_1" = PREVENT_CLICK_UNDER_1,
|
"PREVENT_CLICK_UNDER_1" = PREVENT_CLICK_UNDER_1,
|
||||||
"PREVENT_CONTENTS_EXPLOSION_1" = PREVENT_CONTENTS_EXPLOSION_1,
|
"PREVENT_CONTENTS_EXPLOSION_1" = PREVENT_CONTENTS_EXPLOSION_1,
|
||||||
"SUPERMATTER_IGNORES_1" = SUPERMATTER_IGNORES_1,
|
"SUPERMATTER_IGNORES_1" = SUPERMATTER_IGNORES_1,
|
||||||
|
|||||||
@@ -1,71 +1,16 @@
|
|||||||
SUBSYSTEM_DEF(overlays)
|
SUBSYSTEM_DEF(overlays)
|
||||||
name = "Overlay"
|
name = "Overlay"
|
||||||
flags = SS_TICKER
|
flags = SS_NO_FIRE|SS_NO_INIT
|
||||||
wait = 1
|
|
||||||
priority = FIRE_PRIORITY_OVERLAYS
|
|
||||||
init_order = INIT_ORDER_OVERLAY
|
|
||||||
|
|
||||||
var/list/queue
|
|
||||||
var/list/stats
|
var/list/stats
|
||||||
|
|
||||||
/datum/controller/subsystem/overlays/PreInit()
|
/datum/controller/subsystem/overlays/PreInit()
|
||||||
queue = list()
|
|
||||||
stats = 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()
|
/datum/controller/subsystem/overlays/Shutdown()
|
||||||
text2file(render_stats(stats), "[GLOB.log_directory]/overlay.log")
|
text2file(render_stats(stats), "[GLOB.log_directory]/overlay.log")
|
||||||
|
|
||||||
|
|
||||||
/datum/controller/subsystem/overlays/Recover()
|
/datum/controller/subsystem/overlays/Recover()
|
||||||
queue = SSoverlays.queue
|
stats = SSoverlays.stats
|
||||||
|
|
||||||
|
|
||||||
/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
|
|
||||||
|
|
||||||
/// Converts an overlay list into text for debug printing
|
/// Converts an overlay list into text for debug printing
|
||||||
/// Of note: overlays aren't actually mutable appearances, they're just appearances
|
/// Of note: overlays aren't actually mutable appearances, they're just appearances
|
||||||
@@ -92,13 +37,12 @@ SUBSYSTEM_DEF(overlays)
|
|||||||
iconbro.icon = icon
|
iconbro.icon = icon
|
||||||
return iconbro.appearance
|
return iconbro.appearance
|
||||||
|
|
||||||
/atom/proc/build_appearance_list(old_overlays)
|
/atom/proc/build_appearance_list(build_overlays)
|
||||||
var/static/image/appearance_bro = new()
|
if (!islist(build_overlays))
|
||||||
var/list/new_overlays = list()
|
build_overlays = list(build_overlays)
|
||||||
if (!islist(old_overlays))
|
for (var/overlay in build_overlays)
|
||||||
old_overlays = list(old_overlays)
|
|
||||||
for (var/overlay in old_overlays)
|
|
||||||
if(!overlay)
|
if(!overlay)
|
||||||
|
build_overlays -= overlay
|
||||||
continue
|
continue
|
||||||
if (istext(overlay))
|
if (istext(overlay))
|
||||||
#ifdef UNIT_TESTS
|
#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].")
|
stack_trace("Invalid overlay: Icon object '[icon_file]' [REF(icon)] used in '[src]' [type] is missing icon state [overlay].")
|
||||||
continue
|
continue
|
||||||
#endif
|
#endif
|
||||||
new_overlays += iconstate2appearance(icon, overlay)
|
build_overlays -= overlay
|
||||||
|
build_overlays += iconstate2appearance(icon, overlay)
|
||||||
else if(isicon(overlay))
|
else if(isicon(overlay))
|
||||||
new_overlays += icon2appearance(overlay)
|
build_overlays -= overlay
|
||||||
else
|
build_overlays += icon2appearance(overlay)
|
||||||
if(isloc(overlay))
|
return build_overlays
|
||||||
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
|
|
||||||
|
|
||||||
#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()
|
/atom/proc/cut_overlays()
|
||||||
LAZYINITLIST(remove_overlays)
|
STAT_START_STOPWATCH
|
||||||
remove_overlays = overlays.Copy()
|
overlays = null
|
||||||
add_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
|
/atom/proc/cut_overlay(list/remove_overlays)
|
||||||
if(NOT_QUEUED_ALREADY && remove_overlays.len)
|
|
||||||
QUEUE_FOR_COMPILE
|
|
||||||
|
|
||||||
/atom/proc/cut_overlay(list/overlays)
|
|
||||||
if(!overlays)
|
if(!overlays)
|
||||||
return
|
return
|
||||||
overlays = build_appearance_list(overlays)
|
STAT_START_STOPWATCH
|
||||||
LAZYINITLIST(add_overlays)
|
overlays -= build_appearance_list(remove_overlays)
|
||||||
LAZYINITLIST(remove_overlays)
|
POST_OVERLAY_CHANGE(src)
|
||||||
var/a_len = add_overlays.len
|
STAT_STOP_STOPWATCH
|
||||||
var/r_len = remove_overlays.len
|
STAT_LOG_ENTRY(SSoverlays.stats, type)
|
||||||
remove_overlays += overlays
|
|
||||||
add_overlays -= overlays
|
|
||||||
|
|
||||||
var/fa_len = add_overlays.len
|
/atom/proc/add_overlay(list/add_overlays)
|
||||||
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)
|
|
||||||
if(!overlays)
|
if(!overlays)
|
||||||
return
|
return
|
||||||
|
STAT_START_STOPWATCH
|
||||||
overlays = build_appearance_list(overlays)
|
overlays += build_appearance_list(add_overlays)
|
||||||
|
POST_OVERLAY_CHANGE(src)
|
||||||
LAZYINITLIST(add_overlays) //always initialized after this point
|
STAT_STOP_STOPWATCH
|
||||||
var/a_len = add_overlays.len
|
STAT_LOG_ENTRY(SSoverlays.stats, type)
|
||||||
|
|
||||||
add_overlays += overlays
|
|
||||||
var/fa_len = add_overlays.len
|
|
||||||
if(NOT_QUEUED_ALREADY && fa_len != a_len)
|
|
||||||
QUEUE_FOR_COMPILE
|
|
||||||
|
|
||||||
/atom/proc/copy_overlays(atom/other, cut_old) //copys our_overlays from another atom
|
/atom/proc/copy_overlays(atom/other, cut_old) //copys our_overlays from another atom
|
||||||
if(!other)
|
if(!other)
|
||||||
@@ -174,18 +91,21 @@ SUBSYSTEM_DEF(overlays)
|
|||||||
cut_overlays()
|
cut_overlays()
|
||||||
return
|
return
|
||||||
|
|
||||||
|
STAT_START_STOPWATCH
|
||||||
var/list/cached_other = other.overlays.Copy()
|
var/list/cached_other = other.overlays.Copy()
|
||||||
if(cached_other)
|
if(cut_old)
|
||||||
if(cut_old || !LAZYLEN(overlays))
|
if(cached_other)
|
||||||
remove_overlays = overlays
|
overlays = cached_other
|
||||||
add_overlays = cached_other
|
else
|
||||||
if(NOT_QUEUED_ALREADY)
|
overlays = null
|
||||||
QUEUE_FOR_COMPILE
|
POST_OVERLAY_CHANGE(src)
|
||||||
else if(cut_old)
|
STAT_STOP_STOPWATCH
|
||||||
cut_overlays()
|
STAT_LOG_ENTRY(SSoverlays.stats, type)
|
||||||
|
else if(cached_other)
|
||||||
#undef NOT_QUEUED_ALREADY
|
overlays += cached_other
|
||||||
#undef QUEUE_FOR_COMPILE
|
POST_OVERLAY_CHANGE(src)
|
||||||
|
STAT_STOP_STOPWATCH
|
||||||
|
STAT_LOG_ENTRY(SSoverlays.stats, type)
|
||||||
|
|
||||||
//TODO: Better solution for these?
|
//TODO: Better solution for these?
|
||||||
/image/proc/add_overlay(x)
|
/image/proc/add_overlay(x)
|
||||||
|
|||||||
@@ -274,8 +274,6 @@ GLOBAL_DATUM_INIT(data_core, /datum/datacore, new)
|
|||||||
|
|
||||||
var/static/record_id_num = 1001
|
var/static/record_id_num = 1001
|
||||||
var/id = num2hex(record_id_num++,6)
|
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)
|
var/mutable_appearance/character_appearance = new(H.appearance)
|
||||||
|
|
||||||
//These records should ~really~ be merged or something
|
//These records should ~really~ be merged or something
|
||||||
|
|||||||
@@ -322,7 +322,6 @@
|
|||||||
if(outfit_type)
|
if(outfit_type)
|
||||||
mannequin.equipOutfit(outfit_type,TRUE)
|
mannequin.equipOutfit(outfit_type,TRUE)
|
||||||
mannequin.setDir(SOUTH)
|
mannequin.setDir(SOUTH)
|
||||||
COMPILE_OVERLAYS(mannequin)
|
|
||||||
. = image(mannequin)
|
. = image(mannequin)
|
||||||
unset_busy_human_dummy("HOLODISK_PRESET")
|
unset_busy_human_dummy("HOLODISK_PRESET")
|
||||||
|
|
||||||
|
|||||||
@@ -126,32 +126,26 @@
|
|||||||
if(machine_stat & NOPOWER)
|
if(machine_stat & NOPOWER)
|
||||||
return
|
return
|
||||||
|
|
||||||
. += "fire_overlay"
|
. += mutable_appearance(icon, "fire_overlay")
|
||||||
if(is_station_level(z))
|
if(is_station_level(z))
|
||||||
. += "fire_[SSsecurity_level.get_current_level_as_number()]"
|
|
||||||
. += mutable_appearance(icon, "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)
|
. += emissive_appearance(icon, "fire_[SSsecurity_level.get_current_level_as_number()]", alpha = src.alpha)
|
||||||
else
|
else
|
||||||
. += "fire_[SEC_LEVEL_GREEN]"
|
|
||||||
. += mutable_appearance(icon, "fire_[SEC_LEVEL_GREEN]")
|
. += mutable_appearance(icon, "fire_[SEC_LEVEL_GREEN]")
|
||||||
. += emissive_appearance(icon, "fire_[SEC_LEVEL_GREEN]", alpha = src.alpha)
|
. += emissive_appearance(icon, "fire_[SEC_LEVEL_GREEN]", alpha = src.alpha)
|
||||||
|
|
||||||
if(!(my_area?.fire || LAZYLEN(my_area?.active_firelocks)))
|
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.
|
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")
|
. += mutable_appearance(icon, "fire_off")
|
||||||
. += emissive_appearance(icon, "fire_off", alpha = src.alpha)
|
. += emissive_appearance(icon, "fire_off", alpha = src.alpha)
|
||||||
else if(obj_flags & EMAGGED)
|
else if(obj_flags & EMAGGED)
|
||||||
. += "fire_emagged"
|
|
||||||
. += mutable_appearance(icon, "fire_emagged")
|
. += mutable_appearance(icon, "fire_emagged")
|
||||||
. += emissive_appearance(icon, "fire_emagged", alpha = src.alpha)
|
. += emissive_appearance(icon, "fire_emagged", alpha = src.alpha)
|
||||||
else
|
else
|
||||||
. += "fire_on"
|
|
||||||
. += mutable_appearance(icon, "fire_on")
|
. += mutable_appearance(icon, "fire_on")
|
||||||
. += emissive_appearance(icon, "fire_on", alpha = src.alpha)
|
. += 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
|
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")
|
. += mutable_appearance(icon, "fire_detected")
|
||||||
. += emissive_appearance(icon, "fire_detected", alpha = src.alpha) //Pain
|
. += emissive_appearance(icon, "fire_detected", alpha = src.alpha) //Pain
|
||||||
|
|
||||||
|
|||||||
@@ -44,3 +44,13 @@
|
|||||||
CRASH("Turf decal initialized in an object/nullspace")
|
CRASH("Turf decal initialized in an object/nullspace")
|
||||||
T.AddElement(/datum/element/decal, icon, icon_state, dir, null, null, alpha, color, null, FALSE, null)
|
T.AddElement(/datum/element/decal, icon, icon_state, dir, null, null, alpha, color, null, FALSE, null)
|
||||||
return INITIALIZE_HINT_QDEL
|
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
|
||||||
|
|||||||
@@ -132,7 +132,6 @@
|
|||||||
. = ..()
|
. = ..()
|
||||||
var/mutable_appearance/arm = mutable_appearance(icon = icon, icon_state = "borg_beaker_apparatus_arm")
|
var/mutable_appearance/arm = mutable_appearance(icon = icon, icon_state = "borg_beaker_apparatus_arm")
|
||||||
if(stored)
|
if(stored)
|
||||||
COMPILE_OVERLAYS(stored)
|
|
||||||
stored.pixel_x = 0
|
stored.pixel_x = 0
|
||||||
stored.pixel_y = 0
|
stored.pixel_y = 0
|
||||||
var/mutable_appearance/stored_copy = new /mutable_appearance(stored)
|
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)
|
icon_state = null // hides the original icon (otherwise it's drawn underneath)
|
||||||
var/mutable_appearance/bag
|
var/mutable_appearance/bag
|
||||||
if(stored)
|
if(stored)
|
||||||
COMPILE_OVERLAYS(stored)
|
|
||||||
var/mutable_appearance/stored_organ = new /mutable_appearance(stored)
|
var/mutable_appearance/stored_organ = new /mutable_appearance(stored)
|
||||||
stored_organ.layer = FLOAT_LAYER
|
stored_organ.layer = FLOAT_LAYER
|
||||||
stored_organ.plane = FLOAT_PLANE
|
stored_organ.plane = FLOAT_PLANE
|
||||||
@@ -247,7 +245,6 @@
|
|||||||
. = ..()
|
. = ..()
|
||||||
var/mutable_appearance/arm = mutable_appearance(icon, "borg_hardware_apparatus_arm1")
|
var/mutable_appearance/arm = mutable_appearance(icon, "borg_hardware_apparatus_arm1")
|
||||||
if(stored)
|
if(stored)
|
||||||
COMPILE_OVERLAYS(stored)
|
|
||||||
stored.pixel_x = -3
|
stored.pixel_x = -3
|
||||||
stored.pixel_y = 0
|
stored.pixel_y = 0
|
||||||
if(!istype(stored, /obj/item/circuitboard))
|
if(!istype(stored, /obj/item/circuitboard))
|
||||||
|
|||||||
@@ -97,7 +97,6 @@
|
|||||||
cached_flat_icon = null
|
cached_flat_icon = null
|
||||||
if(!front_id)
|
if(!front_id)
|
||||||
return
|
return
|
||||||
COMPILE_OVERLAYS(front_id)
|
|
||||||
. += mutable_appearance(front_id.icon, front_id.icon_state)
|
. += mutable_appearance(front_id.icon, front_id.icon_state)
|
||||||
. += front_id.overlays
|
. += front_id.overlays
|
||||||
. += mutable_appearance(icon, "wallet_overlay")
|
. += mutable_appearance(icon, "wallet_overlay")
|
||||||
|
|||||||
@@ -46,7 +46,6 @@
|
|||||||
|
|
||||||
equipAntagOnDummy(mannequin, ert)
|
equipAntagOnDummy(mannequin, ert)
|
||||||
|
|
||||||
COMPILE_OVERLAYS(mannequin)
|
|
||||||
CHECK_TICK
|
CHECK_TICK
|
||||||
var/icon/preview_icon = icon('icons/effects/effects.dmi', "nothing")
|
var/icon/preview_icon = icon('icons/effects/effects.dmi', "nothing")
|
||||||
preview_icon.Scale(48+32, 16+32)
|
preview_icon.Scale(48+32, 16+32)
|
||||||
|
|||||||
@@ -309,7 +309,6 @@ GLOBAL_VAR_INIT(say_disabled, FALSE)
|
|||||||
qdel(I)
|
qdel(I)
|
||||||
randomize_human(D)
|
randomize_human(D)
|
||||||
D.dress_up_as_job(JB, TRUE)
|
D.dress_up_as_job(JB, TRUE)
|
||||||
COMPILE_OVERLAYS(D)
|
|
||||||
var/icon/I = icon(getFlatIcon(D), frame = 1)
|
var/icon/I = icon(getFlatIcon(D), frame = 1)
|
||||||
final.Insert(I, JB.title)
|
final.Insert(I, JB.title)
|
||||||
qdel(D)
|
qdel(D)
|
||||||
@@ -338,7 +337,6 @@ GLOBAL_VAR_INIT(say_disabled, FALSE)
|
|||||||
randomize_human(D)
|
randomize_human(D)
|
||||||
if(JB.outfit)
|
if(JB.outfit)
|
||||||
D.equipOutfit(JB.outfit, TRUE)
|
D.equipOutfit(JB.outfit, TRUE)
|
||||||
COMPILE_OVERLAYS(D)
|
|
||||||
var/icon/I = icon(getFlatIcon(D), frame = 1)
|
var/icon/I = icon(getFlatIcon(D), frame = 1)
|
||||||
job_key_to_icon[JB.title] = I
|
job_key_to_icon[JB.title] = I
|
||||||
qdel(D)
|
qdel(D)
|
||||||
|
|||||||
@@ -354,7 +354,6 @@ GLOBAL_LIST_EMPTY(antagonists)
|
|||||||
/datum/antagonist/proc/render_preview_outfit(datum/outfit/outfit, mob/living/carbon/human/dummy)
|
/datum/antagonist/proc/render_preview_outfit(datum/outfit/outfit, mob/living/carbon/human/dummy)
|
||||||
dummy = dummy || new /mob/living/carbon/human/dummy/consistent
|
dummy = dummy || new /mob/living/carbon/human/dummy/consistent
|
||||||
dummy.equipOutfit(outfit, visualsOnly = TRUE)
|
dummy.equipOutfit(outfit, visualsOnly = TRUE)
|
||||||
COMPILE_OVERLAYS(dummy)
|
|
||||||
var/icon = getFlatIcon(dummy)
|
var/icon = getFlatIcon(dummy)
|
||||||
|
|
||||||
// We don't want to qdel the dummy right away, since its items haven't initialized yet.
|
// We don't want to qdel the dummy right away, since its items haven't initialized yet.
|
||||||
|
|||||||
@@ -21,7 +21,6 @@
|
|||||||
dummy.set_species(species_type)
|
dummy.set_species(species_type)
|
||||||
dummy.equipOutfit(/datum/outfit/job/assistant/consistent, visualsOnly = TRUE)
|
dummy.equipOutfit(/datum/outfit/job/assistant/consistent, visualsOnly = TRUE)
|
||||||
dummy.dna.species.prepare_human_for_preview(dummy)
|
dummy.dna.species.prepare_human_for_preview(dummy)
|
||||||
COMPILE_OVERLAYS(dummy)
|
|
||||||
|
|
||||||
var/icon/dummy_icon = getFlatIcon(dummy)
|
var/icon/dummy_icon = getFlatIcon(dummy)
|
||||||
dummy_icon.Scale(64, 64)
|
dummy_icon.Scale(64, 64)
|
||||||
|
|||||||
@@ -17,6 +17,8 @@ GLOBAL_LIST_EMPTY(lifts)
|
|||||||
canSmoothWith = list(SMOOTH_GROUP_INDUSTRIAL_LIFT)
|
canSmoothWith = list(SMOOTH_GROUP_INDUSTRIAL_LIFT)
|
||||||
obj_flags = CAN_BE_HIT | BLOCK_Z_OUT_DOWN
|
obj_flags = CAN_BE_HIT | BLOCK_Z_OUT_DOWN
|
||||||
appearance_flags = PIXEL_SCALE|KEEP_TOGETHER //no TILE_BOUND since we're potentially multitile
|
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
|
///ID used to determine what lift types we can merge with
|
||||||
var/lift_id = BASIC_LIFT_ID
|
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
|
forceMove(locate(min_x, min_y, z))//move to the lower left corner
|
||||||
set_movement_registrations(locs - old_loc)
|
set_movement_registrations(locs - old_loc)
|
||||||
|
blocks_emissive = EMISSIVE_BLOCK_GENERIC
|
||||||
|
update_appearance()
|
||||||
return TRUE
|
return TRUE
|
||||||
|
|
||||||
///returns an unordered list of all lift platforms adjacent to us. used so our lift_master_datum can control all connected platforms.
|
///returns an unordered list of all lift platforms adjacent to us. used so our lift_master_datum can control all connected platforms.
|
||||||
|
|||||||
@@ -106,6 +106,5 @@
|
|||||||
mannequin.job = preview_job.title
|
mannequin.job = preview_job.title
|
||||||
mannequin.dress_up_as_job(preview_job, TRUE)
|
mannequin.dress_up_as_job(preview_job, TRUE)
|
||||||
|
|
||||||
COMPILE_OVERLAYS(mannequin)
|
|
||||||
return mannequin.appearance
|
return mannequin.appearance
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -40,7 +40,6 @@
|
|||||||
var/mob/living/carbon/human/dummy/dummy = new
|
var/mob/living/carbon/human/dummy/dummy = new
|
||||||
dummy.equipOutfit(outfit)
|
dummy.equipOutfit(outfit)
|
||||||
dummy.set_species(/datum/species/zombie)
|
dummy.set_species(/datum/species/zombie)
|
||||||
COMPILE_OVERLAYS(dummy)
|
|
||||||
icon = getFlatIcon(dummy)
|
icon = getFlatIcon(dummy)
|
||||||
qdel(dummy)
|
qdel(dummy)
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
//You absolutely must run last
|
//You absolutely must run last
|
||||||
priority = TEST_DEL_WORLD
|
priority = TEST_DEL_WORLD
|
||||||
|
|
||||||
|
GLOBAL_VAR_INIT(running_create_and_destroy, FALSE)
|
||||||
/datum/unit_test/create_and_destroy/Run()
|
/datum/unit_test/create_and_destroy/Run()
|
||||||
//We'll spawn everything here
|
//We'll spawn everything here
|
||||||
var/turf/spawn_at = run_loc_floor_bottom_left
|
var/turf/spawn_at = run_loc_floor_bottom_left
|
||||||
@@ -114,6 +115,7 @@
|
|||||||
var/list/cached_contents = spawn_at.contents.Copy()
|
var/list/cached_contents = spawn_at.contents.Copy()
|
||||||
var/baseturf_count = length(spawn_at.baseturfs)
|
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
|
for(var/type_path in typesof(/atom/movable, /turf) - ignore) //No areas please
|
||||||
if(ispath(type_path, /turf))
|
if(ispath(type_path, /turf))
|
||||||
spawn_at.ChangeTurf(type_path, /turf/baseturf_skipover)
|
spawn_at.ChangeTurf(type_path, /turf/baseturf_skipover)
|
||||||
@@ -138,6 +140,7 @@
|
|||||||
for(var/atom/to_kill in to_del)
|
for(var/atom/to_kill in to_del)
|
||||||
qdel(to_kill)
|
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
|
//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
|
SSticker.delay_end = TRUE
|
||||||
//Prevent the garbage subsystem from harddeling anything, if only to save time
|
//Prevent the garbage subsystem from harddeling anything, if only to save time
|
||||||
|
|||||||
@@ -30,7 +30,6 @@
|
|||||||
|
|
||||||
/datum/unit_test/screenshot_humanoids/proc/get_flat_icon_for_all_directions(atom/thing)
|
/datum/unit_test/screenshot_humanoids/proc/get_flat_icon_for_all_directions(atom/thing)
|
||||||
var/icon/output = icon('icons/effects/effects.dmi', "nothing")
|
var/icon/output = icon('icons/effects/effects.dmi', "nothing")
|
||||||
COMPILE_OVERLAYS(thing)
|
|
||||||
|
|
||||||
for (var/direction in GLOB.cardinals)
|
for (var/direction in GLOB.cardinals)
|
||||||
var/icon/partial = getFlatIcon(thing, defdir = direction, no_anim = TRUE)
|
var/icon/partial = getFlatIcon(thing, defdir = direction, no_anim = TRUE)
|
||||||
|
|||||||
@@ -14,7 +14,6 @@
|
|||||||
|
|
||||||
/datum/unit_test/screenshot_saturnx/proc/get_flat_icon_for_all_directions(atom/thing)
|
/datum/unit_test/screenshot_saturnx/proc/get_flat_icon_for_all_directions(atom/thing)
|
||||||
var/icon/output = icon('icons/effects/effects.dmi', "nothing")
|
var/icon/output = icon('icons/effects/effects.dmi', "nothing")
|
||||||
COMPILE_OVERLAYS(thing)
|
|
||||||
|
|
||||||
for (var/direction in GLOB.cardinals)
|
for (var/direction in GLOB.cardinals)
|
||||||
var/icon/partial = getFlatIcon(thing, defdir = direction)
|
var/icon/partial = getFlatIcon(thing, defdir = direction)
|
||||||
|
|||||||
@@ -35,5 +35,4 @@
|
|||||||
gent.aroused = AROUSAL_FULL
|
gent.aroused = AROUSAL_FULL
|
||||||
gent.update_sprite_suffix()
|
gent.update_sprite_suffix()
|
||||||
mannequin.update_body()
|
mannequin.update_body()
|
||||||
COMPILE_OVERLAYS(mannequin)
|
|
||||||
return mannequin.appearance
|
return mannequin.appearance
|
||||||
|
|||||||
@@ -108,7 +108,6 @@
|
|||||||
mannequin.underwear_visibility = UNDERWEAR_HIDE_UNDIES | UNDERWEAR_HIDE_SHIRT | UNDERWEAR_HIDE_SOCKS
|
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
|
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))
|
parent.show_character_previews(new /mutable_appearance(mannequin))
|
||||||
unset_busy_human_dummy(DUMMY_HUMAN_SLOT_PREFERENCES)
|
unset_busy_human_dummy(DUMMY_HUMAN_SLOT_PREFERENCES)
|
||||||
|
|
||||||
@@ -243,7 +242,6 @@
|
|||||||
body.equipOutfit(outfit, TRUE)
|
body.equipOutfit(outfit, TRUE)
|
||||||
|
|
||||||
var/icon/out_icon = icon('icons/effects/effects.dmi', "nothing")
|
var/icon/out_icon = icon('icons/effects/effects.dmi', "nothing")
|
||||||
COMPILE_OVERLAYS(body)
|
|
||||||
for(var/D in showDirs)
|
for(var/D in showDirs)
|
||||||
var/icon/partial = getFlatIcon(body, defdir=D)
|
var/icon/partial = getFlatIcon(body, defdir=D)
|
||||||
out_icon.Insert(partial,dir=D)
|
out_icon.Insert(partial,dir=D)
|
||||||
|
|||||||
Reference in New Issue
Block a user