diff --git a/spm-headers/include/common.h b/spm-headers/include/common.h index 0f5457a..ede2b25 100644 --- a/spm-headers/include/common.h +++ b/spm-headers/include/common.h @@ -110,6 +110,13 @@ typedef u8 unk8; #define DECOMP_STATIC(expr) extern expr; #endif +// Macro for something that is deadstripped outside of decomp +#ifdef DECOMP + #define STRIPPED(expr) expr; +#else + #define STRIPPED(expr) +#endif + // Use extern "C" in C++, use namespacing in mods #ifdef __cplusplus #ifndef DECOMP diff --git a/spm-headers/include/spm/seq_title.h b/spm-headers/include/spm/seq_title.h index 4742c3f..d589922 100644 --- a/spm-headers/include/spm/seq_title.h +++ b/spm-headers/include/spm/seq_title.h @@ -57,6 +57,7 @@ void seq_titleMain(SeqWork * work); void seq_titleExit(SeqWork * work); void seqTitleDispCb(s32 cameraId, void * param); void seqTitleInitLayout(); +STRIPPED(void seqTitleDeleteLayout()) void seqTitleDisp(); // No idea why this is in this file of all places, but it is diff --git a/src/seq_title.c b/src/seq_title.c index 4d63cad..e075412 100644 --- a/src/seq_title.c +++ b/src/seq_title.c @@ -130,11 +130,7 @@ void seq_titleExit(SeqWork * seqWork) { (void) seqWork; - delete wp->layout; - delete wp->arcResAccessor; - - __memFree(HEAP_MAP, wp->arc); - __memFree(HEAP_MAP, wp->heap); + seqTitleDeleteLayout(); memClear(HEAP_MAP); } @@ -220,6 +216,16 @@ void seqTitleInitLayout() spsndSFXOn("SFX_SYS_TITLE_APPEAR1"); } +// ALways inlined +void seqTitleDeleteLayout() +{ + delete wp->layout; + delete wp->arcResAccessor; + + __memFree(HEAP_MAP, wp->arc); + __memFree(HEAP_MAP, wp->heap); +} + void seqTitleDisp() { // Setup draw info