summaryrefslogtreecommitdiff
path: root/soh/src/code/z_debug_display.c
diff options
context:
space:
mode:
authorGarrett Cox <garrettjcox@gmail.com>2022-11-06 02:24:34 -0600
committerGitHub <noreply@github.com>2022-11-06 09:24:34 +0100
commit99260acaf119b6b2b57dd10eb357fa1271bfc536 (patch)
tree54a84799114585a484af6224c84b06fe582c9202 /soh/src/code/z_debug_display.c
parent710a768d76ca6a04ed8596b9db9d665a79400ad9 (diff)
Use PlayState instead of GlobalContext (#1927)
* Use PlayState instead of GlobalContext - GlobalContext -> PlayState - globalCtx -> play - GlobalCtx -> PlayState - globalContext -> playState * Find and replace Gameplay_ with Play_ * Correct some misnamed argument cases
Diffstat (limited to 'soh/src/code/z_debug_display.c')
-rw-r--r--soh/src/code/z_debug_display.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/soh/src/code/z_debug_display.c b/soh/src/code/z_debug_display.c
index 14a75aa41..48cca9149 100644
--- a/soh/src/code/z_debug_display.c
+++ b/soh/src/code/z_debug_display.c
@@ -6,10 +6,10 @@ typedef struct {
/* 0x04 */ void* drawArg; // segment address (display list or texture) passed to the draw function when called
} DebugDispObjectInfo; // size = 0x8
-typedef void (*DebugDispObject_DrawFunc)(DebugDispObject*, void*, GlobalContext*);
+typedef void (*DebugDispObject_DrawFunc)(DebugDispObject*, void*, PlayState*);
-void DebugDisplay_DrawSpriteI8(DebugDispObject* dispObj, void* texture, GlobalContext* globalCtx);
-void DebugDisplay_DrawPolygon(DebugDispObject* dispObj, void* dlist, GlobalContext* globalCtx);
+void DebugDisplay_DrawSpriteI8(DebugDispObject* dispObj, void* texture, PlayState* play);
+void DebugDisplay_DrawPolygon(DebugDispObject* dispObj, void* dlist, PlayState* play);
static DebugDispObject_DrawFunc sDebugObjectDrawFuncTable[] = {
DebugDisplay_DrawSpriteI8,
@@ -55,43 +55,43 @@ DebugDispObject* DebugDisplay_AddObject(f32 posX, f32 posY, f32 posZ, s16 rotX,
return sDebugObjectListHead;
}
-void DebugDisplay_DrawObjects(GlobalContext* globalCtx) {
+void DebugDisplay_DrawObjects(PlayState* play) {
DebugDispObject* dispObj = sDebugObjectListHead;
DebugDispObjectInfo* objInfo;
while (dispObj != NULL) {
objInfo = &sDebugObjectInfoTable[dispObj->type];
- sDebugObjectDrawFuncTable[objInfo->drawType](dispObj, objInfo->drawArg, globalCtx);
+ sDebugObjectDrawFuncTable[objInfo->drawType](dispObj, objInfo->drawArg, play);
dispObj = dispObj->next;
}
}
-void DebugDisplay_DrawSpriteI8(DebugDispObject* dispObj, void* texture, GlobalContext* globalCtx) {
- OPEN_DISPS(globalCtx->state.gfxCtx);
+void DebugDisplay_DrawSpriteI8(DebugDispObject* dispObj, void* texture, PlayState* play) {
+ OPEN_DISPS(play->state.gfxCtx);
- func_80094678(globalCtx->state.gfxCtx);
+ func_80094678(play->state.gfxCtx);
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, dispObj->color.r, dispObj->color.g, dispObj->color.b, dispObj->color.a);
Matrix_Translate(dispObj->pos.x, dispObj->pos.y, dispObj->pos.z, MTXMODE_NEW);
Matrix_Scale(dispObj->scale.x, dispObj->scale.y, dispObj->scale.z, MTXMODE_APPLY);
- Matrix_Mult(&globalCtx->billboardMtxF, MTXMODE_APPLY);
+ Matrix_Mult(&play->billboardMtxF, MTXMODE_APPLY);
Matrix_RotateZYX(dispObj->rot.x, dispObj->rot.y, dispObj->rot.z, MTXMODE_APPLY);
gDPLoadTextureBlock(POLY_XLU_DISP++, texture, G_IM_FMT_I, G_IM_SIZ_8b, 16, 16, 0, G_TX_NOMIRROR | G_TX_WRAP,
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
- gSPMatrix(POLY_XLU_DISP++, MATRIX_NEWMTX(globalCtx->state.gfxCtx),
+ gSPMatrix(POLY_XLU_DISP++, MATRIX_NEWMTX(play->state.gfxCtx),
G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(POLY_XLU_DISP++, gDebugSpriteDL);
- CLOSE_DISPS(globalCtx->state.gfxCtx);
+ CLOSE_DISPS(play->state.gfxCtx);
}
-void DebugDisplay_DrawPolygon(DebugDispObject* dispObj, void* dlist, GlobalContext* globalCtx) {
- OPEN_DISPS(globalCtx->state.gfxCtx);
+void DebugDisplay_DrawPolygon(DebugDispObject* dispObj, void* dlist, PlayState* play) {
+ OPEN_DISPS(play->state.gfxCtx);
- func_8009435C(globalCtx->state.gfxCtx);
+ func_8009435C(play->state.gfxCtx);
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, dispObj->color.r, dispObj->color.g, dispObj->color.b, dispObj->color.a);
@@ -100,9 +100,9 @@ void DebugDisplay_DrawPolygon(DebugDispObject* dispObj, void* dlist, GlobalConte
Matrix_SetTranslateRotateYXZ(dispObj->pos.x, dispObj->pos.y, dispObj->pos.z, &dispObj->rot);
Matrix_Scale(dispObj->scale.x, dispObj->scale.y, dispObj->scale.z, MTXMODE_APPLY);
- gSPMatrix(POLY_XLU_DISP++, MATRIX_NEWMTX(globalCtx->state.gfxCtx),
+ gSPMatrix(POLY_XLU_DISP++, MATRIX_NEWMTX(play->state.gfxCtx),
G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(POLY_XLU_DISP++, dlist);
- CLOSE_DISPS(globalCtx->state.gfxCtx);
+ CLOSE_DISPS(play->state.gfxCtx);
}