mirror of
https://github.com/izzy2lost/2ship2harkinian-Android.git
synced 2026-06-19 01:20:08 -07:00
Fix interpolation crashes due to unclosed records (#263)
* Fix interpolation crashes due to unclosed records * rework en_mnk drawface to avoid return in open/close disps pair [still matching] * fix placement of close_disps in en_osn draw * replace returns with goto to follow other decomp patterns
This commit is contained in:
+25
-15
@@ -261,24 +261,34 @@ extern Gfx gEmptyDL[];
|
||||
#define OVERLAY_DISP __gfxCtx->overlay.p
|
||||
#define DEBUG_DISP __gfxCtx->debug.p
|
||||
|
||||
// #region 2S2H [Port] Logic to perform in DISPS methods for debug information and frame interpolation support
|
||||
#define OPEN_DISPS_PORT_HELPERS(gfxCtx) \
|
||||
void FrameInterpolation_RecordOpenChild(const void* a, int b); \
|
||||
FrameInterpolation_RecordOpenChild(__FILE__, __LINE__); \
|
||||
Gfx* __dispRefs[3]; \
|
||||
Gfx __dispVals[3]; \
|
||||
Graph_OpenDisps(__dispRefs, __dispVals, gfxCtx, __FILE__, __LINE__)
|
||||
|
||||
#define CLOSE_DISPS_PORT_HELPERS(gfxCtx) \
|
||||
void FrameInterpolation_RecordCloseChild(void); \
|
||||
FrameInterpolation_RecordCloseChild(); \
|
||||
Graph_CloseDisps(__dispRefs, __dispVals, gfxCtx, __FILE__, __LINE__)
|
||||
|
||||
// #endregion
|
||||
|
||||
// __gfxCtx shouldn't be used directly.
|
||||
// Use the DISP macros defined above when writing to display buffers.
|
||||
// 2S2H [Port] Augmented to provide debug information and support interpolation
|
||||
#define OPEN_DISPS(gfxCtx) \
|
||||
{ \
|
||||
void FrameInterpolation_RecordOpenChild(const void* a, int b); \
|
||||
FrameInterpolation_RecordOpenChild(__FILE__, __LINE__); \
|
||||
GraphicsContext* __gfxCtx = gfxCtx; \
|
||||
Gfx* __dispRefs[3]; \
|
||||
Gfx __dispVals[3]; \
|
||||
Graph_OpenDisps(__dispRefs, __dispVals, gfxCtx, __FILE__, __LINE__)
|
||||
// 2S2H [Port] Augmented to use our disps helpers
|
||||
#define OPEN_DISPS(gfxCtx) \
|
||||
{ \
|
||||
GraphicsContext* __gfxCtx = gfxCtx; \
|
||||
s32 __dispPad; \
|
||||
OPEN_DISPS_PORT_HELPERS(gfxCtx)
|
||||
|
||||
#define CLOSE_DISPS(gfxCtx) \
|
||||
(void)0; \
|
||||
void FrameInterpolation_RecordCloseChild(void); \
|
||||
FrameInterpolation_RecordCloseChild(); \
|
||||
Graph_CloseDisps(__dispRefs, __dispVals, gfxCtx, __FILE__, __LINE__); \
|
||||
} \
|
||||
#define CLOSE_DISPS(gfxCtx) \
|
||||
(void)0; \
|
||||
CLOSE_DISPS_PORT_HELPERS(gfxCtx); \
|
||||
} \
|
||||
(void)0
|
||||
|
||||
#define GRAPH_ALLOC(gfxCtx, size) ((void*)((gfxCtx)->polyOpa.d = (Gfx*)((u8*)(gfxCtx)->polyOpa.d - ALIGN16(size))))
|
||||
|
||||
Reference in New Issue
Block a user