1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2024-11-13 04:39:36 +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
#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

View file

@ -99,11 +99,7 @@ void EnAnubiceTag_Update(Actor* thisx, PlayState* play) {
void EnAnubiceTag_Draw(Actor* thisx, PlayState* play) {
EnAnubiceTag* this = (EnAnubiceTag*)thisx;
#if OOT_DEBUG
if (BREG(0) != 0) {
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, 0, 255, 4, play->state.gfxCtx);
}
#endif
DEBUG_DISPLAY_ADD_OBJECT(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, 0, 255, 4, play->state.gfxCtx);
}

View file

@ -282,11 +282,7 @@ void EnChanger_Update(Actor* thisx, PlayState* play) {
this->timer--;
}
#if OOT_DEBUG
if (BREG(0) != 0) {
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
DEBUG_DISPLAY_ADD_OBJECT(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);
}

View file

@ -284,13 +284,9 @@ void FireRock_WaitSpawnRocksFromCeiling(EnFireRock* this, PlayState* play) {
this->playerNearby = 0;
}
#if OOT_DEBUG
if (BREG(0) != 0) {
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, 255, 0, 255, 4, play->state.gfxCtx);
}
#endif
DEBUG_DISPLAY_ADD_OBJECT(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, 255, 0, 255, 4, play->state.gfxCtx);
}
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) {
EnFr* this = (EnFr*)thisx;
#if OOT_DEBUG
if (BREG(0) != 0) {
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, 0, 255, 4, play->state.gfxCtx);
}
#endif
DEBUG_DISPLAY_ADD_OBJECT(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, 0, 255, 4, play->state.gfxCtx);
this->jumpCounter++;
this->actionFunc(this, play);
}

View file

@ -115,12 +115,7 @@ void EnOkarinaEffect_Update(Actor* thisx, PlayState* play) {
EnOkarinaEffect* this = (EnOkarinaEffect*)thisx;
this->actionFunc(this, play);
#if OOT_DEBUG
if (BREG(0) != 0) {
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
DEBUG_DISPLAY_ADD_OBJECT(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);
}

View file

@ -1348,13 +1348,9 @@ void EnSkj_SariasSongShortStumpUpdate(Actor* thisx, PlayState* play) {
D_80B01EA0 = Actor_TalkOfferAccepted(&this->actor, play);
#if OOT_DEBUG
if (BREG(0) != 0) {
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, 0, 255, 4, play->state.gfxCtx);
}
#endif
DEBUG_DISPLAY_ADD_OBJECT(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, 0, 255, 4, play->state.gfxCtx);
}
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.z = 450.0f;
#if OOT_DEBUG
if (BREG(0) != 0) {
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, 0, 255, 4, play->state.gfxCtx);
}
#endif
DEBUG_DISPLAY_ADD_OBJECT(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, 0, 255, 4, play->state.gfxCtx);
this->actionFunc(this, play);

View file

@ -343,11 +343,7 @@ void EnSyatekiItm_Update(Actor* thisx, PlayState* play) {
this->unkTimer--;
}
#if OOT_DEBUG
if (BREG(0) != 0) {
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, 0, 255, 4, play->state.gfxCtx);
}
#endif
DEBUG_DISPLAY_ADD_OBJECT(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, 0, 255, 4, play->state.gfxCtx);
}

View file

@ -146,12 +146,7 @@ void EnWallTubo_Update(Actor* thisx, PlayState* play) {
}
this->actionFunc(this, play);
#if OOT_DEBUG
if (BREG(0) != 0) {
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
DEBUG_DISPLAY_ADD_OBJECT(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);
}

View file

@ -326,12 +326,7 @@ void EnWeatherTag_Update(Actor* thisx, PlayState* play) {
EnWeatherTag* this = (EnWeatherTag*)thisx;
this->actionFunc(this, play);
#if OOT_DEBUG
if (BREG(0) != 0) {
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
DEBUG_DISPLAY_ADD_OBJECT(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);
}

View file

@ -226,13 +226,9 @@ void EnWonderItem_MultitagFree(EnWonderItem* this, PlayState* play) {
return;
}
#if OOT_DEBUG
if (BREG(0) != 0) {
DebugDisplay_AddObject(sTagPointsFree[i].x, sTagPointsFree[i].y, sTagPointsFree[i].z,
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
DEBUG_DISPLAY_ADD_OBJECT(sTagPointsFree[i].x, sTagPointsFree[i].y, sTagPointsFree[i].z,
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);
}
}
if (this->timer == 1) {
@ -303,13 +299,9 @@ void EnWonderItem_MultitagOrdered(EnWonderItem* this, PlayState* play) {
}
}
#if OOT_DEBUG
if (BREG(0) != 0) {
DebugDisplay_AddObject(sTagPointsOrdered[i].x, sTagPointsOrdered[i].y, sTagPointsOrdered[i].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
DEBUG_DISPLAY_ADD_OBJECT(sTagPointsOrdered[i].x, sTagPointsOrdered[i].y, sTagPointsOrdered[i].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);
}
}
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);
CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base);
#if OOT_DEBUG
if (BREG(0) != 0) {
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, 0xFF, 0, 0xFF, 4, play->state.gfxCtx);
}
#endif
DEBUG_DISPLAY_ADD_OBJECT(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, 0xFF, 0, 0xFF, 4, play->state.gfxCtx);
}