From 719ac3f748aa618342a55f29e2c8798a95376b64 Mon Sep 17 00:00:00 2001 From: LagoLunatic Date: Fri, 25 Jul 2025 22:24:57 -0400 Subject: [PATCH] Misc cleanup --- include/d/d_bg_s.h | 2 +- include/m_Do/m_Do_ext.h | 2 +- src/d/actor/d_a_bb.cpp | 58 +++++++++++++++++++----------------- src/d/actor/d_a_demo_kmm.cpp | 2 +- src/d/actor/d_a_tbox.cpp | 4 +-- src/d/d_bg_s.cpp | 4 +-- src/m_Do/m_Do_ext.cpp | 2 +- 7 files changed, 38 insertions(+), 36 deletions(-) diff --git a/include/d/d_bg_s.h b/include/d/d_bg_s.h index 74e222217..2ff487dc4 100644 --- a/include/d/d_bg_s.h +++ b/include/d/d_bg_s.h @@ -75,7 +75,7 @@ public: // void DebugDrawPoly(dBgW&) {} // void Draw() {} // void DrawPoly(cBgS_PolyInfo&, _GXColor&) {} - // void GetBgWPointer(cBgS_PolyInfo&) {} + dBgW* GetBgWPointer(cBgS_PolyInfo& i_poly) { return (dBgW*)cBgS::GetBgWPointer(i_poly); } // void GetPolyCamId(cBgS_PolyInfo&) {} // void GroundCross(cBgS_GndChk*) {} // void LineCross(cBgS_LinChk*) {} diff --git a/include/m_Do/m_Do_ext.h b/include/m_Do/m_Do_ext.h index b77f305f9..d0c3ed862 100644 --- a/include/m_Do/m_Do_ext.h +++ b/include/m_Do/m_Do_ext.h @@ -23,7 +23,7 @@ public: virtual ~mDoExt_baseAnm() {} int initPlay(s16 i_frameMax, int i_attribute, f32 i_rate, s16 i_startF, s16 i_endF, bool); - int play(); + BOOL play(); J3DFrameCtrl* getFrameCtrl() { return mFrameCtrl; } f32 getPlaySpeed() { return mFrameCtrl->getRate(); } diff --git a/src/d/actor/d_a_bb.cpp b/src/d/actor/d_a_bb.cpp index 51414df80..1ec57906b 100644 --- a/src/d/actor/d_a_bb.cpp +++ b/src/d/actor/d_a_bb.cpp @@ -20,7 +20,9 @@ #include "d/actor/d_a_mo2.h" #include "d/actor/d_a_bk.h" #include "d/actor/d_a_player.h" +#if VERSION == VERSION_DEMO #include "m_Do/m_Do_controller_pad.h" +#endif #include "d/d_bg_s_lin_chk.h" #include "d/d_cc_uty.h" #include "SSystem/SComponent/c_lib.h" @@ -1000,7 +1002,7 @@ void bb_auto_move(bb_class* i_this) { break; case 10: - case 11: + case 11: { i_this->unk_C60 = 0; fopAc_ac_c* ac = fopAcM_SearchByID(i_this->unk_330); @@ -1039,8 +1041,8 @@ void bb_auto_move(bb_class* i_this) { i_this->unk_2F1 = 0; } break; - - case 20: + } + case 20: { r29 = -1; i_this->unk_C60 = 0; @@ -1067,8 +1069,8 @@ void bb_auto_move(bb_class* i_this) { i_this->unk_318[2] = 50; } break; - - case 21: + } + case 21: { r29 = 1; fopAc_ac_c* esa = search_esa(i_this); if (esa == NULL) { @@ -1077,7 +1079,7 @@ void bb_auto_move(bb_class* i_this) { i_this->unk_2F1 = 22; } break; - + } case 22: r29 = 1; i_this->unk_300 = 0.0f; @@ -1099,7 +1101,7 @@ void bb_auto_move(bb_class* i_this) { } break; - case 23: + case 23: { r29 = 1; i_this->unk_C60 = 0; i_this->unk_300 = l_bbHIO.unk_54; @@ -1117,8 +1119,8 @@ void bb_auto_move(bb_class* i_this) { i_this->unk_2F1 = 24; } break; - - case 24: + } + case 24: { r29 = 1; i_this->unk_C50 = 0; i_this->unk_C60 = 0; @@ -1139,7 +1141,7 @@ void bb_auto_move(bb_class* i_this) { anm_init(i_this, 0x21, 5.0f, 2, 1.0f, 0x11); } break; - + } case 25: r29 = 1; i_this->unk_2F1 = 0; @@ -1243,21 +1245,21 @@ void bb_kamome_attack(bb_class* i_this) { i_this->unk_C60 = 1; switch (i_this->unk_2F0) { - case 0: + case 0: { s32 frame = i_this->mpMorf->getFrame(); if ((i_this->actor.current.pos.y > i_this->unk_2F4.y) && (frame == REG0_S(0) + 9)) { i_this->unk_2F0 = 1; anm_init(i_this, 0x19, REG0_F(0) + 12.0f, 2, 1.0f, 9); } break; - - case 1: + } + case 1: { if (i_this->actor.current.pos.y <= i_this->unk_2F4.y) { i_this->unk_2F0 = 0; anm_init(i_this, 0x18, 5.0f, 2, l_bbHIO.unk_24, 8); } break; - + } default: i_this->unk_2F0 = 0; break; @@ -1268,7 +1270,7 @@ void bb_kamome_attack(bb_class* i_this) { anm_init(i_this, 0x19, 10.0f, 2, 1.0f, 9); i_this->unk_2F1 = 1; - case 1: + case 1: { cXyz v; v.x = (REG0_F(5) + 300.0f) * cM_ssin(i_this->unk_352 * (REG0_S(5) + 400)); v.y = (REG0_F(3) + 100.0f) * cM_ssin(i_this->unk_352 * (REG0_S(5) + 300)); @@ -1278,7 +1280,7 @@ void bb_kamome_attack(bb_class* i_this) { MtxPosition(&v, &v2); i_this->unk_2F4 = v2 + player->current.pos; break; - + } default: i_this->unk_2F1 = 0; break; @@ -1488,7 +1490,7 @@ void bb_atack_move(bb_class* i_this) { } break; - case 6: + case 6: { i_this->unk_2D0 = 2; i_this->unk_C60 = 0; @@ -1539,7 +1541,7 @@ void bb_atack_move(bb_class* i_this) { } } break; - + } case 10: case 11: i_this->unk_2D0 = 2; @@ -1701,7 +1703,7 @@ void bb_wait_move(bb_class* i_this) { case 10: case 11: - case 12: + case 12: { r30 = 0; i_this->unk_C60 = 0; v.x = 0.0; @@ -1746,8 +1748,8 @@ void bb_wait_move(bb_class* i_this) { r30 = -1; } break; - - case 20: + } + case 20: { i_this->unk_57C = 1; i_this->unk_C60 = 0; s16 old_354 = i_this->unk_354; @@ -1773,7 +1775,7 @@ void bb_wait_move(bb_class* i_this) { } } break; - + } } switch (r30) { @@ -1862,7 +1864,7 @@ void bb_su_wait_move(bb_class* i_this) { case 10: case 11: - case 12: + case 12: { r30 = 0; i_this->unk_C60 = 0; v.x = 0.0; @@ -1907,8 +1909,8 @@ void bb_su_wait_move(bb_class* i_this) { r30 = -1; } break; - - case 20: + } + case 20: { i_this->unk_57C = 1; i_this->unk_C60 = 0; s16 old_354 = i_this->unk_354; @@ -1935,7 +1937,7 @@ void bb_su_wait_move(bb_class* i_this) { } } break; - + } } switch (r30) { @@ -1957,7 +1959,7 @@ void bb_key_move(bb_class* i_this) { f32 stickY = g_mDoCPd_cpadInfo[0].mMainStickPosY; switch (i_this->unk_2F0) { - case 0: + case 0: { s32 frame = i_this->mpMorf->getFrame(); i_this->unk_300 = 30.0f; i_this->unk_304 = 0.5f; @@ -1967,7 +1969,7 @@ void bb_key_move(bb_class* i_this) { anm_init(i_this, 25, REG0_F(0) + 12.0f, 2, 1.0f, 9); } break; - + } case 1: if (CPad_CHECK_HOLD_X(0)) { i_this->unk_300 = 5.0f; diff --git a/src/d/actor/d_a_demo_kmm.cpp b/src/d/actor/d_a_demo_kmm.cpp index 0407d21ff..4a7d9f0ee 100644 --- a/src/d/actor/d_a_demo_kmm.cpp +++ b/src/d/actor/d_a_demo_kmm.cpp @@ -11,7 +11,7 @@ #include "m_Do/m_Do_ext.h" #include "d/res/res_demo_kmm.h" -static const char daDemo_Kmm_c::M_arcname[] = "Demo_Kmm"; +const char daDemo_Kmm_c::M_arcname[] = "Demo_Kmm"; /* 00000078-00000098 .text CheckCreateHeap__FP10fopAc_ac_c */ static BOOL CheckCreateHeap(fopAc_ac_c* a_this) { diff --git a/src/d/actor/d_a_tbox.cpp b/src/d/actor/d_a_tbox.cpp index c093faff2..353c20605 100644 --- a/src/d/actor/d_a_tbox.cpp +++ b/src/d/actor/d_a_tbox.cpp @@ -825,7 +825,7 @@ s32 daTbox_c::demoProc() { dComIfGp_evmng_cutEnd(mStaffId); } else { - if (mOpenAnm.play() != 0) { + if (mOpenAnm.play()) { mHasOpenAnmFinished = true; dComIfGp_evmng_cutEnd(mStaffId); fopAcM_seStart(this, JA_SE_OBJ_TBOX_OPEN_S2, 0); @@ -837,7 +837,7 @@ s32 daTbox_c::demoProc() { dComIfGp_evmng_cutEnd(mStaffId); } else { - if (mOpenAnm.play() != 0) { + if (mOpenAnm.play()) { mHasOpenAnmFinished = 1; dComIfGp_evmng_cutEnd(mStaffId); fopAcM_seStart(this, JA_SE_OBJ_TBOX_OPEN_S2, 0); diff --git a/src/d/d_bg_s.cpp b/src/d/d_bg_s.cpp index e2907ed3e..e22631af6 100644 --- a/src/d/d_bg_s.cpp +++ b/src/d/d_bg_s.cpp @@ -64,7 +64,7 @@ bool dBgS::Regist(cBgW* bgw, fopAc_ac_c* ac) { /* 800A03C4-800A0420 .text ChkMoveBG__4dBgSFR13cBgS_PolyInfo */ bool dBgS::ChkMoveBG(cBgS_PolyInfo& polyInfo) { - dBgW* bgwp = (dBgW*)dComIfG_Bgsp()->GetBgWPointer(polyInfo); + dBgW* bgwp = dComIfG_Bgsp()->GetBgWPointer(polyInfo); if (bgwp != NULL) { if (bgwp->ChkLock()) return false; @@ -76,7 +76,7 @@ bool dBgS::ChkMoveBG(cBgS_PolyInfo& polyInfo) { /* 800A0420-800A046C .text ChkMoveBG_NoDABg__4dBgSFR13cBgS_PolyInfo */ bool dBgS::ChkMoveBG_NoDABg(cBgS_PolyInfo& polyInfo) { - dBgW* bgwp = (dBgW*)dComIfG_Bgsp()->GetBgWPointer(polyInfo); + dBgW* bgwp = dComIfG_Bgsp()->GetBgWPointer(polyInfo); if (bgwp != NULL) { if (bgwp->ChkMoveBg()) return true; diff --git a/src/m_Do/m_Do_ext.cpp b/src/m_Do/m_Do_ext.cpp index 8d28865c3..89b1818ad 100644 --- a/src/m_Do/m_Do_ext.cpp +++ b/src/m_Do/m_Do_ext.cpp @@ -110,7 +110,7 @@ int mDoExt_baseAnm::initPlay(s16 i_frameMax, int i_attribute, f32 i_rate, s16 i_ } /* 8000DF24-8000DFC4 .text play__14mDoExt_baseAnmFv */ -int mDoExt_baseAnm::play() { +BOOL mDoExt_baseAnm::play() { JUT_ASSERT(462, mFrameCtrl != NULL); mFrameCtrl->update(); return isStop();