Add macro for DebugDisplay_AddObject

This commit is contained in:
cadmic
2024-02-05 11:16:24 -08:00
parent 819e140b9b
commit 8197823abb
12 changed files with 67 additions and 106 deletions
+28 -11
View File
@@ -187,6 +187,22 @@ extern struct GraphicsContext* __gfxCtx;
} \
(void)0
#else
#define OPEN_DISPS(gfxCtx, file, line) \
{ \
GraphicsContext* __gfxCtx = gfxCtx; \
s32 __dispPad
#define CLOSE_DISPS(gfxCtx, file, line) \
(void)0; \
} \
(void)0
#endif
#if OOT_DEBUG
#define GRAPH_ALLOC(gfxCtx, size) Graph_Alloc(gfxCtx, size)
#define MATRIX_TO_MTX(gfxCtx, file, line) Matrix_ToMtx(gfxCtx, file, line)
#define MATRIX_NEW(gfxCtx, file, line) Matrix_NewMtx(gfxCtx, file, line)
@@ -210,16 +226,6 @@ extern struct GraphicsContext* __gfxCtx;
#else
#define OPEN_DISPS(gfxCtx, file, line) \
{ \
GraphicsContext* __gfxCtx = gfxCtx; \
s32 __dispPad
#define CLOSE_DISPS(gfxCtx, file, line) \
(void)0; \
} \
(void)0
#define GRAPH_ALLOC(gfxCtx, size) ((void*)((gfxCtx)->polyOpa.d = (Gfx*)((u8*)(gfxCtx)->polyOpa.d - ALIGN16(size))))
#define MATRIX_TO_MTX(gfxCtx, file, line) Matrix_ToMtx(gfxCtx)
#define MATRIX_NEW(gfxCtx, file, line) Matrix_NewMtx(gfxCtx)
@@ -241,7 +247,18 @@ extern struct GraphicsContext* __gfxCtx;
#define HUNGUP_AND_CRASH(file, line) LogUtils_HungupThread(file, line)
#define GAME_ALLOC_MALLOC(alloc, size, file, line) GameAlloc_Malloc(alloc, size)
#endif /* OOT_DEBUG */
#endif
#if OOT_DEBUG
#define DEBUG_DISPLAY_ADD_OBJECT(posX, posY, posZ, rotX, rotY, rotZ, scaleX, scaleY, scaleZ, \
red, green, blue, alpha, type, gfxCtx) \
if (BREG(0) != 0) \
DebugDisplay_AddObject(posX, posY, posZ, rotX, rotY, rotZ, scaleX, scaleY, scaleZ, \
red, green, blue, alpha, type, gfxCtx)
#else
#define DEBUG_DISPLAY_ADD_OBJECT(posX, posY, posZ, rotX, rotY, rotZ, scaleX, scaleY, scaleZ, \
red, green, blue, alpha, type, gfxCtx) (void)0
#endif
/**
* `x` vertex x