From 065f5170214a431f1ca4ff9f3b7f34c3807095ad Mon Sep 17 00:00:00 2001 From: LagoLunatic Date: Mon, 15 Sep 2025 11:14:19 -0400 Subject: [PATCH] Make m_Do_ext fields private, more bmd cleanup --- include/d/actor/d_a_npc_fa1.h | 2 +- include/d/d_s_play.h | 10 +- include/m_Do/m_Do_ext.h | 17 ++- src/d/actor/d_a_bmd.cpp | 208 +++++++++++++++++----------------- src/d/actor/d_a_bmdhand.cpp | 2 +- src/d/actor/d_a_boko.cpp | 2 +- src/d/actor/d_a_bst.cpp | 2 +- src/d/actor/d_a_btd.cpp | 12 +- src/d/actor/d_a_cc.cpp | 6 +- src/d/actor/d_a_demo_dk.cpp | 2 +- src/d/actor/d_a_dr2.cpp | 4 +- src/d/actor/d_a_fganon.cpp | 14 +-- src/d/actor/d_a_himo2.cpp | 12 +- src/d/actor/d_a_jbo.cpp | 4 +- src/d/actor/d_a_kn.cpp | 2 +- src/d/actor/d_a_mflft.cpp | 21 ++-- src/d/actor/d_a_npc_fa1.cpp | 30 ++--- src/d/actor/d_a_npc_km1.cpp | 4 +- src/d/actor/d_a_npc_os.cpp | 2 +- src/d/actor/d_a_obj_ikada.cpp | 14 +-- src/d/actor/d_a_ship.cpp | 4 +- src/d/actor/d_a_ssk.cpp | 4 +- src/d/d_attention.cpp | 4 +- 23 files changed, 200 insertions(+), 182 deletions(-) diff --git a/include/d/actor/d_a_npc_fa1.h b/include/d/actor/d_a_npc_fa1.h index be44fd03e..c1fa89a58 100644 --- a/include/d/actor/d_a_npc_fa1.h +++ b/include/d/actor/d_a_npc_fa1.h @@ -155,7 +155,7 @@ public: typedef void(daNpc_Fa1_c::*BottleBabaSubFunc_t)(); /* 0x6C4 */ u8 m6C4[0x6CC - 0x6C4]; - /* 0x6CC */ mDoExt_McaMorf* mpDoExt_McaMorf; + /* 0x6CC */ mDoExt_McaMorf* mpMorf; /* 0x6D0 */ daNpc_Fa1_McaMorfCallBack1_c mMcaMorfCallback1; /* 0x6D8 */ dPa_followEcallBack mSparklePtclCallback; /* 0x6EC */ JPABaseEmitter* mpEmitter; diff --git a/include/d/d_s_play.h b/include/d/d_s_play.h index 55346d992..b151c5023 100644 --- a/include/d/d_s_play.h +++ b/include/d/d_s_play.h @@ -164,9 +164,17 @@ extern dScnPly_reg_HIO_c g_regHIO; extern dScnPly_env_HIO_c g_envHIO; extern dScnPly_msg_HIO_c g_msgDHIO; -// Based on Twilight Princess debug, each g_envHIO child here was likely named after a specific developer. +// Based on Twilight Princess debug, each g_regHIO child here was likely named after a specific developer. // However, the developer name for each child isn't known here, so the below macro names are all unofficial. +/** + * === Register Usage === + * Short Reg(00-09) ... -32768 - +32768 + * Float Reg(00-19) ... -100000.0 - +100000.0 + * Float Reg(20-24) ... 0.0 - 1.0 + * Float Reg(25-29) ... -1.0 - +1.0 + */ + #define REG0_F(i) g_regHIO.mChild[0].mFloatRegs[i] #define REG0_S(i) g_regHIO.mChild[0].mShortRegs[i] diff --git a/include/m_Do/m_Do_ext.h b/include/m_Do/m_Do_ext.h index 11c79798a..a0659fad2 100644 --- a/include/m_Do/m_Do_ext.h +++ b/include/m_Do/m_Do_ext.h @@ -370,6 +370,7 @@ public: BOOL isLoop() { return mFrameCtrl.checkState(J3DFrameCtrl::STATE_LOOP_E); } BOOL isMorf() { return mCurMorf < 1.0f; } +private: /* 0x50 */ J3DModel* mpModel; /* 0x54 */ J3DAnmTransform* mpAnm; /* 0x58 */ J3DFrameCtrl mFrameCtrl; @@ -424,6 +425,7 @@ public: mAnmRate = rate; } +private: /* 0x50 */ J3DModel* mpModel; /* 0x54 */ J3DAnmTransform* mpAnm1; /* 0x58 */ J3DAnmTransform* mpAnm2; @@ -445,7 +447,9 @@ public: virtual void setMaterial() = 0; virtual void draw() = 0; -public: +protected: + friend class mDoExt_3DlineMatSortPacket; + /* 0x0 */ /* vtable */ /* 0x4 */ mDoExt_3DlineMat_c* mpNextLineMat; }; @@ -528,6 +532,7 @@ public: mJntNum = i_jntNum; } +private: /* 0x10 */ J3DModel* mModel; /* 0x14 */ u16 mJntNum; }; @@ -542,6 +547,7 @@ public: void updateDL(J3DModel*); void updateDL(mDoExt_McaMorf*); +private: J3DModel* mModel; mDoExt_invJntPacket* mpPackets; }; @@ -583,7 +589,10 @@ public: BOOL init(u16 numSegments, BOOL hasSize, BOOL hasTex); -public: +private: + friend class mDoExt_3DlineMat0_c; + friend class mDoExt_3DlineMat1_c; + /* 0x00 */ cXyz* mpSegments; /* 0x04 */ u8* mpSize; /* 0x08 */ cXyz* mPosArr[2]; @@ -604,7 +613,7 @@ public: cXyz* getPos(int i_idx) { return mpLines[i_idx].mpSegments; } u8* getSize(int i_idx) { return mpLines[i_idx].mpSize; } -public: +private: /* 0x08 */ GXColor mColor; /* 0x0C */ dKy_tevstr_c* mpTevStr; /* 0x10 */ u16 mNumLines; @@ -628,7 +637,7 @@ public: cXyz* getPos(int i_idx) { return mpLines[i_idx].mpSegments; } u8* getSize(int i_idx) { return mpLines[i_idx].mpSize; } -public: +private: /* 0x08 */ GXTexObj mTexObj; /* 0x28 */ GXColor mColor; /* 0x2C */ dKy_tevstr_c* mpTevStr; diff --git a/src/d/actor/d_a_bmd.cpp b/src/d/actor/d_a_bmd.cpp index e73fad159..a1ec880bc 100644 --- a/src/d/actor/d_a_bmd.cpp +++ b/src/d/actor/d_a_bmd.cpp @@ -188,12 +188,11 @@ void damage(bmd_class* i_this) { } break; case 2: - if (((s16)(REG0_S(1) + 10) == (s16)i_this->mpMorf->mFrameCtrl.getFrame()) && (fopAcM_searchPlayerDistance(actor) < (REG0_F(8) + 400.0f))) { + if (((s16)(REG0_S(1) + 10) == (s16)i_this->mpMorf->getFrame()) && (fopAcM_searchPlayerDistance(actor) < (REG0_F(8) + 400.0f))) { i_this->m904 = REG0_S(2) + 0x14; i_this->m314 = 0x1e; } - iVar7 = i_this->mpMorf->mFrameCtrl.getFrame(); - if ((s16)iVar7 == 30) { + if ((s16)i_this->mpMorf->getFrame() == 30) { for (s32 i = 0; i < (s32)ARRAY_SIZE(jno); i++) { pJVar4 = dComIfGp_particle_setToon(dPa_name::ID_SCENE_A0F4, &actor->current.pos, NULL, NULL, 0xB9, &i_this->mA90[i], fopAcM_GetRoomNo(actor)); if (pJVar4 != NULL) { @@ -201,8 +200,7 @@ void damage(bmd_class* i_this) { } } } - iVar7 = i_this->mpMorf->mFrameCtrl.getFrame(); - if ((s16)iVar7 == 10) { + if ((s16)i_this->mpMorf->getFrame() == 10) { i_this->mBD8 = 2000.0f; } if (i_this->mpMorf->isStop()) { @@ -211,8 +209,7 @@ void damage(bmd_class* i_this) { i_this->m308[0] = l_HIO.m14; i_this->m940 = 0; } - iVar7 = i_this->mpMorf->mFrameCtrl.getFrame(); - if ((s16)iVar7 > 25) { + if ((s16)i_this->mpMorf->getFrame() > 25) { cLib_addCalc2(&i_this->mBDC, 1.0f, 1.0f, 0.1f); } break; @@ -227,12 +224,10 @@ void damage(bmd_class* i_this) { cLib_addCalc2(&i_this->mBDC, 1.0f, 1.0f, 0.1f); break; case 4: - iVar7 = i_this->mpMorf->mFrameCtrl.getFrame(); - if ((s16)iVar7 == 23) { + if ((s16)i_this->mpMorf->getFrame() == 23) { mDoAud_seStart(JA_SE_CM_BKM_BODY_CLOSE, &actor->eyePos, 0, dComIfGp_getReverb(fopAcM_GetRoomNo(actor))); } - iVar7 = i_this->mpMorf->mFrameCtrl.getFrame(); - if ((s16)iVar7 == 27) { + if ((s16)i_this->mpMorf->getFrame() == 27) { dComIfGp_particle_set(dPa_name::ID_SCENE_8100, &actor->current.pos); if (dComIfGp_getStartStageName()[0] == 'X') { mDoAud_bgmStart(JA_BGM_PAST_BKM); @@ -240,14 +235,14 @@ void damage(bmd_class* i_this) { mDoAud_bgmStart(JA_BGM_KINDAN_BOSS); } } - iVar7 = i_this->mpMorf->mFrameCtrl.getFrame(); + iVar7 = i_this->mpMorf->getFrame(); if ((s16)iVar7 <= 15) { cLib_addCalc2(&i_this->mBDC, 1.0f, 1.0f, 0.1f); } - if ((s16)i_this->mpMorf->mFrameCtrl.getFrame() == 15) { + if ((s16)i_this->mpMorf->getFrame() == 15) { i_this->mBD8 = 2000.0f; } - iVar7 = i_this->mpMorf->mFrameCtrl.getFrame(); + iVar7 = i_this->mpMorf->getFrame(); if ((s16)iVar7 < (s16)(REG0_S(5) + 0x14)) { sVar3 = REG0_S(3) + 200; i_this->m942 = 0; @@ -521,7 +516,6 @@ void start(bmd_class* i_this) { /* 00001B48-00001EFC .text end__FP9bmd_class */ void end(bmd_class* i_this) { - /* Nonmatching - switch case */ fopAc_ac_c* actor = &i_this->actor; JPABaseEmitter* pJVar3; static s32 jno[] = {0x19, 0x22, 0x2B, 0x34, 0x3D}; @@ -531,9 +525,6 @@ void end(bmd_class* i_this) { i_this->m304 = 1; switch (i_this->m302) { case 0: - return; - break; - case 1: if (dComIfGp_getStartStageName()[0] == 'X') { dLib_setNextStageBySclsNum(0, actor->current.roomNo); mDoAud_seStart(JA_SE_LK_B_BOSS_WARP, NULL, 0, dComIfGp_getReverb(fopAcM_GetRoomNo(actor))); @@ -548,38 +539,41 @@ void end(bmd_class* i_this) { i_this->m302 = 1; i_this->m332 = 8; i_this->m314 = 30000; - break; - } - if (i_this->mB76 < 0x1a4) { - i_this->mBDC = 1.0; - } - if (i_this->mB76 == REG0_S(2) + 300) { - player->changeDemoMode(daPy_demo_c::DEMO_UNK_029_e); - } - if (i_this->mB76 == REG0_S(4) + 0x17c) { - anm_init(i_this, BMD_BCK_HANA_DEAD2, 10.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, -1); - mDoAud_seStart(JA_SE_CM_BKM_END_FLW_WAVING, &actor->current.pos, 0, dComIfGp_getReverb(fopAcM_GetRoomNo(actor))); - } - if (i_this->mB76 == REG0_S(5) + 0x1c2) { - anm_init(i_this, BMD_BCK_HANA_DEAD3, 10.0f, J3DFrameCtrl::EMode_NONE, 1.0f, -1); - mDoAud_seStart(JA_SE_CM_BKM_END_FLW_LIFTUP, &actor->current.pos, 0, dComIfGp_getReverb(fopAcM_GetRoomNo(actor))); - i_this->mBD8 = 2000.0f; - i_this->m332 = 9; - for (s32 i = 0; i < (s32)ARRAY_SIZE(jno); i++) { - pJVar3 = dComIfGp_particle_set(dPa_name::ID_SCENE_80FF, &actor->current.pos); - if (pJVar3 != NULL) { - pJVar3->setGlobalRTMatrix(i_this->mpMorf->getModel()->getAnmMtx(jno[i])); + // Fall-through + case 1: + if (i_this->mB76 < 0x1a4) { + i_this->mBDC = 1.0; + } + if (i_this->mB76 == REG0_S(2) + 300) { + player->changeDemoMode(daPy_demo_c::DEMO_UNK_029_e); + } + if (i_this->mB76 == REG0_S(4) + 0x17c) { + anm_init(i_this, BMD_BCK_HANA_DEAD2, 10.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, -1); + mDoAud_seStart(JA_SE_CM_BKM_END_FLW_WAVING, &actor->current.pos, 0, dComIfGp_getReverb(fopAcM_GetRoomNo(actor))); + } + if (i_this->mB76 == REG0_S(5) + 0x1c2) { + anm_init(i_this, BMD_BCK_HANA_DEAD3, 10.0f, J3DFrameCtrl::EMode_NONE, 1.0f, -1); + mDoAud_seStart(JA_SE_CM_BKM_END_FLW_LIFTUP, &actor->current.pos, 0, dComIfGp_getReverb(fopAcM_GetRoomNo(actor))); + i_this->mBD8 = 2000.0f; + i_this->m332 = 9; + for (s32 i = 0; i < (s32)ARRAY_SIZE(jno); i++) { + pJVar3 = dComIfGp_particle_set(dPa_name::ID_SCENE_80FF, &actor->current.pos); + if (pJVar3 != NULL) { + pJVar3->setGlobalRTMatrix(i_this->mpMorf->getModel()->getAnmMtx(jno[i])); + } } } - } - if (i_this->mB76 == 0x230) { - mDoAud_seStart(JA_SE_CM_BKM_END_FLW_DIE, &actor->current.pos, 0, dComIfGp_getReverb(fopAcM_GetRoomNo(actor))); - } - if (i_this->mB76 == REG0_S(6) + 0x276) { - g_dComIfG_gameInfo.save.getMemory().getBit().onStageBossEnemy(); - fopAcM_createWarpFlower(&actor->current.pos, 0, fopAcM_GetRoomNo(actor), 0); - i_this->m302 = 2; - i_this->mB71 = 0; + if (i_this->mB76 == 0x230) { + mDoAud_seStart(JA_SE_CM_BKM_END_FLW_DIE, &actor->current.pos, 0, dComIfGp_getReverb(fopAcM_GetRoomNo(actor))); + } + if (i_this->mB76 == REG0_S(6) + 0x276) { + g_dComIfG_gameInfo.save.getMemory().getBit().onStageBossEnemy(); + fopAcM_createWarpFlower(&actor->current.pos, 0, fopAcM_GetRoomNo(actor), 0); + i_this->m302 = 2; + i_this->mB71 = 0; + } + case 2: + break; } } @@ -700,7 +694,7 @@ void core_move(bmd_class* i_this) { } break; case 102: - iVar1 = i_this->m2C4->mFrameCtrl.getFrame(); + iVar1 = i_this->m2C4->getFrame(); if (iVar1 == 14) { bVar5 = true; fopAcM_monsSeStart(actor, JA_SE_CV_BKM_JITABATA, 0); @@ -715,7 +709,7 @@ void core_move(bmd_class* i_this) { } break; case 103: - iVar1 = i_this->m2C4->mFrameCtrl.getFrame(); + iVar1 = i_this->m2C4->getFrame(); if (iVar1 == 18) { bVar5 = true; fopAcM_monsSeStart(actor, JA_SE_CV_BKM_JITABATA, 0); @@ -727,8 +721,7 @@ void core_move(bmd_class* i_this) { } break; case 104: - iVar1 = i_this->m2C4->mFrameCtrl.getFrame(); - if ((iVar1 == 17) || (iVar1 == 37)) { + if ((int)i_this->m2C4->getFrame() == 17 || (int)i_this->m2C4->getFrame() == 37) { bVar5 = true; fopAcM_monsSeStart(actor, JA_SE_CV_BKM_JITABATA, 0); } @@ -741,8 +734,7 @@ void core_move(bmd_class* i_this) { } break; case 105: - iVar1 = i_this->m2C4->mFrameCtrl.getFrame(); - if (iVar1 == 37) { + if ((s16)i_this->m2C4->getFrame() == 37) { pJVar7 = dComIfGp_particle_set(dPa_name::ID_SCENE_80FE, &actor->current.pos); if (pJVar7 != NULL) { pJVar7->setGlobalRTMatrix(i_this->m2C4->getModel()->getAnmMtx(5)); @@ -751,7 +743,7 @@ void core_move(bmd_class* i_this) { } if (i_this->m2C4->isStop()) { local_58 = i_this->m924; - local_58.z += REG0_F(2) + 80.0f; + local_58.y += REG0_F(2) + 80.0f; fopAcM_createDisappear(actor, &local_58, 0xF, daDisItem_HEART_CONTAINER_e, 0xFF); i_this->m306 = 0x6e; i_this->m308[2] = 0xaa; @@ -895,8 +887,7 @@ void mk_move(bmd_class* i_this) { case 9: break; case 10: - iVar1 = i_this->m2C8->mFrameCtrl.getFrame(); - if (iVar1 == 6) { + if ((int)i_this->m2C8->getFrame() == 6) { local_28 = i_this->m2E0; local_28.y += 10.0f; pJVar3 = dComIfGp_particle_setToon(dPa_name::ID_SCENE_A0FD, &local_28, NULL, NULL, 0xB9, &i_this->mA90[6], (u8)actor->current.roomNo); @@ -1159,55 +1150,57 @@ void demo_camera(bmd_class* i_this) { /* Nonmatching - switch case, regalloc */ fopAc_ac_c* actor = &i_this->actor; s16 sVar2; - camera_class* pcVar4; int iVar6; - camera_class* pcVar11; cXyz local_44; cXyz local_50; cXyz local_a4; cXyz local_b0; - + + fopAc_ac_c* player_actor = dComIfGp_getPlayer(0); daPy_py_c* player = (daPy_py_c*)dComIfGp_getPlayer(0); - pcVar11 = dComIfGp_getCamera(0); + camera_class* camera = dComIfGp_getCamera(dComIfGp_getPlayerCameraID(0)); switch (i_this->mB74) { - case 1: + case 0: + break; + case 1: { if (!actor->eventInfo.checkCommandDemoAccrpt()) { fopAcM_orderPotentialEvent(actor, dEvtFlag_STAFF_ALL_e, 0xFFFF, 0); actor->eventInfo.onCondition(dEvtCnd_UNK2_e); i_this->mB76 = 0; i_this->mB78 = 0; - return; + break; } - i_this->mB74 = 2; - pcVar4 = dComIfGp_getCamera(0); - i_this->mB7C = pcVar4->mLookat.mEye; - i_this->mB88 = pcVar4->mLookat.mCenter; - local_44 = player->current.pos - i_this->mB7C; + i_this->mB74++; + camera_class* camera2 = dComIfGp_getCamera(0); + i_this->mB7C = camera2->mLookat.mEye; + i_this->mB88 = camera2->mLookat.mCenter; + local_44 = player_actor->current.pos - i_this->mB7C; i_this->mB96 = cM_atan2s(local_44.x, local_44.z); - pcVar4->mCamera.Stop(); - pcVar4->mCamera.SetTrimSize(2); + camera->mCamera.Stop(); + camera->mCamera.SetTrimSize(2); i_this->mB9C = 55.0f; player->changeOriginalDemo(); // fallthrough - case 3: + } + case 2: cMtx_YrotS(*calc_mtx, (int)i_this->mB96); if ((int)i_this->mB78 < REG0_S(0) + 0x55) { cLib_addCalc2(&i_this->mB88.x, actor->current.pos.x, 0.1f, 200.0f); - cLib_addCalc2(&i_this->mB88.y, player->current.pos.y + 300.0f + REG0_F(5), 0.2f, 200.0f); + cLib_addCalc2(&i_this->mB88.y, player_actor->current.pos.y + 300.0f + REG0_F(5), 0.2f, 200.0f); cLib_addCalc2(&i_this->mB88.z, actor->current.pos.z, 0.2f, 200.0f); local_44.x = 0.0f; local_44.y = REG0_F(7) + 100.0f; local_44.z = REG0_F(6) - 1100.0f; MtxPosition(&local_44, &local_50); cLib_addCalc2(&i_this->mB7C.x, actor->current.pos.x + local_50.x, 0.1f, 200.0f); - cLib_addCalc2(&i_this->mB7C.y, player->current.pos.y + local_50.y, 0.1f, 200.0f); + cLib_addCalc2(&i_this->mB7C.y, player_actor->current.pos.y + local_50.y, 0.1f, 200.0f); cLib_addCalc2(&i_this->mB7C.z, actor->current.pos.z + local_50.z, 0.1f, 200.0f); } else if ((int)i_this->mB78 < REG0_S(1) + 100) { cLib_addCalc2(&i_this->mB88.y, actor->current.pos.y + 1200.0f + REG0_F(5), 0.2f, REG0_F(6) + 100.0f); } else { - cLib_addCalc2(&i_this->mB88.x, player->current.pos.x, 0.3f, 300.0f); - cLib_addCalc2(&i_this->mB88.y, player->current.pos.y + 70.0f + REG0_F(5), 0.3f, 300.0f); - cLib_addCalc2(&i_this->mB88.z, player->current.pos.z, 0.3f, 300.0f); + cLib_addCalc2(&i_this->mB88.x, player_actor->current.pos.x, 0.3f, 300.0f); + cLib_addCalc2(&i_this->mB88.y, player_actor->current.pos.y + 70.0f + REG0_F(5), 0.3f, 300.0f); + cLib_addCalc2(&i_this->mB88.z, player_actor->current.pos.z, 0.3f, 300.0f); } break; case 5: @@ -1216,14 +1209,15 @@ void demo_camera(bmd_class* i_this) { actor->eventInfo.onCondition(dEvtCnd_UNK2_e); i_this->mB76 = 0; i_this->mB78 = 0; + break; } - break; - case 7: - i_this->mB74++; - pcVar4->mCamera.Stop(); - pcVar4->mCamera.SetTrimSize(2); + i_this->mB74 = i_this->mB74 + 1; + camera->mCamera.Stop(); + camera->mCamera.SetTrimSize(2); i_this->mB9C = 60.0f; player->changeOriginalDemo(); + // Fall-through + case 6: i_this->mB7C.x = 74.0f; i_this->mB7C.y = 283.0f; i_this->mB7C.z = 745.0f; @@ -1240,7 +1234,7 @@ void demo_camera(bmd_class* i_this) { i_this->m2DC = 3; } break; - case 8: + case 7: i_this->mB7C.x = -47.0f; i_this->mB7C.y = 115.0f; i_this->mB7C.z = 263.0f; @@ -1252,7 +1246,7 @@ void demo_camera(bmd_class* i_this) { i_this->mB74++; } break; - case 0xA: + case 8: i_this->mB7C.x = 2.0f; i_this->mB7C.y = 75.0f; i_this->mB7C.z = 403.0f; @@ -1274,6 +1268,7 @@ void demo_camera(bmd_class* i_this) { i_this->mB88 = actor->eyePos; i_this->mB88.y += REG0_F(11) + 30.0f; i_this->m2DC = 4; + case 9: cLib_addCalc2(&i_this->mB88.y, actor->eyePos.y + 30.0f, 0.2f, REG0_F(4) + 5.0f); if (i_this->mB78 == 0x1e) { i_this->m2C0->setAnm((J3DAnmTransform*)dComIfG_getObjectRes("Bmd", BMD_BCK_NEW_SDEMO1), J3DFrameCtrl::EMode_NONE, 1.0f, 1.0f, 0.0f, -1.0f, NULL); @@ -1290,7 +1285,7 @@ void demo_camera(bmd_class* i_this) { } } break; - case 0xB: + case 10: i_this->mB7C.x = 2.0f; i_this->mB7C.y = 75.0f; i_this->mB7C.z = 403.0f; @@ -1308,6 +1303,7 @@ void demo_camera(bmd_class* i_this) { i_this->mB74++; i_this->mB88 = actor->eyePos; i_this->mB88.y += REG0_F(11) + 30.0f; + case 11: i_this->mB7C.x = -139.0f; i_this->mB7C.y = 125.0f; i_this->mB7C.z = 475.0f; @@ -1333,7 +1329,7 @@ void demo_camera(bmd_class* i_this) { } } break; - case 0xD: + case 12: if ((i_this->mB78 >= 0x14) && (i_this->mB78 <= 0x28)) { i_this->mB7C.x = 2.0f; i_this->mB7C.y = 75.0f; @@ -1345,14 +1341,14 @@ void demo_camera(bmd_class* i_this) { player->changeDemoMode(daPy_demo_c::DEMO_SURPRISED_e); player->voiceStart(0x31); } - i_this->m2C0->mFrameCtrl.setRate(0.0f); + i_this->m2C0->setPlaySpeed(0.0f); if (i_this->mB78 == 0x28) { i_this->mB7C.x = -139.0f; i_this->mB7C.y = 125.0f; i_this->mB7C.z = 475.0f; i_this->mB88 = actor->eyePos; i_this->mB88.y += REG0_F(15) + 60.0f; - i_this->m2C0->mFrameCtrl.setRate(1.0f); + i_this->m2C0->setPlaySpeed(1.0f); } } else { cLib_addCalc2(&i_this->mB9C, REG0_F(12) + 35.0f, 0.2f, REG0_F(13) + 1.0f); @@ -1381,7 +1377,7 @@ void demo_camera(bmd_class* i_this) { } } break; - case 0xF: + case 15: if ((int)i_this->mB78 == REG0_S(6) + 0x37) { player->changeDemoMode(daPy_demo_c::DEMO_SURPRISED_e); } @@ -1417,24 +1413,22 @@ void demo_camera(bmd_class* i_this) { g_dComIfG_gameInfo.save.getMemory().getBit().onStageBossDemo(); } break; - case 0x64: + case 100: if (!actor->eventInfo.checkCommandDemoAccrpt()) { fopAcM_orderPotentialEvent(actor, dEvtFlag_STAFF_ALL_e, 0xFFFF, 0); actor->eventInfo.onCondition(dEvtCnd_UNK2_e); i_this->mB76 = 0; i_this->mB78 = 0; } - break; - case 0x65: i_this->mB74 = sVar2 + 1; - pcVar4 = dComIfGp_getCamera(0); - i_this->mB7C = pcVar4->mLookat.mEye; - i_this->mB88 = pcVar4->mLookat.mCenter; - pcVar4->mCamera.Stop(); - pcVar4->mCamera.SetTrimSize(2); + camera = dComIfGp_getCamera(0); + i_this->mB7C = camera->mLookat.mEye; + i_this->mB88 = camera->mLookat.mCenter; + camera->mCamera.Stop(); + camera->mCamera.SetTrimSize(2); i_this->mB9C = 55.0f; player->changeOriginalDemo(); - case 0x66: + case 101: if ((i_this->mB78 >= 0x140) && (cLib_addCalc2(&i_this->mB9C, REG0_F(8) + 85.0f, 0.2f, 1.0f), i_this->mB78 == 0x140)) { i_this->m2DC = 5; } @@ -1475,7 +1469,7 @@ void demo_camera(bmd_class* i_this) { i_this->m2E0 += actor->current.pos; i_this->m2FA = actor->shape_angle.y + (REG0_S(4) + 3000); break; - case 0x67: { + case 102: { i_this->mB9C = REG0_F(8) + 55.0f; i_this->mB96 = actor->shape_angle.y + REG0_S(2); i_this->mB94 = -8000; @@ -1487,10 +1481,12 @@ void demo_camera(bmd_class* i_this) { cStack_b8.y = actor->shape_angle.y + 0x8BB8; fopAcM_create(PROC_NPC_CB1, 0, &i_this->m2E0, fopAcM_GetRoomNo(actor), &cStack_b8); i_this->m2DC = 0; + // Fall-through + } + case 103: { iVar6 = (int)(i_this->mBA0 * 22384.0f); - cLib_addCalcAngleS2(&i_this->mB96, actor->shape_angle.y + REG0_S(2) + 0x5770, 0x10, (s16)iVar6); - iVar6 = (int)(i_this->mBA0 * 3000.0f); - cLib_addCalcAngleS2(&i_this->mB94, -5000, 0x10, (s16)iVar6); + cLib_addCalcAngleS2(&i_this->mB96, actor->shape_angle.y + REG0_S(2) + 0x5770, 0x10, iVar6); + cLib_addCalcAngleS2(&i_this->mB94, -5000, 0x10, (int)(i_this->mBA0 * 3000.0f)); cLib_addCalc2(&i_this->mBA4, 500.0f, 0.0625f, i_this->mBA0 * 1000.0f); cLib_addCalc2(&i_this->mBA0, REG0_F(10) + 0.0048f, 0.1f, 4.8e-05f); cMtx_YrotS(*calc_mtx, (int)i_this->mB96); @@ -1510,11 +1506,11 @@ void demo_camera(bmd_class* i_this) { } break; } - case 0x96: + case 150: i_this->mB74 = 0; - pcVar11->mCamera.Reset(i_this->mB88, i_this->mB7C); - pcVar11->mCamera.Start(); - pcVar11->mCamera.SetTrimSize(0); + camera->mCamera.Reset(i_this->mB88, i_this->mB7C); + camera->mCamera.Start(); + camera->mCamera.SetTrimSize(0); break; } if (i_this->mB74 != 0) { @@ -1525,7 +1521,7 @@ void demo_camera(bmd_class* i_this) { local_a4.y = i_this->mB88.y + i_this->mBA8 * cM_scos(i_this->mB78 * 0x3000); local_a4.z = i_this->mB88.z; iVar6 = (int)(i_this->mBA8 * cM_scos(i_this->m2FE * 0x1c00) * 7.5f); - pcVar4->mCamera.Set(local_a4, local_b0, (s16)iVar6, i_this->mB9C); + camera->mCamera.Set(local_a4, local_b0, (s16)iVar6, i_this->mB9C); cLib_addCalc0(&i_this->mBA8, 1.0f, (REG0_F(16) + 2.0f)); JUTReport(0x1e, 0x1ae, "K MAIN COUNT %d", (int)i_this->mB76); JUTReport(0x19a, 0x1ae, "K SUB COUNT %d", (int)i_this->mB78); diff --git a/src/d/actor/d_a_bmdhand.cpp b/src/d/actor/d_a_bmdhand.cpp index 47fda916c..ea555ebcf 100644 --- a/src/d/actor/d_a_bmdhand.cpp +++ b/src/d/actor/d_a_bmdhand.cpp @@ -468,7 +468,7 @@ void hand_move(bmdhand_class* i_this) { hand_s* pcVar9 = i_this->m324; if (boss != NULL) { actor->current.angle.y = (fopAcM_GetParam(actor) & 0x1f) * -0xccc + REG8_S(4) + -13000 + boss->actor.shape_angle.y; - MTXCopy(boss->mpMorf->mpModel->getAnmMtx(boss_joint_d[(actor->base.mParameters & 0x1fU)]), *calc_mtx); + MTXCopy(boss->mpMorf->getModel()->getAnmMtx(boss_joint_d[(actor->base.mParameters & 0x1fU)]), *calc_mtx); local_40.x = REG14_F(6); local_40.y = REG14_F(7); local_40.z = boss_joint_xad[(actor->base.mParameters & 3U)]; diff --git a/src/d/actor/d_a_boko.cpp b/src/d/actor/d_a_boko.cpp index a5ded0948..95a1d5022 100644 --- a/src/d/actor/d_a_boko.cpp +++ b/src/d/actor/d_a_boko.cpp @@ -141,7 +141,7 @@ void daBoko_c::keCalc1(ke_c_s* arg1, int arg2) { pcVar10->z = fVar1 * (pcVar11->z - pcVar10->z); } - cXyz* segments = mpLineKe->lineMat.mpLines[arg2].mpSegments; + cXyz* segments = mpLineKe->lineMat.getPos(arg2); for (s32 i = 0; i < 10; i++) { *segments++ = arg1->m000[i]; } diff --git a/src/d/actor/d_a_bst.cpp b/src/d/actor/d_a_bst.cpp index 8eabe5d39..140863504 100644 --- a/src/d/actor/d_a_bst.cpp +++ b/src/d/actor/d_a_bst.cpp @@ -1328,7 +1328,7 @@ static void end_demo(bst_class* i_this) { i_this->mDamage++; // fall-through case 1: - if ((s32)i_this->field_0x02B8->mFrameCtrl.getFrame() == 20) { + if ((s32)i_this->field_0x02B8->getFrame() == 20) { fopAcM_seStart(i_this, JA_SE_CM_BST_JUMP_L, 0); } break; diff --git a/src/d/actor/d_a_btd.cpp b/src/d/actor/d_a_btd.cpp index 987f09df5..4e8a13626 100644 --- a/src/d/actor/d_a_btd.cpp +++ b/src/d/actor/d_a_btd.cpp @@ -781,7 +781,7 @@ s32 damage(btd_class* i_this) { for (s32 i = 0, j = 0, k = 0; i < (s32)ARRAY_SIZE(hahen_eff_name); i++, j++, k++) { pJVar4 = dComIfGp_particle_set(hahen_eff_name[k], &i_this->current.pos); if (pJVar4 != NULL) { - pJVar4->setGlobalRTMatrix(iVar2->mpModel->getAnmMtx(hahen_eff_index[j])); + pJVar4->setGlobalRTMatrix(iVar2->getModel()->getAnmMtx(hahen_eff_index[j])); } } } @@ -860,7 +860,7 @@ void end(btd_class* i_this) { i_this->m02EC[0] = REG0_S(3) + 0x21c; mDoAud_bgmStop(20); mDoAud_bgmStreamPrepare(JA_STRM_BOSS_CLEAR); - pJVar10 = iVar2->mpModel; + pJVar10 = iVar2->getModel(); pJVar2 = (J3DMaterialTable*)dComIfG_getObjectRes("Btd", BTD_BMT_DEADA); pJVar10->getModelData()->setMaterialTable(pJVar2, J3DMatCopyFlag_Material); pJVar3 = (J3DAnmTevRegKey*)dComIfG_getObjectRes("Btd", BTD_BRK_DEADA); @@ -916,7 +916,7 @@ void end(btd_class* i_this) { i_this->m02E0 = 2; } if (i_this->m02EC[0] == 0xf1) { - pJVar10 = iVar2->mpModel; + pJVar10 = iVar2->getModel(); pJVar3 = (J3DAnmTevRegKey*)dComIfG_getObjectRes("Btd", BTD_BRK_DEADB); i_this->brkS->init(pJVar10->getModelData(), pJVar3, true, J3DFrameCtrl::EMode_NONE, 1.0f, 0, -1, true, 0); pJVar4 = (J3DAnmTextureSRTKey*)dComIfG_getObjectRes("Btd", BTD_BTK_DEADB); @@ -926,7 +926,7 @@ void end(btd_class* i_this) { for (s32 i = 0; i < (s32)ARRAY_SIZE(last_eff_index); i++) { pJVar6 = dComIfGp_particle_set(last_eff_name[i], &i_this->current.pos); if (pJVar6 != NULL) { - pJVar6->setGlobalRTMatrix(iVar2->mpModel->getAnmMtx(last_eff_index[i])); + pJVar6->setGlobalRTMatrix(iVar2->getModel()->getAnmMtx(last_eff_index[i])); } } } @@ -986,7 +986,7 @@ void end(btd_class* i_this) { kubi_calc(i_this); pJVar6 = i_this->m6038; if (pJVar6 != NULL) { - pJVar6->setGlobalRTMatrix(i_this->m02D4->mpModel->getAnmMtx(0)); + pJVar6->setGlobalRTMatrix(i_this->m02D4->getModel()->getAnmMtx(0)); } break; case 0x36: @@ -1258,7 +1258,7 @@ void punch_attack(btd_class* i_this) { if (i_this->m02EA != 0) { iVar6 = 10; } - iVar1 = iVar3->mFrameCtrl.getFrame(); + iVar1 = iVar3->getFrame(); if (iVar1 == 2) { mDoAud_seStart(JA_SE_CM_BTD_ARM_PULLOUT_1, &i_this->m02FC[iVar6], 0, dComIfGp_getReverb(fopAcM_GetRoomNo(i_this))); fopAcM_monsSeStart(i_this, JA_SE_CV_BTD_JITABATA, 0); diff --git a/src/d/actor/d_a_cc.cpp b/src/d/actor/d_a_cc.cpp index f2abac07e..8a623982c 100644 --- a/src/d/actor/d_a_cc.cpp +++ b/src/d/actor/d_a_cc.cpp @@ -170,7 +170,7 @@ static BOOL daCC_Draw(cc_class* i_this) { if (i_this->m2F5 != 0x35) { if (i_this->m301 == 0) { i_this->m2B4->entryDL(); - a_this->model = i_this->m2B4->mpModel; + a_this->model = i_this->m2B4->getModel(); } else { i_this->m2D8->updateDL(); } @@ -194,7 +194,7 @@ static BOOL daCC_Draw(cc_class* i_this) { if (i_this->m2F5 != 0x35) { i_this->m2B8->remove(i_this->m2B4->getModel()->getModelData()); if (i_this->m2FE != 0) { - pJVar3 = i_this->m2C4->mpModel; + pJVar3 = i_this->m2C4->getModel(); switch (i_this->m2FE) { case 1: i_this->m2C8->remove(pJVar3->getModelData()); @@ -2655,7 +2655,7 @@ static cPhs_State daCC_Create(fopAc_ac_c* a_this) { break; } - fopAcM_SetMtx(a_this, i_this->m2B4->mpModel->getBaseTRMtx()); + fopAcM_SetMtx(a_this, i_this->m2B4->getModel()->getBaseTRMtx()); a_this->attention_info.flags = 0; i_this->mAcch.Set(fopAcM_GetPosition_p(a_this), fopAcM_GetOldPosition_p(a_this), a_this, 1, &i_this->mAcchCir, fopAcM_GetSpeed_p(a_this), NULL, NULL); diff --git a/src/d/actor/d_a_demo_dk.cpp b/src/d/actor/d_a_demo_dk.cpp index 02b6e77a1..86406f362 100644 --- a/src/d/actor/d_a_demo_dk.cpp +++ b/src/d/actor/d_a_demo_dk.cpp @@ -116,7 +116,7 @@ static BOOL useHeapInit(fopAc_ac_c* a_this) { (J3DAnmTransform*)dComIfG_getObjectRes("DEMO_DK", DEMO_DK_BCK_DK_L_WAIT1), J3DFrameCtrl::EMode_LOOP, 1.0f, 0, -1, 1, NULL, 0, 0x11020203); - if (i_this->mpMorf == NULL || i_this->mpMorf->mpModel == NULL) { + if (i_this->mpMorf == NULL || i_this->mpMorf->getModel() == NULL) { return FALSE; } return TRUE; diff --git a/src/d/actor/d_a_dr2.cpp b/src/d/actor/d_a_dr2.cpp index 2dda7ec95..14b14abd4 100644 --- a/src/d/actor/d_a_dr2.cpp +++ b/src/d/actor/d_a_dr2.cpp @@ -653,7 +653,7 @@ static BOOL useHeapInit(fopAc_ac_c* a_this) { i_this->mpMorf1 = new mDoExt_McaMorf((J3DModelData*)dComIfG_getObjectRes("Dr2", DR2_BMD_DR_SIPPO), NULL, NULL, NULL, J3DFrameCtrl::EMode_LOOP, 1.0f, 0, -1, 0, NULL, 0, 0x11020203); - if ((i_this->mpMorf1 == NULL) || (i_this->mpMorf1->mpModel == NULL)) { + if ((i_this->mpMorf1 == NULL) || (i_this->mpMorf1->getModel() == NULL)) { return FALSE; } @@ -705,7 +705,7 @@ static BOOL useHeapInit(fopAc_ac_c* a_this) { NULL, NULL, (J3DAnmTransformKey*)dComIfG_getObjectRes("Dr2", DR2_BCK_DR_BOSS_DEMO1), J3DFrameCtrl::EMode_LOOP, 1.0f, 0, -1, 0, NULL, 0, 0x11020203); - if (i_this->mpMorf2 == NULL || i_this->mpMorf2->mpModel == NULL) { + if (i_this->mpMorf2 == NULL || i_this->mpMorf2->getModel() == NULL) { return FALSE; } diff --git a/src/d/actor/d_a_fganon.cpp b/src/d/actor/d_a_fganon.cpp index 81b3e7b3a..842670b4c 100644 --- a/src/d/actor/d_a_fganon.cpp +++ b/src/d/actor/d_a_fganon.cpp @@ -276,7 +276,7 @@ void shot(fganon_class* i_this) { break; } case 2: { - s32 mFrame = i_this->mpMorf->mFrameCtrl.getFrame(); + s32 mFrame = i_this->mpMorf->getFrame(); if (REG0_S(0) + 14 == mFrame) { i_this->m409 = 1; i_this->m688 = 0; @@ -346,7 +346,7 @@ void spinattack(fganon_class* i_this) { fopAc_ac_c* a_this = (fopAc_ac_c*)i_this; fopAc_ac_c* player = (fopAc_ac_c*)dComIfGp_getPlayer(0); dBgS_LinChk linChk; - int mFrame = i_this->mpMorf->mFrameCtrl.getFrame(); + int mFrame = i_this->mpMorf->getFrame(); switch(i_this->mMode) { case 0: { i_this->shape_angle.y = player->shape_angle.y; @@ -569,7 +569,7 @@ void shot2(fganon_class* i_this) { fopAc_ac_c* actor = i_this; cLib_addCalcAngleS2(&i_this->shape_angle.y, fopAcM_searchPlayerAngleY(i_this), 10, 0x400); - int mFrame = i_this->mpMorf->mFrameCtrl.getFrame(); + int mFrame = i_this->mpMorf->getFrame(); switch(i_this->mMode) { case 0: { anm_init(i_this, FGANON_BCK_TAME_S1, 5.0f, J3DFrameCtrl::EMode_NONE, 1.0f, -1); @@ -679,7 +679,7 @@ void spinattack2(fganon_class* i_this) { fopAc_ac_c* a_this = (fopAc_ac_c*)i_this; fopAc_ac_c* player = (fopAc_ac_c*)dComIfGp_getPlayer(0); dBgS_LinChk linChk; - int mFrame = i_this->mpMorf->mFrameCtrl.getFrame(); + int mFrame = i_this->mpMorf->getFrame(); switch(i_this->mMode) { case 0: { i_this->shape_angle.y = player->shape_angle.y + i_this->m68F * 0x3333; @@ -783,7 +783,7 @@ void down(fganon_class* i_this) { break; } case 3: { - int mFrame = i_this->mpMorf->mFrameCtrl.getFrame(); + int mFrame = i_this->mpMorf->getFrame(); if (mFrame == 2) { fopAcM_monsSeStart(i_this, JA_SE_CV_PG_TIRED, 0); } @@ -1163,7 +1163,7 @@ void end(fganon_class* i_this) { i_this->m3AE = 3; fopAcM_OffStatus(i_this, 0); i_this->attention_info.flags = 0; - s32 mFrame = i_this->mpMorf->mFrameCtrl.getFrame(); + s32 mFrame = i_this->mpMorf->getFrame(); switch(i_this->mMode) { case 0: { i_this->mMode = 1; @@ -2593,7 +2593,7 @@ static BOOL useHeapInit(fopAc_ac_c* i_act) { return FALSE; ptrkAnm = (J3DAnmTevRegKey *)dComIfG_getObjectRes("Fganon", FGANON_BRK_DERU_MAIN1); - iVar4 = i_this->mpBrkAnm1->init(i_this->mpMorf->mpModel->getModelData(), ptrkAnm, TRUE, J3DFrameCtrl::EMode_NONE, 1.0f, 0, -1, FALSE, 0); + iVar4 = i_this->mpBrkAnm1->init(i_this->mpMorf->getModel()->getModelData(), ptrkAnm, TRUE, J3DFrameCtrl::EMode_NONE, 1.0f, 0, -1, FALSE, 0); if (iVar4 == 0) return FALSE; diff --git a/src/d/actor/d_a_himo2.cpp b/src/d/actor/d_a_himo2.cpp index 66f30004e..298793b84 100644 --- a/src/d/actor/d_a_himo2.cpp +++ b/src/d/actor/d_a_himo2.cpp @@ -112,7 +112,7 @@ void spin_draw(himo2_class* i_this) { local_504.y = 0.0f; local_504.z = 3.90625f; sVar8 = -0x30d4; - pcVar7 = i_this->m1F30.mpLines->mpSegments + i_this->m1F6C; + pcVar7 = i_this->m1F30.getPos(0) + i_this->m1F6C; cXyz local_4f8[100]; for (iVar11 = 0, iVar6 = 0; iVar11 < 100; iVar11++, iVar6 += 12) { local_4f8[iVar6].y = -200000.0f; @@ -270,7 +270,7 @@ void himo2_draw(himo2_class* i_this, himo2_s* param_2) { /* Nonmatching - regalloc */ fopAc_ac_c* actor = &i_this->actor; daPy_py_c* apdVar1 = (daPy_py_c*)dComIfGp_getPlayer(0); - cXyz* pcVar6 = i_this->m1F30.mpLines->mpSegments + i_this->m1F6C; + cXyz* pcVar6 = i_this->m1F30.getPos(0) + i_this->m1F6C; pcVar6->x = i_this->m02B4.x; pcVar6->y = i_this->m02B4.y; pcVar6->z = i_this->m02B4.z; @@ -387,7 +387,7 @@ static BOOL daHimo2_Draw(himo2_class* i_this) { dComIfGd_setList(); return TRUE; } else { - pcVar7 = i_this->m1F30.mpLines->mpSegments; + pcVar7 = i_this->m1F30.getPos(0); cXyz local_a10[200]; iVar3 = 0; for (iVar5 = 0; iVar5 < i_this->m1F6C; iVar5++) { @@ -447,7 +447,7 @@ static BOOL daHimo2_Draw(himo2_class* i_this) { dVar11 = 1.0f; dVar12 = -20000.0f; for (int iVar9 = 0; iVar9 < 5; iVar9++) { - pcVar7 = i_this->m1F98.mpLines->mPosArr[iVar3 + -8]; + pcVar7 = i_this->m1F98.getPos(iVar3); if (dVar13 > (dVar14 * (4 - iVar9))) { cLib_addCalc0(&i_this->m1F70, dVar11, (REG0_F(11) + 0.2f)); @@ -465,7 +465,7 @@ static BOOL daHimo2_Draw(himo2_class* i_this) { for (int j = 0; j < 32; j++, pcVar7++) { cMtx_XrotM(*calc_mtx, 0x800); MtxPosition(&local_a1c, pcVar7); - i_this->m02EC[1] += *pcVar7; + *pcVar7 += i_this->m02EC[1]; } iVar5 += 4; iVar3 += 24; @@ -473,7 +473,7 @@ static BOOL daHimo2_Draw(himo2_class* i_this) { GXColor local_a54 = {200, 0x96, 50, 0xFF}; i_this->m1F98.update(0x20, rope_scale, local_a54, 0, &actor->tevStr); dComIfGd_set3DlineMat(&i_this->m1F98); - pcVar7 = ((i_this->m1FD8).mpLines)->mpSegments; + pcVar7 = i_this->m1FD8.getPos(0); local_a8 = i_this->m2188; if (((int)i_this->m2188 & REG0_S(4) + 64) != 0) { fVar1 = REG0_F(14) + 15.0f; diff --git a/src/d/actor/d_a_jbo.cpp b/src/d/actor/d_a_jbo.cpp index f4b003273..833eb675e 100644 --- a/src/d/actor/d_a_jbo.cpp +++ b/src/d/actor/d_a_jbo.cpp @@ -34,7 +34,7 @@ static BOOL nodeCallBack(J3DNode *i_node, int i_calcTiming) { /* 00000108-00000240 .text jbo_draw_SUB__FP9jbo_class */ void jbo_draw_SUB(jbo_class *i_this) { - J3DModel *model = i_this->mpMorf->mpModel; + J3DModel *model = i_this->mpMorf->getModel(); model->setBaseScale(i_this->scale); mDoMtx_stack_c::transS(i_this->current.pos.x, i_this->current.pos.y, i_this->current.pos.z); mDoMtx_stack_c::YrotM(i_this->shape_angle.y); @@ -176,7 +176,7 @@ static BOOL useHeapInit(fopAc_ac_c* i_this) { /*differedDlistFlag=*/ 0x11020203 ); a_this->mpMorf = morf; - if (a_this->mpMorf == NULL || a_this->mpMorf->mpModel == NULL) { + if (a_this->mpMorf == NULL || a_this->mpMorf->getModel() == NULL) { return FALSE; } a_this->mpMorf->getModel()->setUserArea(reinterpret_cast(a_this)); diff --git a/src/d/actor/d_a_kn.cpp b/src/d/actor/d_a_kn.cpp index a0985ddcd..514ad6a82 100644 --- a/src/d/actor/d_a_kn.cpp +++ b/src/d/actor/d_a_kn.cpp @@ -505,7 +505,7 @@ static BOOL useHeapInit(fopAc_ac_c* a_this) { 0x80000, 0x11000002 ); - if ((i_this->mpMorf == NULL) || (i_this->mpMorf->mpModel == NULL)) { + if ((i_this->mpMorf == NULL) || (i_this->mpMorf->getModel() == NULL)) { return FALSE; } return TRUE; diff --git a/src/d/actor/d_a_mflft.cpp b/src/d/actor/d_a_mflft.cpp index b3818d6ec..574c33280 100644 --- a/src/d/actor/d_a_mflft.cpp +++ b/src/d/actor/d_a_mflft.cpp @@ -77,7 +77,12 @@ void ride_call_back(dBgW*, fopAc_ac_c* arg1, fopAc_ac_c* arg2) { /* 00000408-00000488 .text himo_Draw__FP11mflft_class */ void himo_Draw(mflft_class* i_this) { +#ifdef __MWERKS__ i_this->mLineMat.update(10, (GXColor){150, 150, 150, 255}, &i_this->actor.tevStr); + #else + GXColor color = {150, 150, 150, 255}; + i_this->mLineMat.update(10, color, &i_this->actor.tevStr); +#endif dComIfGd_set3DlineMat(&i_this->mLineMat); } @@ -319,7 +324,7 @@ void himo_move(mflft_class* i_this) { cXyz sp3C; cXyz* line1; cXyz* line2; - s32 i; + int i; u8* lineSize; for (i = 0; i < ARRAY_SSIZE(i_this->m6EC); i++) { @@ -329,12 +334,12 @@ void himo_move(mflft_class* i_this) { sp48.z = i_this->m6EC[i] * cM_ssin(i_this->m298 * 15000); MtxPosition(&sp48, &sp3C); - line1 = i_this->mLineMat.mpLines[i].mpSegments; - line2 = i_this->mLineMat.mpLines[i + 3].mpSegments; + line1 = i_this->mLineMat.getPos(i); + line2 = i_this->mLineMat.getPos(i + 3); if (i_this->m2D4[i] == 0) { sp48 = i_this->m2FC[i] - i_this->m2D8[i]; - lineSize = i_this->mLineMat.mpLines[i].mpSize; + lineSize = i_this->mLineMat.getSize(i); for (s32 j = 0; j < 10; line1++, line2++, lineSize++, j++) { if (j < 9) { @@ -384,14 +389,14 @@ void himo_move(mflft_class* i_this) { dComIfG_Ccsp()->Set(&i_this->mCyls[i]); } else { #if VERSION > VERSION_DEMO - cXyz* line2 = i_this->mLineMat.mpLines[i + 3].mpSegments; + cXyz* line2 = i_this->mLineMat.getPos(i + 3); #endif - *i_this->mLineMat.mpLines[i].mpSegments = i_this->m2D8[i]; - lineSize = i_this->mLineMat.mpLines[i].mpSize; + *i_this->mLineMat.getPos(i) = i_this->m2D8[i]; + lineSize = i_this->mLineMat.getSize(i); himo_cut_control(i_this, line1, lineSize, NULL); *line2 = i_this->m2FC[i]; - lineSize = i_this->mLineMat.mpLines[i + 3].mpSize; + lineSize = i_this->mLineMat.getSize(i + 3); himo_cut_control(i_this, line2, lineSize, 1); } } diff --git a/src/d/actor/d_a_npc_fa1.cpp b/src/d/actor/d_a_npc_fa1.cpp index ab62951c5..5bee72834 100644 --- a/src/d/actor/d_a_npc_fa1.cpp +++ b/src/d/actor/d_a_npc_fa1.cpp @@ -301,10 +301,10 @@ int daNpc_Fa1_c::createInit() { /* 800FB514-800FB5D8 .text _draw__11daNpc_Fa1_cFv */ BOOL daNpc_Fa1_c::_draw() { - J3DModel* pJVar1 = mpDoExt_McaMorf->getModel(); + J3DModel* pJVar1 = mpMorf->getModel(); g_env_light.settingTevStruct(TEV_TYPE_ACTOR, ¤t.pos, &tevStr); g_env_light.setLightTevColorType(pJVar1, &tevStr); - mpDoExt_McaMorf->entryDL(); + mpMorf->entryDL(); f32 ground_y = mGroundY; if (ground_y != -G_CM3D_F_INF) { dComIfGd_setSimpleShadow(¤t.pos, ground_y, 10.0f, &m774, 0, 1.0f, @@ -319,7 +319,7 @@ BOOL daNpc_Fa1_c::_execute() { cLib_calcTimer(&mTimer); (this->*moveProc[getMode()])(); shape_angle.y = current.angle.y; - mpDoExt_McaMorf->play(NULL, 0, 0); + mpMorf->play(NULL, 0, 0); setMtx(); if (isTypeBaba()) { setPointLightParam(); @@ -526,12 +526,12 @@ void daNpc_Fa1_c::init_get_player_move() { /* 800FC03C-800FC178 .text get_player_move__11daNpc_Fa1_cFv */ void daNpc_Fa1_c::get_player_move() { - f32 fVar1 = mpDoExt_McaMorf->mFrameCtrl.getRate(); + f32 fVar1 = mpMorf->getPlaySpeed(); fVar1 += 0.05f; if (fVar1 > 1.5f) { fVar1 = 1.5f; } - mpDoExt_McaMorf->mFrameCtrl.setRate(fVar1); + mpMorf->setPlaySpeed(fVar1); s16 sVar4 = m78A; current.angle.y = current.angle.y - sVar4; sVar4 += l_HIO.prm.m40; @@ -621,12 +621,12 @@ void daNpc_Fa1_c::init_bottle_appear_move() { /* 800FC3C8-800FC5A8 .text bottle_appear_move__11daNpc_Fa1_cFv */ void daNpc_Fa1_c::bottle_appear_move() { - f32 fVar1 = mpDoExt_McaMorf->mFrameCtrl.getRate(); + f32 fVar1 = mpMorf->getPlaySpeed(); fVar1 += 0.05f; if (fVar1 > 1.5f) { fVar1 = 1.5f; } - mpDoExt_McaMorf->mFrameCtrl.setRate(fVar1); + mpMorf->setPlaySpeed(fVar1); current.angle.y = current.angle.y - m78A; m78A += m78E; if (m78A > m78C) { @@ -932,7 +932,7 @@ cPhs_State daNpc_Fa1_c::_create() { fopAcM_SetupActor(this, daNpc_Fa1_c); if (fopAcM_entrySolidHeap(this, CheckCreateHeap, a_heap_size_tbl)) { - fopAcM_SetMtx(this, mpDoExt_McaMorf->mpModel->getBaseTRMtx()); + fopAcM_SetMtx(this, mpMorf->getModel()->getBaseTRMtx()); } else { return cPhs_ERROR_e; } @@ -951,17 +951,17 @@ cPhs_State daNpc_Fa1_c::_create() { /* 800FD4E8-800FD61C .text CreateHeap__11daNpc_Fa1_cFv */ int daNpc_Fa1_c::CreateHeap() { J3DModelData* pModelData = (J3DModelData*)dComIfG_getObjectRes("Always", ALWAYS_BDL_FA); - mpDoExt_McaMorf = + mpMorf = new mDoExt_McaMorf(pModelData, &mMcaMorfCallback1, NULL, (J3DAnmTransformKey*)dComIfG_getObjectRes("Always", ALWAYS_BCK_FA), J3DFrameCtrl::EMode_LOOP, 1.0f, 0, -1, 0, NULL, 0x00000000, 0x11020203); - if (mpDoExt_McaMorf == NULL) { + if (mpMorf == NULL) { return false; - } else if (mpDoExt_McaMorf->getModel() == NULL) { - mpDoExt_McaMorf = NULL; + } else if (mpMorf->getModel() == NULL) { + mpMorf = NULL; return false; } else { mMcaMorfCallback1.setNeckJoint(pModelData->getJointName()->getIndex("neck")); @@ -972,12 +972,12 @@ int daNpc_Fa1_c::CreateHeap() { /* 800FD61C-800FD6DC .text setMtx__11daNpc_Fa1_cFv */ void daNpc_Fa1_c::setMtx() { - J3DModel* pJVar5 = mpDoExt_McaMorf->getModel(); + J3DModel* pJVar5 = mpMorf->getModel(); mDoMtx_stack_c::transS(current.pos.x, current.pos.y, current.pos.z); mDoMtx_stack_c::YrotM(shape_angle.y); pJVar5->setBaseTRMtx(mDoMtx_stack_c::get()); - mpDoExt_McaMorf->calc(); - MtxP pMVar4 = mpDoExt_McaMorf->getModel()->getAnmMtx(mMcaMorfCallback1.getNeckJoint()); + mpMorf->calc(); + MtxP pMVar4 = mpMorf->getModel()->getAnmMtx(mMcaMorfCallback1.getNeckJoint()); attention_info.position.set(pMVar4[0][3], pMVar4[1][3], pMVar4[2][3]); eyePos = attention_info.position; } diff --git a/src/d/actor/d_a_npc_km1.cpp b/src/d/actor/d_a_npc_km1.cpp index 913d28e8a..c6829a27f 100644 --- a/src/d/actor/d_a_npc_km1.cpp +++ b/src/d/actor/d_a_npc_km1.cpp @@ -735,7 +735,7 @@ cPhs_State daNpc_Km1_c::_create() { #endif if(fopAcM_entrySolidHeap(this,CheckCreateHeap,a_heap_size_tbl[field_0x7D3])){ - fopAcM_SetMtx(this,mpMorf->mpModel->getBaseTRMtx()); + fopAcM_SetMtx(this,mpMorf->getModel()->getBaseTRMtx()); fopAcM_setCullSizeBox(this,-60.0f,-20.0f,-80.0f,60.0f,160.0f,60.0f); }else{ return cPhs_ERROR_e; @@ -774,7 +774,7 @@ BOOL daNpc_Km1_c::CreateHeap() { if (field_0x6D4 != 0) { for (u16 i = 0; i < a_mdl_data->getJointNum(); i += 1) { if ((i == m_head_jnt_num) || (i == m_backbone_jnt_num)) { - mpMorf->mpModel->getModelData()->getJointNodePointer(i)->setCallBack(nodeCallBack_Km); + mpMorf->getModel()->getModelData()->getJointNodePointer(i)->setCallBack(nodeCallBack_Km); } } mpMorf->getModel()->setUserArea((u32)this); diff --git a/src/d/actor/d_a_npc_os.cpp b/src/d/actor/d_a_npc_os.cpp index 6816d955c..5deec091f 100644 --- a/src/d/actor/d_a_npc_os.cpp +++ b/src/d/actor/d_a_npc_os.cpp @@ -226,7 +226,7 @@ cPhs_State daNpc_Os_c::create() { } setBaseMtx(); - fopAcM_SetMtx(this, mpMorf->mpModel->getBaseTRMtx()); + fopAcM_SetMtx(this, mpMorf->getModel()->getBaseTRMtx()); if(l_HIO.mNo < 0) { l_HIO.mNo = mDoHIO_createChild("γŠδΎ›ηŸ³εƒ", &l_HIO); // "Companion Statue" (otomo sekizou) l_HIO.field_0x5C = this; diff --git a/src/d/actor/d_a_obj_ikada.cpp b/src/d/actor/d_a_obj_ikada.cpp index ea4af71d5..a401a0c13 100644 --- a/src/d/actor/d_a_obj_ikada.cpp +++ b/src/d/actor/d_a_obj_ikada.cpp @@ -411,7 +411,7 @@ void daObj_Ikada_c::setWave() { /* 00001528-00001690 .text incRopeCnt__13daObj_Ikada_cFii */ void daObj_Ikada_c::incRopeCnt(int arg1, int arg2) { - cXyz* pcVar5 = &mRopeLine.mpLines->mpSegments[0]; + cXyz* pcVar5 = &mRopeLine.getPos(0)[0]; cXyz* pcVar4 = &m07DC[m07D8]; s32 i; @@ -454,10 +454,10 @@ void daObj_Ikada_c::setRopePos() { cXyz* pcVar7; if (m07D8 == 0) { - pcVar6 = &mRopeLine.mpLines->mpSegments[0]; + pcVar6 = mRopeLine.getPos(0); pcVar7 = &m07DC[0]; } else { - pcVar6 = &mRopeLine.mpLines->mpSegments[m07D8] - 1; + pcVar6 = mRopeLine.getPos(0) + m07D8 - 1; pcVar7 = &m07DC[m07D8 - 1]; } @@ -507,7 +507,7 @@ void daObj_Ikada_c::setRopePos() { s16 iVar3; s16 iVar4; - pcVar7 = mRopeLine.mpLines->mpSegments; + pcVar7 = mRopeLine.getPos(0); if (m07D8 > 1) { spA4 = pcVar7[0] - pcVar7[1]; iVar3 = 0; @@ -1381,7 +1381,7 @@ void daObj_Ikada_c::createInit() { mpModel->calc(); m07D8 = 15; - cXyz* pcVar8 = &mRopeLine.mpLines->mpSegments[m07D8] - 1; + cXyz* pcVar8 = &mRopeLine.getPos(0)[m07D8] - 1; cXyz* pcVar7 = &m07DC[m07D8 - 1]; mDoMtx_stack_c::copy(mpModel->getAnmMtx(1)); @@ -1399,8 +1399,8 @@ void daObj_Ikada_c::createInit() { *pcVar7 = cXyz::Zero; } - pcVar8 = &mRopeLine.mpLines->mpSegments[0]; - cXyz sp74 = mRopeLine.mpLines->mpSegments[0] - mRopeLine.mpLines->mpSegments[1]; + pcVar8 = &mRopeLine.getPos(0)[0]; + cXyz sp74 = mRopeLine.getPos(0)[0] - mRopeLine.getPos(0)[1]; f32 sin = cM_ssin(shape_angle.y); f32 cos = cM_scos(shape_angle.y); diff --git a/src/d/actor/d_a_ship.cpp b/src/d/actor/d_a_ship.cpp index 2862e15ca..f33138a81 100644 --- a/src/d/actor/d_a_ship.cpp +++ b/src/d/actor/d_a_ship.cpp @@ -196,7 +196,7 @@ BOOL daShip_c::headJointCallBack0() { J3DAnmTransform* tempAnmTransform; if (mAnmTransform) { tempAnmTransform = mpHeadAnm->getAnm(); - mpHeadAnm->mpAnm = mAnmTransform; + mpHeadAnm->changeAnm(mAnmTransform); mAnmTransform = tempAnmTransform; } return TRUE; @@ -1647,7 +1647,7 @@ BOOL daShip_c::procSteerMove() { } windPower *= windFactor * 55.0f; - if (mpBodyAnm->mFrameCtrl.checkPass(7.0f)) { + if (mpBodyAnm->checkFrame(7.0f)) { float targetSpeed = windPower * 2.0f; if (targetSpeed > 80.0f) { targetSpeed = 80.0f; diff --git a/src/d/actor/d_a_ssk.cpp b/src/d/actor/d_a_ssk.cpp index a26d592a2..c487c1c08 100644 --- a/src/d/actor/d_a_ssk.cpp +++ b/src/d/actor/d_a_ssk.cpp @@ -41,8 +41,8 @@ static BOOL nodeCallBack(J3DNode* node, int calcTiming) { /* 000001D0-0000033C .text draw_sub__FP9ssk_class */ void draw_sub(ssk_class* i_this) { - J3DModel* pJVar4 = i_this->mpMorf1->mpModel; - J3DModel* pJVar3 = i_this->mpMorf2->mpModel; + J3DModel* pJVar4 = i_this->mpMorf1->getModel(); + J3DModel* pJVar3 = i_this->mpMorf2->getModel(); for (u16 i = 0; i < i_this->mpMorf1->getModel()->getModelData()->getJointNum(); i++) { i_this->mpMorf1->getModel()->getModelData()->getJointNodePointer(i)->setCallBack(nodeCallBack); diff --git a/src/d/d_attention.cpp b/src/d/d_attention.cpp index fd565b20d..d0550559a 100644 --- a/src/d/d_attention.cpp +++ b/src/d/d_attention.cpp @@ -963,7 +963,7 @@ void dAttDraw_c::setAnm(int resIdxTransform, int resIdxColor, int loopMode) { /* 8009F6B4-8009F834 .text draw__10dAttDraw_cFR4cXyzPA4_f */ void dAttDraw_c::draw(cXyz &pos, Mtx mtx) { - J3DModel *model = anm->mpModel; + J3DModel *model = anm->getModel(); mDoMtx_stack_c::transS(pos); mDoMtx_stack_c::concat(mtx); model->setBaseTRMtx(mDoMtx_stack_c::get()); @@ -973,7 +973,7 @@ void dAttDraw_c::draw(cXyz &pos, Mtx mtx) { J3DAnmColor *color = (J3DAnmColor*)dComIfG_getObjectRes("Always", ALWAYS_BPK_YJ_IN); modeldata->removeMatColorAnimator(color); } else { - mpAnmClr->setFrame(anm->mFrameCtrl.getFrame()); + mpAnmClr->setFrame(anm->getFrame()); J3DMatColorAnm *p = mpAnmMatClr; for(u16 i = 0; i < mpAnmClr->getUpdateMaterialNum(); i++) { p->setAnmColor(mpAnmClr);