Skip to content

Comments

adds hopefully working macro size toggle#1

Draft
silicons wants to merge 6 commits intowewman222:mainfrom
silicons:my_opinions_on_macros_are_definitely_my_own_and_are_not_at_throatpoint_by_the_macro_shadow_council
Draft

adds hopefully working macro size toggle#1
silicons wants to merge 6 commits intowewman222:mainfrom
silicons:my_opinions_on_macros_are_definitely_my_own_and_are_not_at_throatpoint_by_the_macro_shadow_council

Conversation

@silicons
Copy link

@silicons silicons commented Aug 5, 2025

this is a bit of a nightmare

read the comments for the down low on why it's done this way, but tl;dr:

  • override images are one-per-atom-per-client; their entire point is full appearance override (which sucks btw; they can't partial override) so obviously you can't have more than one
  • this is a problem because and mind my french, for whatever possible reason roguetown abuses unmanaged override images applied every tick (??????????????????????????????) to do fovcone stuff instead of something like actually writing a fov system or or or or or - (this is why i'm a grumpy refactor coder and not someone you actually want on a fun medieval codebase lol)
  • given i'm not going to write an entire atom hud rearchitecture for multi-override handling (this 'fix' has made me realize i need this for my own codebase but that's a good time down the line; multi overrides is very complicated and expensive) i opted for a simple modular component for this use case amongst others
  • this component will clash with other override images. it will always lose the clash, because unlike the people whom wrote said other override images, i don't resort to just brute forcing it every tick.

if(LAZYLEN(po)){\
A.overlays |= po;\
}\
SEND_SIGNAL(A, COMSIG_ATOM_COMPILED_OVERLAYS);\
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needed a signal hook to know when to re-render

Comment on lines -40 to +50
// COMPARE: The variable on the objects to compare
#define BINARY_INSERT(IN, LIST, TYPECONT, COMPARE) \
var/__BIN_CTTL = length(LIST);\
if(!__BIN_CTTL) {\
LIST += IN;\
} else {\
var/__BIN_LEFT = 1;\
var/__BIN_RIGHT = __BIN_CTTL;\
var/__BIN_MID = (__BIN_LEFT + __BIN_RIGHT) >> 1;\
var/##TYPECONT/__BIN_ITEM;\
while(__BIN_LEFT < __BIN_RIGHT) {\
__BIN_ITEM = LIST[__BIN_MID];\
if(__BIN_ITEM.##COMPARE <= IN.##COMPARE) {\
__BIN_LEFT = __BIN_MID + 1;\
} else {\
__BIN_RIGHT = __BIN_MID;\
/// Passed into BINARY_INSERT to compare keys
#define COMPARE_KEY __BIN_LIST[__BIN_MID]
/// Passed into BINARY_INSERT to compare values
#define COMPARE_VALUE __BIN_LIST[__BIN_LIST[__BIN_MID]]

/****
* Binary search sorted insert
* Sorts low to high.
*
* * INPUT: Object to be inserted
* * LIST: List to insert object into
* * TYPECONT: The typepath of the contents of the list
* * COMPARE: The object to compare against, usualy the same as INPUT
* * COMPARISON: The variable on the objects to compare
* * COMPTYPE: How should the values be compared? Either COMPARE_KEY or COMPARE_VALUE.
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

your binary insert was out of date

Comment on lines +179 to +190
/datum/callback/proc/invoke_no_sleep(...)
#define CALLBACK_SLEEP_SENTINEL "---!!SOMEBULLSHITSTRINGYOUDEFINITELYWONTSEEANYWHEREELSE----!!!"
. = CALLBACK_SLEEP_SENTINEL
. = invoke_no_sleep_call(arglist(args))
if(. == CALLBACK_SLEEP_SENTINEL)
. = null
CRASH("Callback [src] slept on a no-sleeping invoke.")
#undef CALLBACK_SLEEP_SENTINEL

/datum/callback/proc/invoke_no_sleep_call(...)
PRIVATE_PROC(TRUE)
set waitfor = FALSE
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

protective sentinel call to prevent sleeping; if the hooks used in the component slept it would literally detonate SSoverlays, you do not want this

@silicons
Copy link
Author

silicons commented Aug 5, 2025

i'm going to bed i didn't test this pr because i literally can't figure out how to observe on this codebase 💀

@silicons silicons marked this pull request as draft August 5, 2025 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant