Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PORT] Removes overlay queuing, saves 6/7 seconds of initialize. Lightly modifies stat tracking macros (+some sprite error fix) #10741

Open
wants to merge 34 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
a03b996
Overlay port
EvilDragonfiend Mar 14, 2024
574c210
decal fix
EvilDragonfiend Mar 14, 2024
d062b40
correct define REFERENCE_TRACKING_FAST
EvilDragonfiend Mar 14, 2024
d8e79fc
fixes unit test warnings
EvilDragonfiend Mar 14, 2024
be18429
additional icon state fixes
EvilDragonfiend Mar 14, 2024
037eacc
edits define comments
EvilDragonfiend Mar 14, 2024
af79081
gun sprite snowflake
EvilDragonfiend Mar 14, 2024
f47f2f6
Fixes sprites v2
EvilDragonfiend Mar 14, 2024
708c5be
unit test snowflake
EvilDragonfiend Mar 14, 2024
a6cfefd
fix inverted condition
EvilDragonfiend Mar 14, 2024
ad4d152
Lemon guy said it's okay to remove
EvilDragonfiend Mar 20, 2024
aca3cc9
Merge branch 'master' into overlayport-pt1
EvilDragonfiend Apr 16, 2024
b194df5
Merge branch 'master' into overlayport-pt1
EvilDragonfiend May 11, 2024
465eb66
Merge branch 'master' into overlayport-pt1
EvilDragonfiend Jul 21, 2024
bb760a5
Merge remote-tracking branch 'BeeStation/master' into overlayport-pt1
EvilDragonfiend Aug 5, 2024
7682427
cell fix
EvilDragonfiend Aug 5, 2024
310c6a9
Merge remote-tracking branch 'BeeStation/master' into overlayport-pt1
EvilDragonfiend Aug 29, 2024
0be0199
'd007' to 'd00-7'
EvilDragonfiend Aug 29, 2024
a5969e4
We won't have GLOB.running_create_and_destroy
EvilDragonfiend Sep 1, 2024
9b7d113
ugly extra line
EvilDragonfiend Sep 1, 2024
6cc2469
Merge branch 'master' into overlayport-pt1
EvilDragonfiend Sep 13, 2024
d2a45ed
BACON WHY
EvilDragonfiend Sep 13, 2024
57ca071
cyborg overylay fix
EvilDragonfiend Sep 14, 2024
4660619
Merge branch 'master' into overlayport-pt1
EvilDragonfiend Oct 20, 2024
0429c33
Merge remote-tracking branch 'BeeStation/master' into overlayport-pt1
EvilDragonfiend Nov 18, 2024
4e476ac
Removes unused macro
EvilDragonfiend Nov 19, 2024
c82852b
Merge remote-tracking branch 'BeeStation/master' into overlayport-pt1
EvilDragonfiend Nov 25, 2024
d1b16f1
removes magazine check
EvilDragonfiend Dec 8, 2024
238d0f2
fixes gun sprite error
EvilDragonfiend Dec 8, 2024
d08acd6
Merge remote-tracking branch 'BeeStation/master' into overlayport-pt1
EvilDragonfiend Dec 10, 2024
fcb838f
solves atmos console overlay
EvilDragonfiend Dec 16, 2024
8e78d63
Merge remote-tracking branch 'BeeStation/master' into overlayport-pt1
EvilDragonfiend Dec 16, 2024
1d25e41
Merge branch 'master' into overlayport-pt1
EvilDragonfiend Dec 24, 2024
58f6acf
Update bitfields.dm
EvilDragonfiend Dec 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 18 additions & 19 deletions code/__DEFINES/flags.dm
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,24 @@ GLOBAL_LIST_INIT(bitflags, list(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 204
#define DF_ISPROCESSING (1<<2)

//! ## FLAGS BITMASK
#define CONDUCT_1 (1<<5) //! conducts electricity (iron etc.)
#define NODECONSTRUCT_1 (1<<7) //! For machines and structures that should not break into parts, eg, holodeck stuff
#define OVERLAY_QUEUED_1 (1<<8) //! atom queued to SSoverlay
#define ON_BORDER_1 (1<<9) //! item has priority to check when entering or leaving
#define PREVENT_CLICK_UNDER_1 (1<<11) //! Prevent clicking things below it on the same turf eg. doors/ fulltile windows
#define HOLOGRAM_1 (1<<12)
#define TESLA_IGNORE_1 (1<<13) //! TESLA_IGNORE grants immunity from being targeted by tesla-style electricity
#define INITIALIZED_1 (1<<14) //! Whether /atom/Initialize(mapload) has already run for the object
#define ADMIN_SPAWNED_1 (1<<15) //! was this spawned by an admin? used for stat tracking stuff.
#define PREVENT_CONTENTS_EXPLOSION_1 (1<<16)
#define UNPAINTABLE_1 (1<<17)
#define HTML_USE_INITAL_ICON_1 (1<<18) //! Should we use the initial icon for display? Mostly used by overlay only objects
#define CONDUCT_1 (1<<0) //! conducts electricity (iron etc.)
EvilDragonfiend marked this conversation as resolved.
Show resolved Hide resolved
#define NODECONSTRUCT_1 (1<<1) //! For machines and structures that should not break into parts, eg, holodeck stuff
#define ON_BORDER_1 (1<<2) //! item has priority to check when entering or leaving
#define PREVENT_CLICK_UNDER_1 (1<<3) //! Prevent clicking things below it on the same turf eg. doors/ fulltile windows
#define HOLOGRAM_1 (1<<4)
#define TESLA_IGNORE_1 (1<<5) //! TESLA_IGNORE grants immunity from being targeted by tesla-style electricity
#define INITIALIZED_1 (1<<6) //! Whether /atom/Initialize(mapload) has already run for the object
#define ADMIN_SPAWNED_1 (1<<7) //! was this spawned by an admin? used for stat tracking stuff.
#define PREVENT_CONTENTS_EXPLOSION_1 (1<<8)
#define UNPAINTABLE_1 (1<<9)
#define HTML_USE_INITAL_ICON_1 (1<<10) //! Should we use the initial icon for display? Mostly used by overlay only objects

//turf-only flags
#define NOJAUNT_1 (1<<11)
EvilDragonfiend marked this conversation as resolved.
Show resolved Hide resolved
#define UNUSED_RESERVATION_TURF_1 (1<<12)
#define CAN_BE_DIRTY_1 (1<<13) //! If a turf can be made dirty at roundstart. This is also used in areas.
#define NO_LAVA_GEN_1 (1<<13) //! Blocks lava rivers being generated on the turf
#define NO_RUINS_1 (1<<14) //! Blocks ruins spawning on the turf

// Update flags for [/atom/proc/update_appearance]
/// Update the atom's name
Expand All @@ -61,13 +67,6 @@ GLOBAL_LIST_INIT(bitflags, list(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 204
/// If the thing can reflect matter (bullets/bomb shrapnel)
#define RICOCHET_HARD (1<<1)

//turf-only flags
#define NOJAUNT_1 (1<<0)
#define UNUSED_RESERVATION_TURF_1 (1<<1)
#define CAN_BE_DIRTY_1 (1<<2) //! If a turf can be made dirty at roundstart. This is also used in areas.
#define NO_LAVA_GEN_1 (1<<6) //! Blocks lava rivers being generated on the turf
#define NO_RUINS_1 (1<<10) //! Blocks ruins spawning on the turf

////////////////Area flags\\\\\\\\\\\\\\
/// If it's a valid territory for cult summoning or the CRAB-17 phone to spawn
#define VALID_TERRITORY (1<<0)
Expand Down
8 changes: 1 addition & 7 deletions code/__DEFINES/stat_tracking.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,4 @@
#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;
36 changes: 15 additions & 21 deletions code/__DEFINES/subsystems.dm
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
#define INIT_ORDER_PERSISTENCE -2 //before assets because some assets take data from SSPersistence
#define INIT_ORDER_ASSETS -4
#define INIT_ORDER_ICON_SMOOTHING -5
#define INIT_ORDER_OVERLAY -6
//#define INIT_ORDER_OVERLAY -6 // unused but just in case
#define INIT_ORDER_STAT -7
#define INIT_ORDER_XKEYSCORE -10
#define INIT_ORDER_STICKY_BAN -10
Expand Down Expand Up @@ -193,7 +193,7 @@
#define FIRE_PRIORITY_ATMOS_ADJACENCY 300
#define FIRE_PRIORITY_CHAT 400
#define FIRE_PRIORITY_RUNECHAT 410
#define FIRE_PRIORITY_OVERLAYS 500
//#define FIRE_PRIORITY_OVERLAYS 500 // unused but just in case
#define FIRE_PRIORITY_CALLBACKS 600
#define FIRE_PRIORITY_EXPLOSIONS 666
#define FIRE_PRIORITY_PREFERENCES 690
Expand Down Expand Up @@ -244,27 +244,21 @@
#define GAME_STATE_FINISHED 4

//! ## Overlays subsystem

/// Compile all the overlays for an atom from the cache lists
#define COMPILE_OVERLAYS(A)\
if (A) {\
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;\
} \
}

/**
Expand Down
2 changes: 0 additions & 2 deletions code/__HELPERS/icons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1125,7 +1125,6 @@ GLOBAL_LIST_EMPTY(friendly_animal_types)
var/icon/out_icon = icon('icons/effects/effects.dmi', "nothing")
for(var/D in showDirs)
body.setDir(D)
COMPILE_OVERLAYS(body)
var/icon/partial = getFlatIcon(body)
out_icon.Insert(partial,dir=D)

Expand Down Expand Up @@ -1155,7 +1154,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)
Expand Down
2 changes: 1 addition & 1 deletion code/_globalvars/bitfields.dm
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ DEFINE_BITFIELD(flags_1, list(
"CONDUCT_1" = CONDUCT_1,
"NO_LAVA_GEN_1" = NO_LAVA_GEN_1,
"NODECONSTRUCT_1" = NODECONSTRUCT_1,
"OVERLAY_QUEUED_1" = OVERLAY_QUEUED_1,
"ON_BORDER_1" = ON_BORDER_1,
"NO_RUINS_1" = NO_RUINS_1,
"PREVENT_CLICK_UNDER_1" = PREVENT_CLICK_UNDER_1,
Expand All @@ -184,6 +183,7 @@ DEFINE_BITFIELD(flags_1, list(
"ADMIN_SPAWNED_1" = ADMIN_SPAWNED_1,
"PREVENT_CONTENTS_EXPLOSION_1" = PREVENT_CONTENTS_EXPLOSION_1,
"UNPAINTABLE_1" = UNPAINTABLE_1,
"HTML_USE_INITAL_ICON_1" = HTML_USE_INITAL_ICON_1,
))

DEFINE_BITFIELD(flags_ricochet, list(
Expand Down
Loading
Loading