overlay stuff

This commit is contained in:
SandPoot
2024-04-12 22:01:03 -03:00
parent dfe90dfb61
commit 91045350e5
16 changed files with 202 additions and 174 deletions
+13 -15
View File
@@ -26,32 +26,30 @@ GLOBAL_LIST_INIT(bitflags, list(
//FLAGS BITMASK
///This flag is what recursive_hear_check() uses to determine wether to add an item to the hearer list or not.
#define HEAR_1 (1<<3)
#define HEAR_1 (1<<0)
///Projectiles will use default chance-based ricochet handling on things with this.
#define DEFAULT_RICOCHET_1 (1<<4)
#define DEFAULT_RICOCHET_1 (1<<1)
///Conducts electricity (metal etc.).
#define CONDUCT_1 (1<<5)
#define CONDUCT_1 (1<<2)
///For machines and structures that should not break into parts, eg, holodeck stuff.
#define NODECONSTRUCT_1 (1<<7)
///Atom queued to SSoverlay.
#define OVERLAY_QUEUED_1 (1<<8)
#define NODECONSTRUCT_1 (1<<3)
///Item has priority to check when entering or leaving.
#define ON_BORDER_1 (1<<9)
#define ON_BORDER_1 (1<<4)
///Whether or not this atom shows screentips when hovered over
#define NO_SCREENTIPS_1 (1<<10)
#define NO_SCREENTIPS_1 (1<<5)
///Prevent clicking things below it on the same turf eg. doors/ fulltile windows.
#define PREVENT_CLICK_UNDER_1 (1<<11)
#define HOLOGRAM_1 (1<<12)
#define PREVENT_CLICK_UNDER_1 (1<<6)
#define HOLOGRAM_1 (1<<7)
///Prevents mobs from getting chainshocked by teslas and the supermatter.
#define SHOCKED_1 (1<<13)
#define SHOCKED_1 (1<<8)
///Whether /atom/Initialize() has already run for the object.
#define INITIALIZED_1 (1<<14)
#define INITIALIZED_1 (1<<9)
///was this spawned by an admin? used for stat tracking stuff.
#define ADMIN_SPAWNED_1 (1<<15)
#define ADMIN_SPAWNED_1 (1<<10)
/// should not get harmed if this gets caught by an explosion?
#define PREVENT_CONTENTS_EXPLOSION_1 (1<<16)
#define PREVENT_CONTENTS_EXPLOSION_1 (1<<11)
/// Early returns mob.face_atom()
#define BLOCK_FACE_ATOM_1 (1<<17)
#define BLOCK_FACE_ATOM_1 (1<<12)
//turf-only flags
#define NOJAUNT_1 (1<<0)
+24
View File
@@ -0,0 +1,24 @@
// A reasonable number of maximum overlays an object needs
// If you think you need more, rethink it
#define MAX_ATOM_OVERLAYS 100
/// Checks if an atom has reached the overlay limit, and make a loud error if it does.
#define VALIDATE_OVERLAY_LIMIT(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')); \
} \
/// Performs any operations that ought to run after an appearance change
/* #define POST_OVERLAY_CHANGE(changed_on) \
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(changed_on, TRUE);\
}\
} \
} */
-19
View File
@@ -228,25 +228,6 @@
#define SSMOBS_DT (SSmobs.wait/10)
#define SSOBJ_DT (SSobj.wait/10)
//! ## 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();\
}\
A.flags_1 &= ~OVERLAY_QUEUED_1;\
} while(FALSE)
/**
Create a new timer and add it to the queue.
* Arguments: