From 755604d5fff65365f90bcb9c9da6b2b8bd1b5d8c Mon Sep 17 00:00:00 2001 From: cadmic Date: Mon, 12 Aug 2024 10:42:53 -0700 Subject: [PATCH] Match a bunch of overlay draw functions (#2034) * Match a bunch of actor draw functions * Change z_demo_gt.c draw functions to take Actor* thisx --- .../ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.c | 11 ++-- .../ovl_Bg_Hidan_Sima/z_bg_hidan_sima.c | 2 +- .../ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.c | 1 - .../ovl_Bg_Mori_Hineri/z_bg_mori_hineri.c | 12 ++-- .../ovl_Bg_Toki_Hikari/z_bg_toki_hikari.c | 6 +- src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c | 12 ++-- src/overlays/actors/ovl_Demo_Gt/z_demo_gt.c | 41 ++++++------ src/overlays/actors/ovl_Demo_Gt/z_demo_gt.h | 2 +- src/overlays/actors/ovl_En_Ba/z_en_ba.c | 14 ++--- .../actors/ovl_En_Bubble/z_en_bubble.c | 4 +- src/overlays/actors/ovl_En_Fd/z_en_fd.c | 4 +- .../actors/ovl_En_Fd_Fire/z_en_fd_fire.c | 22 +++---- .../actors/ovl_En_G_Switch/z_en_g_switch.c | 11 ++-- src/overlays/actors/ovl_En_Goma/z_en_goma.c | 1 + .../ovl_En_Po_Sisters/z_en_po_sisters.c | 11 ++-- src/overlays/actors/ovl_En_Zo/z_en_zo.c | 2 +- .../actors/ovl_Magic_Dark/z_magic_dark.c | 18 +++--- .../ovl_Obj_Lightswitch/z_obj_lightswitch.c | 63 +++++++++---------- .../actors/ovl_Obj_Switch/z_obj_switch.c | 24 +++---- .../actors/ovl_Obj_Switch/z_obj_switch.h | 1 + .../z_eff_ss_ice_smoke.c | 15 ++--- .../ovl_Effect_Ss_Stone1/z_eff_ss_stone1.c | 1 - .../ovl_file_choose/z_file_nameset.c | 2 - 23 files changed, 131 insertions(+), 149 deletions(-) diff --git a/src/overlays/actors/ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.c b/src/overlays/actors/ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.c index 090076a438..f280634d9a 100644 --- a/src/overlays/actors/ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.c +++ b/src/overlays/actors/ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.c @@ -96,18 +96,19 @@ void BgGjyoBridge_Update(Actor* thisx, PlayState* play) { } void BgGjyoBridge_Draw(Actor* thisx, PlayState* play) { - BgGjyoBridge* this = (BgGjyoBridge*)thisx; + PlayState* play2 = (PlayState*)play; OPEN_DISPS(play->state.gfxCtx, "../z_bg_gjyo_bridge.c", 260); Gfx_SetupDL_25Xlu(play->state.gfxCtx); - gSPSegment(POLY_XLU_DISP++, 8, - Gfx_TexScroll(play->state.gfxCtx, play->gameplayFrames & 127, play->gameplayFrames * -3 & 127, 32, 32)); + gSPSegment( + POLY_XLU_DISP++, 8, + Gfx_TexScroll(play->state.gfxCtx, play2->gameplayFrames & 127, play2->gameplayFrames * -3 & 127, 32, 32)); gSPSegment(POLY_XLU_DISP++, 9, - Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 0, -play->gameplayFrames & 127, 32, 32, 1, 0, - play->gameplayFrames & 127, 32, 32)); + Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 0, -play2->gameplayFrames & 127, 32, 32, 1, 0, + play2->gameplayFrames & 127, 32, 32)); gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_gjyo_bridge.c", 281), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); diff --git a/src/overlays/actors/ovl_Bg_Hidan_Sima/z_bg_hidan_sima.c b/src/overlays/actors/ovl_Bg_Hidan_Sima/z_bg_hidan_sima.c index 3d0ede852d..b736d24e4c 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Sima/z_bg_hidan_sima.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Sima/z_bg_hidan_sima.c @@ -226,9 +226,9 @@ void BgHidanSima_Update(Actor* thisx, PlayState* play) { Gfx* func_8088EB54(PlayState* play, BgHidanSima* this, Gfx* gfx) { MtxF mtxF; - s32 phi_s5; s32 s3; s32 v0; + s32 phi_s5; f32 cos; f32 sin; s32 pad[2]; diff --git a/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.c b/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.c index 7d779dc94a..f6bcd4283b 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.c +++ b/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.c @@ -286,7 +286,6 @@ void BgMoriHashigo_Draw(Actor* thisx, PlayState* play) { OPEN_DISPS(play->state.gfxCtx, "../z_bg_mori_hashigo.c", 516); Gfx_SetupDL_25Opa(play->state.gfxCtx); - if (1) {} gSPSegment(POLY_OPA_DISP++, 0x08, play->objectCtx.slots[this->moriTexObjectSlot].segment); gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_mori_hashigo.c", 521), diff --git a/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.c b/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.c index 7e94e0cbef..b974fa3524 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.c +++ b/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.c @@ -223,13 +223,13 @@ void BgMoriHineri_Update(Actor* thisx, PlayState* play) { void BgMoriHineri_DrawHallAndRoom(Actor* thisx, PlayState* play) { BgMoriHineri* this = (BgMoriHineri*)thisx; - s32 pad; + PlayState* play2 = (PlayState*)play; MtxF mtx; OPEN_DISPS(play->state.gfxCtx, "../z_bg_mori_hineri.c", 611); Gfx_SetupDL_25Opa(play->state.gfxCtx); - gSPSegment(POLY_OPA_DISP++, 0x08, play->objectCtx.slots[this->moriTexObjectSlot].segment); + gSPSegment(POLY_OPA_DISP++, 0x08, play2->objectCtx.slots[this->moriTexObjectSlot].segment); gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_mori_hineri.c", 618), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_OPA_DISP++, sDLists[this->dyna.actor.params]); @@ -249,9 +249,9 @@ void BgMoriHineri_DrawHallAndRoom(Actor* thisx, PlayState* play) { G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_OPA_DISP++, gDungeonDoorDL); } - if ((this->boxObjectSlot > 0) && ((this->boxObjectSlot = Object_GetSlot(&play->objectCtx, OBJECT_BOX)) > 0) && - Object_IsLoaded(&play->objectCtx, this->boxObjectSlot)) { - gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[this->boxObjectSlot].segment); + if ((this->boxObjectSlot > 0) && ((this->boxObjectSlot = Object_GetSlot(&play2->objectCtx, OBJECT_BOX)) > 0) && + Object_IsLoaded(&play2->objectCtx, this->boxObjectSlot)) { + gSPSegment(POLY_OPA_DISP++, 0x06, play2->objectCtx.slots[this->boxObjectSlot].segment); gSPSegment(POLY_OPA_DISP++, 0x08, &D_80116280[2]); Matrix_Put(&mtx); Matrix_Translate(147.0f, -245.0f, -453.0f, MTXMODE_APPLY); @@ -262,7 +262,7 @@ void BgMoriHineri_DrawHallAndRoom(Actor* thisx, PlayState* play) { gSPDisplayList(POLY_OPA_DISP++, gTreasureChestBossKeyChestFrontDL); Matrix_Put(&mtx); Matrix_Translate(167.0f, -218.0f, -453.0f, MTXMODE_APPLY); - if (Flags_GetTreasure(play, 0xE)) { + if (Flags_GetTreasure(play2, 0xE)) { Matrix_RotateZ(BINANG_TO_RAD(0x3500), MTXMODE_APPLY); } else { Matrix_RotateZ(M_PI, MTXMODE_APPLY); diff --git a/src/overlays/actors/ovl_Bg_Toki_Hikari/z_bg_toki_hikari.c b/src/overlays/actors/ovl_Bg_Toki_Hikari/z_bg_toki_hikari.c index a421d428dd..6b0a4a401e 100644 --- a/src/overlays/actors/ovl_Bg_Toki_Hikari/z_bg_toki_hikari.c +++ b/src/overlays/actors/ovl_Bg_Toki_Hikari/z_bg_toki_hikari.c @@ -82,7 +82,7 @@ void BgTokiHikari_Draw(Actor* thisx, PlayState* play) { } void func_808BA018(BgTokiHikari* this, PlayState* play) { - s32 pad; + PlayState* play2 = (PlayState*)play; OPEN_DISPS(play->state.gfxCtx, "../z_bg_toki_hikari.c", 246); Gfx_SetupDL_25Opa(play->state.gfxCtx); @@ -94,9 +94,9 @@ void func_808BA018(BgTokiHikari* this, PlayState* play) { } else { gSPDisplayList(POLY_OPA_DISP++, object_toki_objects_DL_007E20); Gfx_SetupDL_25Xlu(play->state.gfxCtx); - gSPSegment(POLY_XLU_DISP++, 8, Gfx_TexScroll(play->state.gfxCtx, 0, play->gameplayFrames % 128, 64, 32)); + gSPSegment(POLY_XLU_DISP++, 8, Gfx_TexScroll(play->state.gfxCtx, 0, play2->gameplayFrames % 128, 64, 32)); - gSPSegment(POLY_XLU_DISP++, 9, Gfx_TexScroll(play->state.gfxCtx, 0, play->gameplayFrames % 128, 64, 32)); + gSPSegment(POLY_XLU_DISP++, 9, Gfx_TexScroll(play->state.gfxCtx, 0, play2->gameplayFrames % 128, 64, 32)); gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_toki_hikari.c", 278), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); diff --git a/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c b/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c index cc5f87b0ca..d4b3b38d23 100644 --- a/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c +++ b/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c @@ -3150,7 +3150,7 @@ void BossSst_UpdateEffects(Actor* thisx, PlayState* play) { } void BossSst_DrawEffects(Actor* thisx, PlayState* play) { - s32 pad; + PlayState* play2 = (PlayState*)play; BossSst* this = (BossSst*)thisx; s32 i; BossSstEffect* effect; @@ -3161,15 +3161,15 @@ void BossSst_DrawEffects(Actor* thisx, PlayState* play) { Gfx_SetupDL_25Xlu(play->state.gfxCtx); if (this->effectMode == BONGO_ICE) { gSPSegment(POLY_XLU_DISP++, 0x08, - Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 0, play->gameplayFrames % 256, 0x20, 0x10, - 1, 0, (play->gameplayFrames * 2) % 256, 0x40, 0x20)); + Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 0, play2->gameplayFrames % 256, 0x20, 0x10, + 1, 0, (play2->gameplayFrames * 2) % 256, 0x40, 0x20)); gDPSetEnvColor(POLY_XLU_DISP++, 0, 50, 100, this->effects[0].alpha); gSPDisplayList(POLY_XLU_DISP++, gBongoIceCrystalDL); for (i = 0; i < 18; i++) { effect = &this->effects[i]; if (effect->move) { - func_8003435C(&effect->pos, play); + func_8003435C(&effect->pos, play2); if (this->effects[0].status != 0) { Matrix_Translate(effect->pos.x, effect->pos.y, effect->pos.z, MTXMODE_NEW); } else { @@ -3191,8 +3191,8 @@ void BossSst_DrawEffects(Actor* thisx, PlayState* play) { gDPPipeSync(POLY_XLU_DISP++); gSPSegment(POLY_XLU_DISP++, 0x08, - Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, play->gameplayFrames % 128, 0, 0x20, 0x40, - 1, 0, (play->gameplayFrames * -15) % 256, 0x20, 0x40)); + Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, play2->gameplayFrames % 128, 0, 0x20, 0x40, + 1, 0, (play2->gameplayFrames * -15) % 256, 0x20, 0x40)); for (i = 0; i < 3; i++, scaleY -= 0.001f) { effect = &this->effects[i]; diff --git a/src/overlays/actors/ovl_Demo_Gt/z_demo_gt.c b/src/overlays/actors/ovl_Demo_Gt/z_demo_gt.c index b9a1a9e116..fba91ea3fb 100644 --- a/src/overlays/actors/ovl_Demo_Gt/z_demo_gt.c +++ b/src/overlays/actors/ovl_Demo_Gt/z_demo_gt.c @@ -629,11 +629,11 @@ void DemoGt_Update8(DemoGt* this, PlayState* play) { func_8097EF00(this, play); } -void DemoGt_Draw1(DemoGt* this, PlayState* play) { +void DemoGt_Draw1(Actor* thisx, PlayState* play) { s32 pad; GraphicsContext* gfxCtx = play->state.gfxCtx; u32 gameplayFrames = play->gameplayFrames; - s16 pad2[2]; + DemoGt* this = (DemoGt*)thisx; s16 spC6; f32 spC0; f32 spBC; @@ -859,17 +859,18 @@ void DemoGt_Update9(DemoGt* this, PlayState* play) { func_8097FD70(this, play); } -void DemoGt_Draw2(DemoGt* this, PlayState* play) { +void DemoGt_Draw2(Actor* thisx, PlayState* play) { GraphicsContext* gfxCtx = play->state.gfxCtx; s32* unk198; s32* unk178; - s32 pad; + DemoGt* this = (DemoGt*)thisx; OPEN_DISPS(gfxCtx, "../z_demo_gt_part2.c", 470); Gfx_SetupDL_25Opa(gfxCtx); unk198 = this->unk_198; unk178 = this->unk_178; + if (1) {} gSPSegment(POLY_OPA_DISP++, 0x08, Gfx_TwoTexScrollEnvColor(gfxCtx, 0, 0, unk198[0], 0x20, 0x40, 1, 0, unk198[1], 0x20, 0x40, unk178[0], unk178[1], unk178[2], 128)); @@ -1179,7 +1180,7 @@ void DemoGt_Update10(DemoGt* this, PlayState* play) { func_80980C90(this, play); } -void DemoGt_Draw3(DemoGt* this, PlayState* play) { +void DemoGt_Draw3(Actor* thisx, PlayState* play) { GraphicsContext* gfxCtx = play->state.gfxCtx; OPEN_DISPS(gfxCtx, "../z_demo_gt_part3.c", 1026); @@ -1258,11 +1259,11 @@ void DemoGt_Update16(DemoGt* this, PlayState* play) { } } -void DemoGt_Draw4(DemoGt* this, PlayState* play2) { +void DemoGt_Draw4(Actor* thisx, PlayState* play2) { GraphicsContext* gfxCtx; PlayState* play = play2; u16 csCurFrame = play->csCtx.curFrame; - s32 pad; + DemoGt* this = (DemoGt*)thisx; s16 sp76; f32 sp70; f32 sp6C; @@ -1381,9 +1382,9 @@ void DemoGt_Update17(DemoGt* this, PlayState* play) { } } -void DemoGt_Draw5(DemoGt* this, PlayState* play) { +void DemoGt_Draw5(Actor* thisx, PlayState* play) { GraphicsContext* gfxCtx; - s32 pad; + DemoGt* this = (DemoGt*)thisx; s16 sp76; f32 sp70; f32 sp6C; @@ -1478,9 +1479,9 @@ void DemoGt_Update18(DemoGt* this, PlayState* play) { } } -void DemoGt_Draw6(DemoGt* this, PlayState* play) { - DemoGt* this2 = this; - s16 sp78 = this2->unk_172; +void DemoGt_Draw6(Actor* thisx, PlayState* play) { + DemoGt* this = (DemoGt*)thisx; + s16 sp78 = this->unk_172; f32 sp74; f32 sp70; s16 sp6E; @@ -1570,8 +1571,8 @@ void DemoGt_Update14(DemoGt* this, PlayState* play) { func_80981CEC(this, play); } -void DemoGt_Draw7(DemoGt* this, PlayState* play) { - DemoGt* this2 = this; +void DemoGt_Draw7(Actor* thisx, PlayState* play) { + DemoGt* this = (DemoGt*)thisx; GraphicsContext* gfxCtx = play->state.gfxCtx; s16 sp6E; f32 sp68; @@ -1583,7 +1584,7 @@ void DemoGt_Draw7(DemoGt* this, PlayState* play) { Vec3f sp44; f32 sp40; - sp6E = this2->unk_172; + sp6E = this->unk_172; sp68 = fabsf(BINANG_TO_RAD(sp6E)); sp64 = kREG(75); sp62 = kREG(74) + 0x7FEC; @@ -1661,8 +1662,8 @@ void DemoGt_Update15(DemoGt* this, PlayState* play) { func_809820AC(this, play); } -void DemoGt_Draw8(DemoGt* this, PlayState* play) { - DemoGt* this2 = this; +void DemoGt_Draw8(Actor* thisx, PlayState* play) { + DemoGt* this = (DemoGt*)thisx; GraphicsContext* gfxCtx = play->state.gfxCtx; s16 sp6E; f32 sp68; @@ -1674,7 +1675,7 @@ void DemoGt_Draw8(DemoGt* this, PlayState* play) { Vec3f sp44; f32 sp40; - sp6E = this2->unk_172; + sp6E = this->unk_172; sp68 = fabsf(BINANG_TO_RAD(sp6E)); sp64 = kREG(78); sp62 = kREG(77) + 0xBE80; @@ -1763,7 +1764,7 @@ void DemoGt_Init(Actor* thisx, PlayState* play) { } } -void DemoGt_Draw0(DemoGt* this, PlayState* play) { +void DemoGt_Draw0(Actor* thisx, PlayState* play) { } static DemoGtDrawFunc sDrawFuncs[] = { @@ -1781,7 +1782,7 @@ void DemoGt_Draw(Actor* thisx, PlayState* play) { return; } - drawFunc(this, play); + drawFunc(thisx, play); } ActorProfile Demo_Gt_Profile = { diff --git a/src/overlays/actors/ovl_Demo_Gt/z_demo_gt.h b/src/overlays/actors/ovl_Demo_Gt/z_demo_gt.h index 83cae1cc18..18b968b15c 100644 --- a/src/overlays/actors/ovl_Demo_Gt/z_demo_gt.h +++ b/src/overlays/actors/ovl_Demo_Gt/z_demo_gt.h @@ -7,7 +7,7 @@ struct DemoGt; typedef void (*DemoGtUpdateFunc)(struct DemoGt*, PlayState*); -typedef void (*DemoGtDrawFunc)(struct DemoGt*, PlayState*); +typedef void (*DemoGtDrawFunc)(Actor*, PlayState*); typedef struct DemoGt { /* 0x0000 */ DynaPolyActor dyna; diff --git a/src/overlays/actors/ovl_En_Ba/z_en_ba.c b/src/overlays/actors/ovl_En_Ba/z_en_ba.c index 0f927d635d..a0b8c69a4c 100644 --- a/src/overlays/actors/ovl_En_Ba/z_en_ba.c +++ b/src/overlays/actors/ovl_En_Ba/z_en_ba.c @@ -499,15 +499,11 @@ void EnBa_Draw(Actor* thisx, PlayState* play) { Matrix_RotateZYX(this->unk_2A8[i].x, this->unk_2A8[i].y, this->unk_2A8[i].z, MTXMODE_APPLY); Matrix_Scale(this->unk_200[i].x, this->unk_200[i].y, this->unk_200[i].z, MTXMODE_APPLY); if ((i == 6) || (i == 13)) { - if (mtx) {} - switch (i) { - case 13: - Collider_UpdateSpheres(i, &this->collider); - break; - default: - Matrix_Scale(0.5f, 0.5f, 1.0f, MTXMODE_APPLY); - Collider_UpdateSpheres(8, &this->collider); - break; + if (i == 13) { + Collider_UpdateSpheres(i, &this->collider); + } else { + Matrix_Scale(0.5f, 0.5f, 1.0f, MTXMODE_APPLY); + Collider_UpdateSpheres(8, &this->collider); } } MATRIX_TO_MTX(mtx, "../z_en_ba.c", 970); diff --git a/src/overlays/actors/ovl_En_Bubble/z_en_bubble.c b/src/overlays/actors/ovl_En_Bubble/z_en_bubble.c index 093e9aa1b0..7d4c610481 100644 --- a/src/overlays/actors/ovl_En_Bubble/z_en_bubble.c +++ b/src/overlays/actors/ovl_En_Bubble/z_en_bubble.c @@ -405,7 +405,7 @@ void EnBubble_Update(Actor* thisx, PlayState* play) { void EnBubble_Draw(Actor* thisx, PlayState* play) { EnBubble* this = (EnBubble*)thisx; - u32 pad; + PlayState* play2 = (PlayState*)play; OPEN_DISPS(play->state.gfxCtx, "../z_en_bubble.c", 1175); @@ -413,7 +413,7 @@ void EnBubble_Draw(Actor* thisx, PlayState* play) { Gfx_SetupDL_25Xlu(play->state.gfxCtx); Math_SmoothStepToF(&this->graphicRotSpeed, 16.0f, 0.2f, 1000.0f, 0.0f); Math_SmoothStepToF(&this->graphicEccentricity, 0.08f, 0.2f, 1000.0f, 0.0f); - Matrix_ReplaceRotation(&play->billboardMtxF); + Matrix_ReplaceRotation(&play2->billboardMtxF); Matrix_Scale(this->expansionWidth + 1.0f, this->expansionHeight + 1.0f, 1.0f, MTXMODE_APPLY); Matrix_RotateZ(DEG_TO_RAD((f32)play->state.frames) * this->graphicRotSpeed, MTXMODE_APPLY); diff --git a/src/overlays/actors/ovl_En_Fd/z_en_fd.c b/src/overlays/actors/ovl_En_Fd/z_en_fd.c index 86e3f7018b..53bc2e2285 100644 --- a/src/overlays/actors/ovl_En_Fd/z_en_fd.c +++ b/src/overlays/actors/ovl_En_Fd/z_en_fd.c @@ -771,7 +771,6 @@ void EnFd_Draw(Actor* thisx, PlayState* play) { EnFd_DrawEffectsFlames(this, play); Matrix_Pop(); if (this->actionFunc != EnFd_Reappear && !(this->fadeAlpha < 0.9f)) { - if (1) {} Gfx_SetupDL_25Xlu(play->state.gfxCtx); clampedHealth = CLAMP(thisx->colChkInfo.health - 1, 0, 23) / 8; gDPSetPrimColor(POLY_XLU_DISP++, 0, 128, primColors[clampedHealth].r, primColors[clampedHealth].g, @@ -788,6 +787,9 @@ void EnFd_Draw(Actor* thisx, PlayState* play) { SkelAnime_DrawFlex(play, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, EnFd_OverrideLimbDraw, EnFd_PostLimbDraw, this, POLY_XLU_DISP); } + + if (this->fadeAlpha) {} + CLOSE_DISPS(play->state.gfxCtx, "../z_en_fd.c", 1822); } diff --git a/src/overlays/actors/ovl_En_Fd_Fire/z_en_fd_fire.c b/src/overlays/actors/ovl_En_Fd_Fire/z_en_fd_fire.c index 942a8de3a0..31983c96dd 100644 --- a/src/overlays/actors/ovl_En_Fd_Fire/z_en_fd_fire.c +++ b/src/overlays/actors/ovl_En_Fd_Fire/z_en_fd_fire.c @@ -248,13 +248,11 @@ void EnFdFire_Draw(Actor* thisx, PlayState* play) { OPEN_DISPS(play->state.gfxCtx, "../z_en_fd_fire.c", 572); - Matrix_Translate(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, MTXMODE_NEW); - sp8E = Math_Vec3f_Yaw(&scale, &this->actor.velocity) - Camera_GetCamDirYaw(GET_ACTIVE_CAM(play)); + Matrix_Translate(thisx->world.pos.x, thisx->world.pos.y, thisx->world.pos.z, MTXMODE_NEW); + sp8E = Math_Vec3f_Yaw(&scale, &thisx->velocity) - Camera_GetCamDirYaw(GET_ACTIVE_CAM(play)); sp84 = fabsf(Math_CosS(sp8E)); sp88 = Math_SinS(sp8E); - sp80 = Math_Vec3f_DistXZ(&scale, &this->actor.velocity) / 1.5f; - if (1) {} - if (1) {} + sp80 = Math_Vec3f_DistXZ(&scale, &thisx->velocity) / 1.5f; Matrix_RotateY(BINANG_TO_RAD((s16)(Camera_GetCamDirYaw(GET_ACTIVE_CAM(play)) + 0x8000)), MTXMODE_APPLY); Matrix_RotateZ(DEG_TO_RAD((sp88 * -10.0f) * sp80), MTXMODE_APPLY); scale.x = scale.y = scale.z = this->scale * 0.001f; @@ -270,14 +268,12 @@ void EnFdFire_Draw(Actor* thisx, PlayState* play) { gSPSegment(POLY_XLU_DISP++, 0x8, Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 0, 0, 0x20, 0x40, 1, 0, play->state.frames * this->tile2Y, 0x20, 0x80)); - gDPSetPrimColor(POLY_XLU_DISP++, 128, 128, primColors[((this->actor.params & 0x8000) >> 0xF)].r, - primColors[((this->actor.params & 0x8000) >> 0xF)].g, - primColors[((this->actor.params & 0x8000) >> 0xF)].b, - primColors[((this->actor.params & 0x8000) >> 0xF)].a); - gDPSetEnvColor(POLY_XLU_DISP++, envColors[((this->actor.params & 0x8000) >> 0xF)].r, - envColors[((this->actor.params & 0x8000) >> 0xF)].g, - envColors[((this->actor.params & 0x8000) >> 0xF)].b, - envColors[((this->actor.params & 0x8000) >> 0xF)].a); + gDPSetPrimColor(POLY_XLU_DISP++, 128, 128, primColors[((thisx->params & 0x8000) >> 0xF)].r, + primColors[((thisx->params & 0x8000) >> 0xF)].g, primColors[((thisx->params & 0x8000) >> 0xF)].b, + primColors[((thisx->params & 0x8000) >> 0xF)].a); + gDPSetEnvColor(POLY_XLU_DISP++, envColors[((thisx->params & 0x8000) >> 0xF)].r, + envColors[((thisx->params & 0x8000) >> 0xF)].g, envColors[((thisx->params & 0x8000) >> 0xF)].b, + envColors[((thisx->params & 0x8000) >> 0xF)].a); gDPPipeSync(POLY_XLU_DISP++); gSPDisplayList(POLY_XLU_DISP++, gEffFire1DL); diff --git a/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.c b/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.c index 594ed758af..4aeda80522 100644 --- a/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.c +++ b/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.c @@ -454,15 +454,13 @@ void EnGSwitch_Update(Actor* thisx, PlayState* play) { } void EnGSwitch_DrawPot(Actor* thisx, PlayState* play) { - s32 pad; + PlayState* play2 = (PlayState*)play; EnGSwitch* this = (EnGSwitch*)thisx; if (!this->broken) { OPEN_DISPS(play->state.gfxCtx, "../z_en_g_switch.c", 918); - if (1) {} - - Gfx_SetupDL_25Opa(play->state.gfxCtx); + Gfx_SetupDL_25Opa(play2->state.gfxCtx); gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_g_switch.c", 925), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_OPA_DISP++, object_tsubo_DL_0017C0); @@ -475,10 +473,9 @@ static void* sRupeeTextures[] = { }; void EnGSwitch_DrawRupee(Actor* thisx, PlayState* play) { - s32 pad; + PlayState* play2 = (PlayState*)play; EnGSwitch* this = (EnGSwitch*)thisx; - if (1) {} if (!this->broken) { OPEN_DISPS(play->state.gfxCtx, "../z_en_g_switch.c", 951); Gfx_SetupDL_25Opa(play->state.gfxCtx); @@ -490,7 +487,7 @@ void EnGSwitch_DrawRupee(Actor* thisx, PlayState* play) { CLOSE_DISPS(play->state.gfxCtx, "../z_en_g_switch.c", 961); } if (this->type == ENGSWITCH_TARGET_RUPEE) { - EnGSwitch_DrawEffects(this, play); + EnGSwitch_DrawEffects(this, play2); } } diff --git a/src/overlays/actors/ovl_En_Goma/z_en_goma.c b/src/overlays/actors/ovl_En_Goma/z_en_goma.c index 50dbe53d5f..ad518535b4 100644 --- a/src/overlays/actors/ovl_En_Goma/z_en_goma.c +++ b/src/overlays/actors/ovl_En_Goma/z_en_goma.c @@ -756,6 +756,7 @@ s32 EnGoma_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* 255); if (limbIndex == GOMA_LIMB_EYE_IRIS_ROOT1) { + if (1) {} rot->x += this->eyePitch; rot->y += this->eyeYaw; } else if (limbIndex == GOMA_LIMB_BODY && this->hurtTimer != 0) { diff --git a/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c b/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c index 17fc773e97..a7de8c83dc 100644 --- a/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c +++ b/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c @@ -1340,13 +1340,13 @@ void EnPoSisters_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s void EnPoSisters_Draw(Actor* thisx, PlayState* play) { EnPoSisters* this = (EnPoSisters*)thisx; - u8 phi_s5; + s32 pad1; f32 phi_f20; s32 i; - u8 spE7; + u8 phi_s5; Color_RGBA8* temp_s1 = &D_80ADD700[this->unk_194]; Color_RGBA8* temp_s7 = &D_80ADD6F0[this->unk_194]; - s32 pad; + s32 pad2; OPEN_DISPS(play->state.gfxCtx, "../z_en_po_sisters.c", 2989); func_80ADC55C(this); @@ -1390,11 +1390,10 @@ void EnPoSisters_Draw(Actor* thisx, PlayState* play) { phi_s5 = ((32 - this->unk_19A) * 255) / 32; phi_f20 = 0.0035f; } else if (this->actionFunc == func_80ADBC88) { - //! @bug uninitialised spE7 - phi_s5 = spE7; + // phi_s5 initialized in loop below phi_f20 = 0.0027f; } else { - phi_s5 = spE7; + // phi_s5 initialized in loop below phi_f20 = this->actor.scale.x * 0.5f; } for (i = 0; i < this->unk_198; i++) { diff --git a/src/overlays/actors/ovl_En_Zo/z_en_zo.c b/src/overlays/actors/ovl_En_Zo/z_en_zo.c index 69b577f064..ef37860e2a 100644 --- a/src/overlays/actors/ovl_En_Zo/z_en_zo.c +++ b/src/overlays/actors/ovl_En_Zo/z_en_zo.c @@ -172,7 +172,7 @@ void EnZo_UpdateEffectsSplashes(EnZo* this) { void EnZo_DrawEffectsRipples(EnZo* this, PlayState* play) { EnZoEffect* effect; s16 i; - u8 materialFlag; + s16 materialFlag; effect = this->effects; OPEN_DISPS(play->state.gfxCtx, "../z_en_zo_eff.c", 217); diff --git a/src/overlays/actors/ovl_Magic_Dark/z_magic_dark.c b/src/overlays/actors/ovl_Magic_Dark/z_magic_dark.c index d1605484c0..cab83bbb76 100644 --- a/src/overlays/actors/ovl_Magic_Dark/z_magic_dark.c +++ b/src/overlays/actors/ovl_Magic_Dark/z_magic_dark.c @@ -240,10 +240,10 @@ void MagicDark_DiamondDraw(Actor* thisx, PlayState* play) { } void MagicDark_OrbDraw(Actor* thisx, PlayState* play) { - MagicDark* this = (MagicDark*)thisx; + PlayState* play2 = (PlayState*)play; Vec3f pos; - Player* player = GET_PLAYER(play); - s32 pad; + Player* player = GET_PLAYER(play2); + MagicDark* this = (MagicDark*)thisx; f32 sp6C = play->state.frames & 0x1F; if (this->timer < 32) { @@ -263,11 +263,11 @@ void MagicDark_OrbDraw(Actor* thisx, PlayState* play) { return; } - pos.x -= (this->actor.scale.x * 300.0f * Math_SinS(Camera_GetCamDirYaw(GET_ACTIVE_CAM(play))) * - Math_CosS(Camera_GetCamDirPitch(GET_ACTIVE_CAM(play)))); - pos.y -= (this->actor.scale.x * 300.0f * Math_SinS(Camera_GetCamDirPitch(GET_ACTIVE_CAM(play)))); - pos.z -= (this->actor.scale.x * 300.0f * Math_CosS(Camera_GetCamDirYaw(GET_ACTIVE_CAM(play))) * - Math_CosS(Camera_GetCamDirPitch(GET_ACTIVE_CAM(play)))); + pos.x -= (this->actor.scale.x * 300.0f * Math_SinS(Camera_GetCamDirYaw(GET_ACTIVE_CAM(play2))) * + Math_CosS(Camera_GetCamDirPitch(GET_ACTIVE_CAM(play2)))); + pos.y -= (this->actor.scale.x * 300.0f * Math_SinS(Camera_GetCamDirPitch(GET_ACTIVE_CAM(play2)))); + pos.z -= (this->actor.scale.x * 300.0f * Math_CosS(Camera_GetCamDirYaw(GET_ACTIVE_CAM(play2))) * + Math_CosS(Camera_GetCamDirPitch(GET_ACTIVE_CAM(play2)))); OPEN_DISPS(play->state.gfxCtx, "../z_magic_dark.c", 619); @@ -276,7 +276,7 @@ void MagicDark_OrbDraw(Actor* thisx, PlayState* play) { gDPSetEnvColor(POLY_XLU_DISP++, 0, 150, 255, 255); Matrix_Translate(pos.x, pos.y, pos.z, MTXMODE_NEW); Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY); - Matrix_Mult(&play->billboardMtxF, MTXMODE_APPLY); + Matrix_Mult(&play2->billboardMtxF, MTXMODE_APPLY); Matrix_Push(); gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_magic_dark.c", 632), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); diff --git a/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c b/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c index a61b6672a7..8a25bdef05 100644 --- a/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c +++ b/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c @@ -392,8 +392,8 @@ void ObjLightswitch_Update(Actor* thisx, PlayState* play2) { } } -void ObjLightswitch_DrawOpa(ObjLightswitch* this, PlayState* play) { - Actor* child; +void ObjLightswitch_DrawOpa(Actor* thisx, PlayState* play) { + ObjLightswitch* this = (ObjLightswitch*)thisx; Vec3f pos; Vec3s rot; @@ -404,18 +404,17 @@ void ObjLightswitch_DrawOpa(ObjLightswitch* this, PlayState* play) { (u8)(this->alpha >> 6)); gSPSegment(POLY_OPA_DISP++, 0x09, &D_80116280[2]); - if ((this->actor.params & 1) == 1) { - child = this->actor.child; - this->actor.world.pos.x = child->world.pos.x; - this->actor.world.pos.y = child->world.pos.y + 60.0f; - this->actor.world.pos.z = child->world.pos.z; - Math_Vec3f_Copy(&pos, &this->actor.world.pos); - Matrix_SetTranslateRotateYXZ(pos.x, pos.y, pos.z, &this->actor.shape.rot); - Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY); + if ((thisx->params & 1) == 1) { + thisx->world.pos.x = thisx->child->world.pos.x; + thisx->world.pos.y = thisx->child->world.pos.y + 60.0f; + thisx->world.pos.z = thisx->child->world.pos.z; + Math_Vec3f_Copy(&pos, &thisx->world.pos); + Matrix_SetTranslateRotateYXZ(pos.x, pos.y, pos.z, &thisx->shape.rot); + Matrix_Scale(thisx->scale.x, thisx->scale.y, thisx->scale.z, MTXMODE_APPLY); } else { - pos.x = this->actor.world.pos.x; - pos.y = this->actor.world.pos.y + this->actor.shape.yOffset * this->actor.scale.y; - pos.z = this->actor.world.pos.z; + pos.x = thisx->world.pos.x; + pos.y = thisx->world.pos.y + thisx->shape.yOffset * thisx->scale.y; + pos.z = thisx->world.pos.z; } gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_obj_lightswitch.c", 841), @@ -423,18 +422,18 @@ void ObjLightswitch_DrawOpa(ObjLightswitch* this, PlayState* play) { gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sFaceTextures[this->faceTextureIndex])); gSPDisplayList(POLY_OPA_DISP++, object_lightswitch_DL_000260); - rot.x = this->actor.shape.rot.x; - rot.y = this->actor.shape.rot.y; - rot.z = this->actor.shape.rot.z + this->flameRingRot; + rot.x = thisx->shape.rot.x; + rot.y = thisx->shape.rot.y; + rot.z = thisx->shape.rot.z + this->flameRingRot; Matrix_SetTranslateRotateYXZ(pos.x, pos.y, pos.z, &rot); - Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY); + Matrix_Scale(thisx->scale.x, thisx->scale.y, thisx->scale.z, MTXMODE_APPLY); gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_obj_lightswitch.c", 859), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_OPA_DISP++, object_lightswitch_DL_000398); - rot.z = this->actor.shape.rot.z - this->flameRingRot; + rot.z = thisx->shape.rot.z - this->flameRingRot; Matrix_SetTranslateRotateYXZ(pos.x, pos.y, pos.z, &rot); - Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY); + Matrix_Scale(thisx->scale.x, thisx->scale.y, thisx->scale.z, MTXMODE_APPLY); gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_obj_lightswitch.c", 873), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_OPA_DISP++, object_lightswitch_DL_000408); @@ -442,8 +441,8 @@ void ObjLightswitch_DrawOpa(ObjLightswitch* this, PlayState* play) { CLOSE_DISPS(play->state.gfxCtx, "../z_obj_lightswitch.c", 878); } -void ObjLightswitch_DrawXlu(ObjLightswitch* this, PlayState* play) { - s32 pad; +void ObjLightswitch_DrawXlu(Actor* thisx, PlayState* play) { + ObjLightswitch* this = (ObjLightswitch*)thisx; Vec3f sp68; Vec3s sp60; @@ -454,28 +453,28 @@ void ObjLightswitch_DrawXlu(ObjLightswitch* this, PlayState* play) { (u8)(this->alpha >> 6)); gSPSegment(POLY_XLU_DISP++, 0x09, D_80116280); - sp68.x = this->actor.world.pos.x; - sp68.y = this->actor.world.pos.y + (this->actor.shape.yOffset * this->actor.scale.y); - sp68.z = this->actor.world.pos.z; + sp68.x = thisx->world.pos.x; + sp68.y = thisx->world.pos.y + (thisx->shape.yOffset * thisx->scale.y); + sp68.z = thisx->world.pos.z; gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_obj_lightswitch.c", 912), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sFaceTextures[this->faceTextureIndex])); gSPDisplayList(POLY_XLU_DISP++, object_lightswitch_DL_000260); - sp60.x = this->actor.shape.rot.x; - sp60.y = this->actor.shape.rot.y; - sp60.z = this->actor.shape.rot.z + this->flameRingRot; + sp60.x = thisx->shape.rot.x; + sp60.y = thisx->shape.rot.y; + sp60.z = thisx->shape.rot.z + this->flameRingRot; Matrix_SetTranslateRotateYXZ(sp68.x, sp68.y, sp68.z, &sp60); - Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY); + Matrix_Scale(thisx->scale.x, thisx->scale.y, thisx->scale.z, MTXMODE_APPLY); gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_obj_lightswitch.c", 930), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, object_lightswitch_DL_000398); - sp60.z = this->actor.shape.rot.z - this->flameRingRot; + sp60.z = thisx->shape.rot.z - this->flameRingRot; Matrix_SetTranslateRotateYXZ(sp68.x, sp68.y, sp68.z, &sp60); - Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY); + Matrix_Scale(thisx->scale.x, thisx->scale.y, thisx->scale.z, MTXMODE_APPLY); gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_obj_lightswitch.c", 944), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, object_lightswitch_DL_000408); @@ -492,8 +491,8 @@ void ObjLightswitch_Draw(Actor* thisx, PlayState* play) { } if ((this->actor.params >> 4 & 3) == OBJLIGHTSWITCH_TYPE_BURN && (alpha > 0 || alpha < 255)) { - ObjLightswitch_DrawXlu(this, play); + ObjLightswitch_DrawXlu(thisx, play); } else { - ObjLightswitch_DrawOpa(this, play); + ObjLightswitch_DrawOpa(thisx, play); } } diff --git a/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c b/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c index fcaf50a340..9a43f8a7da 100644 --- a/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c +++ b/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c @@ -741,7 +741,7 @@ void ObjSwitch_Update(Actor* thisx, PlayState* play) { } } -void ObjSwitch_DrawFloor(ObjSwitch* this, PlayState* play) { +void ObjSwitch_DrawFloor(Actor* thisx, PlayState* play) { static Gfx* floorSwitchDLists[] = { gFloorSwitch1DL, // OBJSWITCH_SUBTYPE_ONCE gFloorSwitch3DL, // OBJSWITCH_SUBTYPE_TOGGLE @@ -749,14 +749,14 @@ void ObjSwitch_DrawFloor(ObjSwitch* this, PlayState* play) { gFloorSwitch2DL, // OBJSWITCH_SUBTYPE_HOLD_INVERTED }; - Gfx_DrawDListOpa(play, floorSwitchDLists[OBJSWITCH_SUBTYPE(&this->dyna.actor)]); + Gfx_DrawDListOpa(play, floorSwitchDLists[OBJSWITCH_SUBTYPE(thisx)]); } -void ObjSwitch_DrawFloorRusty(ObjSwitch* this, PlayState* play) { +void ObjSwitch_DrawFloorRusty(Actor* thisx, PlayState* play) { Gfx_DrawDListOpa(play, gRustyFloorSwitchDL); } -void ObjSwitch_DrawEye(ObjSwitch* this, PlayState* play) { +void ObjSwitch_DrawEye(Actor* thisx, PlayState* play) { static void* eyeTextures[][4] = { // OBJSWITCH_SUBTYPE_ONCE { gEyeSwitchGoldOpenTex, gEyeSwitchGoldOpeningTex, gEyeSwitchGoldClosingTex, gEyeSwitchGoldClosedTex }, @@ -767,7 +767,7 @@ void ObjSwitch_DrawEye(ObjSwitch* this, PlayState* play) { gEyeSwitch1DL, // OBJSWITCH_SUBTYPE_ONCE gEyeSwitch2DL, // OBJSWITCH_SUBTYPE_TOGGLE }; - s32 pad; + ObjSwitch* this = (ObjSwitch*)thisx; s32 subType = OBJSWITCH_SUBTYPE(&this->dyna.actor); OPEN_DISPS(play->state.gfxCtx, "../z_obj_switch.c", 1459); @@ -781,7 +781,7 @@ void ObjSwitch_DrawEye(ObjSwitch* this, PlayState* play) { CLOSE_DISPS(play->state.gfxCtx, "../z_obj_switch.c", 1471); } -void ObjSwitch_DrawCrystal(ObjSwitch* this, PlayState* play) { +void ObjSwitch_DrawCrystal(Actor* thisx, PlayState* play) { static Gfx* xluDLists[] = { gCrystalSwitchCoreXluDL, // OBJSWITCH_SUBTYPE_ONCE gCrystalSwitchDiamondXluDL, // OBJSWITCH_SUBTYPE_TOGGLE @@ -796,15 +796,13 @@ void ObjSwitch_DrawCrystal(ObjSwitch* this, PlayState* play) { NULL, // OBJSWITCH_SUBTYPE_HOLD_INVERTED gCrystalSwitchCoreOpaDL // OBJSWITCH_SUBTYPE_SYNC }; - s32 pad1; - s32 pad2; + ObjSwitch* this = (ObjSwitch*)thisx; + s32 pad; s32 subType; subType = OBJSWITCH_SUBTYPE(&this->dyna.actor); func_8002ED80(&this->dyna.actor, play, 0); - if (1) {} - OPEN_DISPS(play->state.gfxCtx, "../z_obj_switch.c", 1494); Gfx_SetupDL_25Xlu(play->state.gfxCtx); @@ -833,7 +831,7 @@ void ObjSwitch_DrawCrystal(ObjSwitch* this, PlayState* play) { CLOSE_DISPS(play->state.gfxCtx, "../z_obj_switch.c", 1533); } -static ObjSwitchActionFunc sDrawFuncs[] = { +static ObjSwitchDrawFunc sDrawFuncs[] = { ObjSwitch_DrawFloor, // OBJSWITCH_TYPE_FLOOR ObjSwitch_DrawFloorRusty, // OBJSWITCH_TYPE_FLOOR_RUSTY ObjSwitch_DrawEye, // OBJSWITCH_TYPE_EYE @@ -842,7 +840,5 @@ static ObjSwitchActionFunc sDrawFuncs[] = { }; void ObjSwitch_Draw(Actor* thisx, PlayState* play) { - ObjSwitch* this = (ObjSwitch*)thisx; - - sDrawFuncs[OBJSWITCH_TYPE(&this->dyna.actor)](this, play); + sDrawFuncs[OBJSWITCH_TYPE(thisx)](thisx, play); } diff --git a/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.h b/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.h index 8fd130f8f5..b6fb243f70 100644 --- a/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.h +++ b/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.h @@ -7,6 +7,7 @@ struct ObjSwitch; typedef void (*ObjSwitchActionFunc)(struct ObjSwitch*, PlayState*); +typedef void (*ObjSwitchDrawFunc)(Actor*, PlayState*); typedef enum ObjSwitchType { /* 0 */ OBJSWITCH_TYPE_FLOOR, diff --git a/src/overlays/effects/ovl_Effect_Ss_Ice_Smoke/z_eff_ss_ice_smoke.c b/src/overlays/effects/ovl_Effect_Ss_Ice_Smoke/z_eff_ss_ice_smoke.c index 5801220095..135d2ff43a 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Ice_Smoke/z_eff_ss_ice_smoke.c +++ b/src/overlays/effects/ovl_Effect_Ss_Ice_Smoke/z_eff_ss_ice_smoke.c @@ -51,23 +51,19 @@ u32 EffectSsIceSmoke_Init(PlayState* play, u32 index, EffectSs* this, void* init } void EffectSsIceSmoke_Draw(PlayState* play, u32 index, EffectSs* this) { - s32 pad; + PlayState* play2 = (PlayState*)play; void* objectPtr; Mtx* mtx; f32 scale; s32 objectSlot; - objectPtr = play->objectCtx.slots[this->rObjectSlot].segment; + objectPtr = play2->objectCtx.slots[this->rObjectSlot].segment; OPEN_DISPS(play->state.gfxCtx, "../z_eff_ss_ice_smoke.c", 155); -#if !OOT_DEBUG - if (1) {} -#endif + objectSlot = Object_GetSlot(&play2->objectCtx, OBJECT_FZ); - objectSlot = Object_GetSlot(&play->objectCtx, OBJECT_FZ); - - if ((objectSlot >= 0) && Object_IsLoaded(&play->objectCtx, objectSlot)) { + if ((objectSlot >= 0) && Object_IsLoaded(&play2->objectCtx, objectSlot)) { gDPPipeSync(POLY_XLU_DISP++); Gfx_SetupDL_25Xlu(play->state.gfxCtx); gSegments[6] = VIRTUAL_TO_PHYSICAL(objectPtr); @@ -79,13 +75,14 @@ void EffectSsIceSmoke_Draw(PlayState* play, u32 index, EffectSs* this) { Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, this->life * 3, this->life * 15, 32, 64, 1, 0, 0, 32, 32)); Matrix_Translate(this->pos.x, this->pos.y, this->pos.z, MTXMODE_NEW); - Matrix_ReplaceRotation(&play->billboardMtxF); + Matrix_ReplaceRotation(&play2->billboardMtxF); scale = this->rScale * 0.0001f; Matrix_Scale(scale, scale, 1.0f, MTXMODE_APPLY); mtx = MATRIX_NEW(play->state.gfxCtx, "../z_eff_ss_ice_smoke.c", 196); if (mtx != NULL) { + if (1) {} gSPMatrix(POLY_XLU_DISP++, mtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gFreezardSteamDL)); } diff --git a/src/overlays/effects/ovl_Effect_Ss_Stone1/z_eff_ss_stone1.c b/src/overlays/effects/ovl_Effect_Ss_Stone1/z_eff_ss_stone1.c index acf3c9105b..d876ab0cf1 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Stone1/z_eff_ss_stone1.c +++ b/src/overlays/effects/ovl_Effect_Ss_Stone1/z_eff_ss_stone1.c @@ -62,7 +62,6 @@ void EffectSsStone1_Draw(PlayState* play, u32 index, EffectSs* this) { scale = (mfW < 1500.0f) ? 3.0f : (mfW / 1500.0f) * 3.0f; Matrix_Translate(this->pos.x, this->pos.y, this->pos.z, MTXMODE_NEW); Matrix_Scale(scale, scale, scale, MTXMODE_APPLY); - if (1) {} gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_eff_ss_stone1.c", 168), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); Gfx_SetupDL_61Xlu(gfxCtx); diff --git a/src/overlays/gamestates/ovl_file_choose/z_file_nameset.c b/src/overlays/gamestates/ovl_file_choose/z_file_nameset.c index 7e3ec55ee8..a412b17c46 100644 --- a/src/overlays/gamestates/ovl_file_choose/z_file_nameset.c +++ b/src/overlays/gamestates/ovl_file_choose/z_file_nameset.c @@ -180,8 +180,6 @@ void FileSelect_SetNameEntryVtx(GameState* thisx) { #endif s16 phi_v0; - if (1) {} - OPEN_DISPS(this->state.gfxCtx, "../z_file_nameset_PAL.c", 205); gDPPipeSync(POLY_OPA_DISP++);