1
0
mirror of https://github.com/zeldaret/oot.git synced 2024-09-21 04:24:43 +00:00

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

View File

@ -187,6 +187,22 @@ extern struct GraphicsContext* __gfxCtx;
} \ } \
(void)0 (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 GRAPH_ALLOC(gfxCtx, size) Graph_Alloc(gfxCtx, size)
#define MATRIX_TO_MTX(gfxCtx, file, line) Matrix_ToMtx(gfxCtx, file, line) #define MATRIX_TO_MTX(gfxCtx, file, line) Matrix_ToMtx(gfxCtx, file, line)
#define MATRIX_NEW(gfxCtx, file, line) Matrix_NewMtx(gfxCtx, file, line) #define MATRIX_NEW(gfxCtx, file, line) Matrix_NewMtx(gfxCtx, file, line)
@ -210,16 +226,6 @@ extern struct GraphicsContext* __gfxCtx;
#else #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 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_TO_MTX(gfxCtx, file, line) Matrix_ToMtx(gfxCtx)
#define MATRIX_NEW(gfxCtx, file, line) Matrix_NewMtx(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 HUNGUP_AND_CRASH(file, line) LogUtils_HungupThread(file, line)
#define GAME_ALLOC_MALLOC(alloc, size, file, line) GameAlloc_Malloc(alloc, size) #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 * `x` vertex x

View File

@ -99,11 +99,7 @@ void EnAnubiceTag_Update(Actor* thisx, PlayState* play) {
void EnAnubiceTag_Draw(Actor* thisx, PlayState* play) { void EnAnubiceTag_Draw(Actor* thisx, PlayState* play) {
EnAnubiceTag* this = (EnAnubiceTag*)thisx; EnAnubiceTag* this = (EnAnubiceTag*)thisx;
#if OOT_DEBUG DEBUG_DISPLAY_ADD_OBJECT(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z,
if (BREG(0) != 0) { this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, 1.0f,
DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 1.0f, 255, 0, 0, 255, 4, play->state.gfxCtx);
this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, 1.0f,
1.0f, 255, 0, 0, 255, 4, play->state.gfxCtx);
}
#endif
} }

View File

@ -282,11 +282,7 @@ void EnChanger_Update(Actor* thisx, PlayState* play) {
this->timer--; this->timer--;
} }
#if OOT_DEBUG DEBUG_DISPLAY_ADD_OBJECT(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z,
if (BREG(0) != 0) { this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, 1.0f,
DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 1.0f, 255, 0, 255, 255, 4, play->state.gfxCtx);
this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, 1.0f,
1.0f, 255, 0, 255, 255, 4, play->state.gfxCtx);
}
#endif
} }

View File

@ -284,13 +284,9 @@ void FireRock_WaitSpawnRocksFromCeiling(EnFireRock* this, PlayState* play) {
this->playerNearby = 0; this->playerNearby = 0;
} }
#if OOT_DEBUG DEBUG_DISPLAY_ADD_OBJECT(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z,
if (BREG(0) != 0) { this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, 1.0f,
DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 1.0f, 0, 255, 0, 255, 4, play->state.gfxCtx);
this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, 1.0f,
1.0f, 0, 255, 0, 255, 4, play->state.gfxCtx);
}
#endif
} }
void FireRock_WaitOnFloor(EnFireRock* this, PlayState* play) { void FireRock_WaitOnFloor(EnFireRock* this, PlayState* play) {

View File

@ -1029,14 +1029,9 @@ void EnFr_SetIdle(EnFr* this, PlayState* play) {
void EnFr_UpdateIdle(Actor* thisx, PlayState* play) { void EnFr_UpdateIdle(Actor* thisx, PlayState* play) {
EnFr* this = (EnFr*)thisx; EnFr* this = (EnFr*)thisx;
#if OOT_DEBUG DEBUG_DISPLAY_ADD_OBJECT(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z,
if (BREG(0) != 0) { this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, 1.0f,
DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 1.0f, 255, 0, 0, 255, 4, play->state.gfxCtx);
this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, 1.0f,
1.0f, 255, 0, 0, 255, 4, play->state.gfxCtx);
}
#endif
this->jumpCounter++; this->jumpCounter++;
this->actionFunc(this, play); this->actionFunc(this, play);
} }

View File

@ -115,12 +115,7 @@ void EnOkarinaEffect_Update(Actor* thisx, PlayState* play) {
EnOkarinaEffect* this = (EnOkarinaEffect*)thisx; EnOkarinaEffect* this = (EnOkarinaEffect*)thisx;
this->actionFunc(this, play); this->actionFunc(this, play);
DEBUG_DISPLAY_ADD_OBJECT(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z,
#if OOT_DEBUG this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, 1.0f,
if (BREG(0) != 0) { 1.0f, 0xFF, 0, 0xFF, 0xFF, 4, play->state.gfxCtx);
DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z,
this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, 1.0f,
1.0f, 0xFF, 0, 0xFF, 0xFF, 4, play->state.gfxCtx);
}
#endif
} }

View File

@ -1348,13 +1348,9 @@ void EnSkj_SariasSongShortStumpUpdate(Actor* thisx, PlayState* play) {
D_80B01EA0 = Actor_TalkOfferAccepted(&this->actor, play); D_80B01EA0 = Actor_TalkOfferAccepted(&this->actor, play);
#if OOT_DEBUG DEBUG_DISPLAY_ADD_OBJECT(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z,
if (BREG(0) != 0) { this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, 1.0f,
DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 1.0f, 255, 0, 0, 255, 4, play->state.gfxCtx);
this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, 1.0f,
1.0f, 255, 0, 0, 255, 4, play->state.gfxCtx);
}
#endif
} }
void EnSkj_TurnPlayer(EnSkj* this, Player* player) { void EnSkj_TurnPlayer(EnSkj* this, Player* player) {
@ -1591,13 +1587,9 @@ void EnSkj_OcarinaMinigameShortStumpUpdate(Actor* thisx, PlayState* play) {
this->actor.focus.pos.y = -90.0f; this->actor.focus.pos.y = -90.0f;
this->actor.focus.pos.z = 450.0f; this->actor.focus.pos.z = 450.0f;
#if OOT_DEBUG DEBUG_DISPLAY_ADD_OBJECT(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z,
if (BREG(0) != 0) { this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, 1.0f,
DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 1.0f, 255, 0, 0, 255, 4, play->state.gfxCtx);
this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, 1.0f,
1.0f, 255, 0, 0, 255, 4, play->state.gfxCtx);
}
#endif
this->actionFunc(this, play); this->actionFunc(this, play);

View File

@ -343,11 +343,7 @@ void EnSyatekiItm_Update(Actor* thisx, PlayState* play) {
this->unkTimer--; this->unkTimer--;
} }
#if OOT_DEBUG DEBUG_DISPLAY_ADD_OBJECT(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z,
if (BREG(0) != 0) { this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, 1.0f,
DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 1.0f, 255, 0, 0, 255, 4, play->state.gfxCtx);
this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, 1.0f,
1.0f, 255, 0, 0, 255, 4, play->state.gfxCtx);
}
#endif
} }

View File

@ -146,12 +146,7 @@ void EnWallTubo_Update(Actor* thisx, PlayState* play) {
} }
this->actionFunc(this, play); this->actionFunc(this, play);
DEBUG_DISPLAY_ADD_OBJECT(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z,
#if OOT_DEBUG this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, 1.0f,
if (BREG(0) != 0) { 1.0f, 0, 0, 255, 255, 4, play->state.gfxCtx);
DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z,
this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, 1.0f,
1.0f, 0, 0, 255, 255, 4, play->state.gfxCtx);
}
#endif
} }

View File

@ -326,12 +326,7 @@ void EnWeatherTag_Update(Actor* thisx, PlayState* play) {
EnWeatherTag* this = (EnWeatherTag*)thisx; EnWeatherTag* this = (EnWeatherTag*)thisx;
this->actionFunc(this, play); this->actionFunc(this, play);
DEBUG_DISPLAY_ADD_OBJECT(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z,
#if OOT_DEBUG this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, 1.0f,
if (BREG(0) != 0) { 1.0f, 255, 0, 255, 255, 4, play->state.gfxCtx);
DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z,
this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, 1.0f,
1.0f, 255, 0, 255, 255, 4, play->state.gfxCtx);
}
#endif
} }

View File

@ -226,13 +226,9 @@ void EnWonderItem_MultitagFree(EnWonderItem* this, PlayState* play) {
return; return;
} }
#if OOT_DEBUG DEBUG_DISPLAY_ADD_OBJECT(sTagPointsFree[i].x, sTagPointsFree[i].y, sTagPointsFree[i].z,
if (BREG(0) != 0) { this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f,
DebugDisplay_AddObject(sTagPointsFree[i].x, sTagPointsFree[i].y, sTagPointsFree[i].z, 1.0f, 1.0f, 0, 255, 0, 255, 4, play->state.gfxCtx);
this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f,
1.0f, 1.0f, 0, 255, 0, 255, 4, play->state.gfxCtx);
}
#endif
} }
} }
if (this->timer == 1) { if (this->timer == 1) {
@ -303,13 +299,9 @@ void EnWonderItem_MultitagOrdered(EnWonderItem* this, PlayState* play) {
} }
} }
#if OOT_DEBUG DEBUG_DISPLAY_ADD_OBJECT(sTagPointsOrdered[i].x, sTagPointsOrdered[i].y, sTagPointsOrdered[i].z,
if (BREG(0) != 0) { this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f,
DebugDisplay_AddObject(sTagPointsOrdered[i].x, sTagPointsOrdered[i].y, sTagPointsOrdered[i].z, 1.0f, 1.0f, 0, 0, 255, 255, 4, play->state.gfxCtx);
this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f,
1.0f, 1.0f, 0, 0, 255, 255, 4, play->state.gfxCtx);
}
#endif
} }
} }
if (this->timer == 1) { if (this->timer == 1) {

View File

@ -215,11 +215,7 @@ void EnYabusameMark_Update(Actor* thisx, PlayState* play) {
Collider_SetQuadVertices(&this->collider, &this->vertexA, &this->vertexB, &this->vertexC, &this->vertexD); Collider_SetQuadVertices(&this->collider, &this->vertexA, &this->vertexB, &this->vertexC, &this->vertexD);
CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base); CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base);
#if OOT_DEBUG DEBUG_DISPLAY_ADD_OBJECT(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z,
if (BREG(0) != 0) { this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, 1.0f,
DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 1.0f, 0, 0xFF, 0, 0xFF, 4, play->state.gfxCtx);
this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, 1.0f,
1.0f, 0, 0xFF, 0, 0xFF, 4, play->state.gfxCtx);
}
#endif
} }