diff --git a/include/d/actor/d_a_bmdfoot.h b/include/d/actor/d_a_bmdfoot.h index 264b07b6f..aabc0eb64 100644 --- a/include/d/actor/d_a_bmdfoot.h +++ b/include/d/actor/d_a_bmdfoot.h @@ -5,8 +5,9 @@ #include "d/d_particle.h" #include "f_op/f_op_actor.h" -class bmdfoot_class : public fopAc_ac_c { +class bmdfoot_class { public: + /* 0x000 */ fopAc_ac_c actor; /* 0x290 */ u8 m290[0x2AC - 0x290]; /* 0x2AC */ request_of_phase_process_class m2AC; /* 0x2B4 */ mDoExt_McaMorf* m2B4; diff --git a/src/JSystem/J3DGraphAnimator/J3DJoint.cpp b/src/JSystem/J3DGraphAnimator/J3DJoint.cpp index bc0f6db2a..0355028d1 100644 --- a/src/JSystem/J3DGraphAnimator/J3DJoint.cpp +++ b/src/JSystem/J3DGraphAnimator/J3DJoint.cpp @@ -79,7 +79,7 @@ void J3DMtxCalcBasic::calcTransform(u16 jnt_no, const J3DTransformInfo& info) { } MTXConcat(J3DSys::mCurrentMtx, mtx, J3DSys::mCurrentMtx); J3DModel* model = j3dSys.getModel(); - MTXCopy(J3DSys::mCurrentMtx, model->getAnmMtx(jnt_no)); + model->setAnmMtx(jnt_no, J3DSys::mCurrentMtx); } /* 802F525C-802F52BC .text calc__15J3DMtxCalcBasicFUs */ @@ -127,10 +127,10 @@ void J3DMtxCalcSoftimage::calcTransform(u16 jnt_no, const J3DTransformInfo& info mtx[2][2] = J3DSys::mCurrentMtx[2][2] * J3DSys::mCurrentS.z; mtx[2][3] = J3DSys::mCurrentMtx[2][3]; J3DModel* model = j3dSys.getModel(); - MTXCopy(mtx, model->getAnmMtx(jnt_no)); + model->setAnmMtx(jnt_no, mtx); } else { J3DModel* model = j3dSys.getModel(); - MTXCopy(J3DSys::mCurrentMtx, model->getAnmMtx(jnt_no)); + model->setAnmMtx(jnt_no, J3DSys::mCurrentMtx); } } @@ -175,7 +175,7 @@ void J3DMtxCalcMaya::calcTransform(u16 jnt_no, const J3DTransformInfo& param_2) } MTXConcat(J3DSys::mCurrentMtx, mtx, J3DSys::mCurrentMtx); model = j3dSys.getModel(); - MTXCopy(J3DSys::mCurrentMtx, model->getAnmMtx(jnt_no)); + model->setAnmMtx(jnt_no, J3DSys::mCurrentMtx); J3DSys::mParentS.x = param_2.mScale.x; J3DSys::mParentS.y = param_2.mScale.y; J3DSys::mParentS.z = param_2.mScale.z; diff --git a/src/d/actor/d_a_bmdfoot.cpp b/src/d/actor/d_a_bmdfoot.cpp index 996e07b30..9e086b5a6 100644 --- a/src/d/actor/d_a_bmdfoot.cpp +++ b/src/d/actor/d_a_bmdfoot.cpp @@ -48,7 +48,7 @@ static BOOL nodeCallBack(J3DNode* node, int calcTiming) { MTXCopy(model->getAnmMtx(jntNo), *calc_mtx); MtxRotX(i_this->m2CC[jntNo].x, 1); MtxRotZ(i_this->m2CC[jntNo].z, 1); - MTXCopy(*calc_mtx, model->getAnmMtx(jntNo)); + model->setAnmMtx(jntNo, *calc_mtx); MTXCopy(*calc_mtx, J3DSys::mCurrentMtx); } } @@ -57,12 +57,13 @@ static BOOL nodeCallBack(J3DNode* node, int calcTiming) { /* 000001D8-000002B0 .text daBmdfoot_Draw__FP13bmdfoot_class */ static BOOL daBmdfoot_Draw(bmdfoot_class* i_this) { + fopAc_ac_c* actor = (fopAc_ac_c*)&i_this->actor; J3DModel* pJVar1; if (i_this->mBC8 != 0) { pJVar1 = i_this->m2B4->getModel(); - g_env_light.settingTevStruct(TEV_TYPE_ACTOR, &i_this->current.pos, &i_this->tevStr); - g_env_light.setLightTevColorType(pJVar1, &i_this->tevStr); + g_env_light.settingTevStruct(TEV_TYPE_ACTOR, &actor->current.pos, &actor->tevStr); + g_env_light.setLightTevColorType(pJVar1, &actor->tevStr); i_this->btk->entry(pJVar1->getModelData()); i_this->m2B4->entryDL(); if (i_this->mBA8 >= 10) { @@ -77,13 +78,18 @@ static BOOL daBmdfoot_Draw(bmdfoot_class* i_this) { /* 000002B0-000003D8 .text anm_init__FP13bmdfoot_classifUcfi */ void anm_init(bmdfoot_class* i_this, int bckFileIdx, float morf, unsigned char loopMode, float speed, int soundFileIdx) { - void* pSoundAnimRes; - if (soundFileIdx >= 0) { - pSoundAnimRes = dComIfG_getObjectRes("Bmdfoot", soundFileIdx); - i_this->m2B4->setAnm((J3DAnmTransform*)dComIfG_getObjectRes("Bmdfoot", bckFileIdx), loopMode, morf, speed, 0.0f, -1.0f, pSoundAnimRes); + i_this->m2B4->setAnm( + (J3DAnmTransform*)dComIfG_getObjectRes("Bmdfoot", bckFileIdx), + loopMode, morf, speed, 0.0f, -1.0f, + dComIfG_getObjectRes("Bmdfoot", soundFileIdx) + ); } else { - i_this->m2B4->setAnm((J3DAnmTransform*)dComIfG_getObjectRes("Bmdfoot", bckFileIdx), loopMode, morf, speed, 0.0f, -1.0f, NULL); + i_this->m2B4->setAnm( + (J3DAnmTransform*)dComIfG_getObjectRes("Bmdfoot", bckFileIdx), + loopMode, morf, speed, 0.0f, -1.0f, + NULL + ); } } @@ -101,15 +107,17 @@ void housi_off(bmdfoot_class* i_this) { /* 00000440-00000840 .text wait__FP13bmdfoot_class */ void wait(bmdfoot_class* i_this) { - /* Nonmatching - regalloc */ + fopAc_ac_c* actor = (fopAc_ac_c*)&i_this->actor; short sVar2; int iVar3; cXyz local_98; static s32 eff_id[] = {0x0A, 0x0C, 0x11}; + s32 i; iVar3 = i_this->m2B4->getFrame(); local_98.setall(0.0f); - for (s32 i = 0; i < (s32)ARRAY_SIZE(i_this->m3F8); i++) { + + for (i = 0; i < (s32)ARRAY_SIZE(i_this->m3F8); i++) { MTXCopy(i_this->m2B4->getModel()->getAnmMtx(eff_id[i]), *calc_mtx); MtxPosition(&local_98, &i_this->m3F8[i]); if (i_this->m3F4 == 0) { @@ -123,10 +131,12 @@ void wait(bmdfoot_class* i_this) { } } } + i_this->m3F4 = 1; + switch (i_this->m2BC) { case -1: - for (s32 i = 2; i <= (s32)ARRAY_SIZE(i_this->m3A4); i++) { + for (i = 2; i <= (s32)ARRAY_SIZE(i_this->m3A4); i++) { cLib_addCalc2(&i_this->m2CC[i].x, (s32)(0x10U - i) * (0.003f + REG12_F(3)), 0.1f, (0.008f + REG12_F(4))); i_this->m3A4[i] = 0.0f; } @@ -141,14 +151,14 @@ void wait(bmdfoot_class* i_this) { anm_init(i_this, BMDFOOT_BCK_ASI_WAIT, 50.0f, J3DFrameCtrl::EMode_LOOP, (cM_rndF(0.2f) + 0.9f), -1); i_this->m2C0[0] = (s16)(int)(cM_rndF(150.0f) + 100.0f); i_this->m3EC = (s16)(int)cM_rndFX(32768.0f); - for (s32 i = 2; i <= (s32)ARRAY_SIZE(i_this->m3A4); i++) { + for (i = 2; i <= (s32)ARRAY_SIZE(i_this->m3A4); i++) { i_this->m3A4[i] = REG14_F(13) + (0.2f + cM_rndFX(0.1f)); } break; case 1: - i_this->m3EC = (i_this->m3EC + REG14_S(4) + 0x200); + i_this->m3EC = (i_this->m3EC + (s16)(REG14_S(4) + 0x200)); if (boss->m332 == 1) { - sVar2 = i_this->current.angle.y - fopAcM_searchPlayerAngleY(i_this); + sVar2 = actor->current.angle.y - fopAcM_searchPlayerAngleY(actor); if (sVar2 < 0) { sVar2 = -sVar2; } @@ -172,11 +182,13 @@ void wait(bmdfoot_class* i_this) { /* 0000087C-00000D8C .text attack_1__FP13bmdfoot_class */ void attack_1(bmdfoot_class* i_this) { - /* Nonmatching - regalloc */ + /* Nonmatching - retail-only regalloc */ + fopAc_ac_c* actor = (fopAc_ac_c*)&i_this->actor; bool bVar2; short sVar3; short sVar5; J3DModel* pJVar9; + s32 i; cXyz local_5c; cXyz cStack_68; static s32 jno[] = {0x0A, 0x0C, 0x11}; @@ -184,9 +196,10 @@ void attack_1(bmdfoot_class* i_this) { bVar2 = false; local_5c.setall(0.0f); + switch (i_this->m2BC) { case 0: - i_this->m2C0[0] = (s16)(int)cM_rndF(20.0f); + i_this->m2C0[0] = cM_rndF(20.0f); i_this->m2BC++; case 1: i_this->mBC4 = 0.0f; @@ -210,7 +223,7 @@ void attack_1(bmdfoot_class* i_this) { if (i_this->mBD0 == 0) { i_this->mBD0 = 0x1e; } - for (s32 i = 2; i <= (s32)ARRAY_SIZE(i_this->m3A4); i++) { + for (i = 2; i <= (s32)ARRAY_SIZE(i_this->m3A4); i++) { i_this->m3A4[i] = 0.0f; cLib_addCalc0(&i_this->m2CC[i].z, 0.1f, 0.05f); } @@ -218,13 +231,13 @@ void attack_1(bmdfoot_class* i_this) { anm_init(i_this, BMDFOOT_BCK_ASI_ATTACK2, 1.0f, J3DFrameCtrl::EMode_NONE, 1.0f, -1); i_this->m2BC++; i_this->m2C0[0] = REG14_S(2) + 0x1c; - mDoAud_seStart(JA_SE_CM_BKM_ATKVINE_PREP, &i_this->mAE8, 0, dComIfGp_getReverb(fopAcM_GetRoomNo(i_this))); + mDoAud_seStart(JA_SE_CM_BKM_ATKVINE_PREP, &i_this->mAE8, 0, dComIfGp_getReverb(fopAcM_GetRoomNo(actor))); } break; case 4: bVar2 = true; if (i_this->m2C0[0] == 1) { - mDoAud_seStart(JA_SE_CM_BKM_ATKVINE_ATTACK, &i_this->mAE8, 0, dComIfGp_getReverb(fopAcM_GetRoomNo(i_this))); + mDoAud_seStart(JA_SE_CM_BKM_ATKVINE_ATTACK, &i_this->mAE8, 0, dComIfGp_getReverb(fopAcM_GetRoomNo(actor))); for (s32 i = 0; i < (s32)ARRAY_SIZE(jno); i++) { MTXCopy(i_this->m2B4->getModel()->getAnmMtx(jno[i]), *calc_mtx); MtxPosition(&local_5c, &cStack_68); @@ -239,25 +252,27 @@ void attack_1(bmdfoot_class* i_this) { } break; } - sVar3 = fopAcM_searchPlayerAngleY(i_this) - i_this->current.angle.y; + + sVar3 = fopAcM_searchPlayerAngleY(actor) - actor->current.angle.y; if (sVar3 > l_HIO.m06) { - sVar5 = sVar3; - } else if (sVar3 < -l_HIO.m06) { + sVar5 = l_HIO.m06; + } else if (sVar3 < (s16)-l_HIO.m06) { sVar5 = -l_HIO.m06; } else { - sVar5 = l_HIO.m06; + sVar5 = sVar3; } cLib_addCalcAngleS2(&i_this->m2BE, sVar5, 4, i_this->mBC4 + 128.0f); cLib_addCalc2(&i_this->mBC4, 10000.0f, 1.0f, REG0_F(7) + 20.0f); + if (bVar2) { pJVar9 = i_this->m2B4->getModel(); - for (s32 i = 0; i < (s32)ARRAY_SIZE(i_this->m50C); i++) { - MTXCopy(pJVar9->getAnmMtx(((int)i_this->m2B8 & 7U) + col_joint[i]), *calc_mtx); + for (i = 0; i < (s32)ARRAY_SIZE(i_this->m50C); i++) { + MTXCopy(pJVar9->getAnmMtx((i_this->m2B8 & 7U) + col_joint[i]), *calc_mtx); MtxPosition(&local_5c, &cStack_68); i_this->m50C[i].SetC(cStack_68); i_this->m50C[i].SetR(40.0f); i_this->m50C[i].OnAtSetBit(); - i_this->m50C[i].ClrCoSet(); + i_this->m50C[i].OffCoSetBit(); dComIfG_Ccsp()->Set(&i_this->m50C[i]); } } @@ -265,6 +280,7 @@ void attack_1(bmdfoot_class* i_this) { /* 00000D8C-00001180 .text ug_move__FP13bmdfoot_class */ s32 ug_move(bmdfoot_class* i_this) { + fopAc_ac_c* actor = (fopAc_ac_c*)&i_this->actor; u32 uVar4; f32 dVar5; f32 dVar6; @@ -279,14 +295,14 @@ s32 ug_move(bmdfoot_class* i_this) { case 0: break; case 1: - i_this->mBAC = i_this->current.pos; + i_this->mBAC = actor->current.pos; i_this->mBAC.y = boss->m328; - i_this->mBB8.y = i_this->current.angle.y; + i_this->mBB8.y = actor->current.angle.y; i_this->mBC0 = 0.0f; i_this->mBA8 = 2; fVar7 = cM_rndF(10000.0f); i_this->m2B8 = (s16)(int)fVar7; - dComIfGp_particle_setToon(dPa_name::ID_SCENE_A0FC, &i_this->mBAC, &i_this->mBB8, NULL, 0xB9, &i_this->m4B0, (u8)i_this->current.roomNo); + dComIfGp_particle_setToon(dPa_name::ID_SCENE_A0FC, &i_this->mBAC, &i_this->mBB8, NULL, 0xB9, &i_this->m4B0, (u8)actor->current.roomNo); break; case 0xa: break; @@ -298,11 +314,13 @@ s32 ug_move(bmdfoot_class* i_this) { dVar5 = (REG14_F(14) + 10000.0f); } dVar6 = cM_ssin(i_this->m2B8 * (REG14_S(3) + 2000)); - cLib_addCalcAngleS2(&i_this->mBB8.y, (s16)(dVar5 * dVar6) + cM_atan2s(local_64.x, local_64.z), 0x10, 0x2000); + s16 r28 = dVar5 * dVar6; + s16 r4 = r28 + cM_atan2s(local_64.x, local_64.z); + cLib_addCalcAngleS2(&i_this->mBB8.y, r4, 0x10, 0x2000); local_4c.y = 0.0f; local_4c.x = 0.0f; local_4c.z = REG14_F(16) + 20.0f; - mDoMtx_YrotS(*calc_mtx, (int)i_this->mBB8.y); + cMtx_YrotS(*calc_mtx, (int)i_this->mBB8.y); MtxPosition(&local_4c, &cStack_58); i_this->mBAC += cStack_58; i_this->mBC0 = i_this->mBC0 + local_4c.z; @@ -317,8 +335,9 @@ s32 ug_move(bmdfoot_class* i_this) { break; } MtxTrans(i_this->mBAC.x, i_this->mBAC.y, i_this->mBAC.z, false); - mDoMtx_YrotM(*calc_mtx, i_this->mBB8.y); - i_this->mAF4->getModel()->setBaseTRMtx(*calc_mtx); + cMtx_YrotM(*calc_mtx, i_this->mBB8.y); + J3DModel* model = i_this->mAF4->getModel(); + model->setBaseTRMtx(*calc_mtx); i_this->mAF4->play(NULL, 0, 0); i_this->mAF4->calc(); return uVar4; @@ -326,7 +345,7 @@ s32 ug_move(bmdfoot_class* i_this) { /* 00001180-00001B00 .text attack_2__FP13bmdfoot_class */ void attack_2(bmdfoot_class* i_this) { - /* Nonmatching - .data */ + fopAc_ac_c* actor = (fopAc_ac_c*)&i_this->actor; bool bVar1; J3DAnmTransform* pJVar2; cXyz local_3c; @@ -357,7 +376,7 @@ void attack_2(bmdfoot_class* i_this) { dComIfGp_particle_setSimple(dPa_name::ID_SCENE_8065, &local_48, 0xFF, g_whiteColor, g_whiteColor, 0); dComIfGp_particle_setSimple(dPa_name::ID_SCENE_8066, &local_48, 0xFF, g_whiteColor, g_whiteColor, 0); dComIfGp_particle_setSimple(dPa_name::ID_SCENE_A06A, &local_48, 0xB9, g_whiteColor, g_whiteColor, 0); - mDoAud_seStart(JA_SE_CM_BKM_ATKVINE_IN_G, &i_this->mAE8, 0, dComIfGp_getReverb(fopAcM_GetRoomNo(i_this))); + mDoAud_seStart(JA_SE_CM_BKM_ATKVINE_IN_G, &i_this->mAE8, 0, dComIfGp_getReverb(fopAcM_GetRoomNo(actor))); } if (i_this->m2B4->isStop()) { anm_init(i_this, BMDFOOT_BCK_ASI_UMARU_WAIT, 10.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, -1); @@ -366,7 +385,7 @@ void attack_2(bmdfoot_class* i_this) { } break; case 3: - mDoAud_seStart(JA_SE_CM_BKM_ATKVINE_DIG, &i_this->mBAC, 0, dComIfGp_getReverb(fopAcM_GetRoomNo(i_this))); + mDoAud_seStart(JA_SE_CM_BKM_ATKVINE_DIG, &i_this->mBAC, 0, dComIfGp_getReverb(fopAcM_GetRoomNo(actor))); if (ug_move(i_this)) { pJVar2 = (J3DAnmTransform*)dComIfG_getObjectRes("Bmdfoot", BMDFOOT_BCK_ASI_DATTACK1); i_this->mAF4->setAnm(pJVar2, J3DFrameCtrl::EMode_NONE, 1.0f, 1.0f, 0.0f, -1.0f, NULL); @@ -379,7 +398,7 @@ void attack_2(bmdfoot_class* i_this) { dComIfGp_particle_setSimple(dPa_name::ID_SCENE_8065, &local_48, 0xFF, g_whiteColor, g_whiteColor, 0); dComIfGp_particle_setSimple(dPa_name::ID_SCENE_8066, &local_48, 0xFF, g_whiteColor, g_whiteColor, 0); dComIfGp_particle_setSimple(dPa_name::ID_SCENE_A06A, &local_48, 0xB9, g_whiteColor, g_whiteColor, 0); - mDoAud_seStart(JA_SE_CM_BKM_ATKVINE_OUT_G, &i_this->mBAC, 0, dComIfGp_getReverb(fopAcM_GetRoomNo(i_this))); + mDoAud_seStart(JA_SE_CM_BKM_ATKVINE_OUT_G, &i_this->mBAC, 0, dComIfGp_getReverb(fopAcM_GetRoomNo(actor))); } ug_move(i_this); bVar1 = true; @@ -392,7 +411,7 @@ void attack_2(bmdfoot_class* i_this) { break; case 5: ug_move(i_this); - mDoAud_seStart(JA_SE_CM_BKM_ATKVINE_L_ATK, &i_this->mBAC, 0, dComIfGp_getReverb(fopAcM_GetRoomNo(i_this))); + mDoAud_seStart(JA_SE_CM_BKM_ATKVINE_L_ATK, &i_this->mBAC, 0, dComIfGp_getReverb(fopAcM_GetRoomNo(actor))); for (s32 i = 0; i < (s32)ARRAY_SIZE(col_joint); i++) { MTXCopy(i_this->mAF4->getModel()->getAnmMtx(col_joint[i]), *calc_mtx); MtxPosition(&local_3c, &local_48); @@ -414,26 +433,26 @@ void attack_2(bmdfoot_class* i_this) { i_this->m498[0].x = i_this->mBAC.x; i_this->m498[0].y = i_this->mBAC.y; i_this->m498[0].z = i_this->mBAC.z; - dComIfGp_particle_setToon(dPa_name::ID_SCENE_A0FB, &i_this->m498[0], NULL, NULL, 0xB9, &i_this->m458[0], (u8)i_this->current.roomNo); - mDoAud_seStart(JA_SE_CM_BKM_ATKVINE_IN_G2, &i_this->mBAC, 0, dComIfGp_getReverb(fopAcM_GetRoomNo(i_this))); + dComIfGp_particle_setToon(dPa_name::ID_SCENE_A0FB, &i_this->m498[0], NULL, NULL, 0xB9, &i_this->m458[0], (u8)actor->current.roomNo); + mDoAud_seStart(JA_SE_CM_BKM_ATKVINE_IN_G2, &i_this->mBAC, 0, dComIfGp_getReverb(fopAcM_GetRoomNo(actor))); } if (i_this->mAF4->isStop()) { anm_init(i_this, BMDFOOT_BCK_ASI_NUKU, 5.0f, J3DFrameCtrl::EMode_NONE, 1.0f, -1); i_this->m2BC++; i_this->mBA8 = 0; - mDoAud_seStart(JA_SE_CM_BKM_ATKVINE_OUT_G2, &i_this->mAE8, 0, dComIfGp_getReverb(fopAcM_GetRoomNo(i_this))); + mDoAud_seStart(JA_SE_CM_BKM_ATKVINE_OUT_G2, &i_this->mAE8, 0, dComIfGp_getReverb(fopAcM_GetRoomNo(actor))); } break; case 7: if ((s32)i_this->m2B4->getFrame() == 13) { - local_48 = i_this->current.pos; + local_48 = actor->current.pos; local_48.y = i_this->mBAC.y; dComIfGp_particle_set(dPa_name::ID_SCENE_80F9, &local_48); dComIfGp_particle_set(dPa_name::ID_SCENE_80FA, &local_48); i_this->m498[1].x = local_48.x; i_this->m498[1].y = local_48.y; i_this->m498[1].z = local_48.z; - dComIfGp_particle_setToon(dPa_name::ID_SCENE_A0FB, &i_this->m498[1], NULL, NULL, 0xB9, &i_this->m458[1], (u8)i_this->current.roomNo); + dComIfGp_particle_setToon(dPa_name::ID_SCENE_A0FB, &i_this->m498[1], NULL, NULL, 0xB9, &i_this->m458[1], (u8)actor->current.roomNo); } if (i_this->m2B4->isStop()) { i_this->m2BA = 0; @@ -451,6 +470,7 @@ void attack_2(bmdfoot_class* i_this) { /* 00001B00-00001CDC .text damage__FP13bmdfoot_class */ void damage(bmdfoot_class* i_this) { + fopAc_ac_c* actor = (fopAc_ac_c*)&i_this->actor; f32 dVar5; float fVar9; @@ -466,7 +486,7 @@ void damage(bmdfoot_class* i_this) { } case 1: if (i_this->m2C0[0] != 0) { - dVar5 = ((i_this->base.mParameters & 0xf) * 0.01f); + dVar5 = ((fopAcM_GetParam(actor) & 0xf) * 0.01f); for (s32 i = 2; i <= (s32)ARRAY_SIZE(i_this->m3A4); i++) { cLib_addCalc2(&i_this->m2CC[i].x, -(dVar5 + (0.05f + ((i) * (0.03f + REG14_F(3))))), 0.1f, REG14_F(4) + 0.1f); } @@ -482,10 +502,13 @@ void damage(bmdfoot_class* i_this) { /* 00001CDC-00001ED8 .text start__FP13bmdfoot_class */ void start(bmdfoot_class* i_this) { + fopAc_ac_c* actor = (fopAc_ac_c*)&i_this->actor; + for (s32 i = 2; i <= (s32)ARRAY_SIZE(i_this->m3A4); i++) { i_this->m2CC[i].z = 0; i_this->m3A4[i] = 0; } + switch (i_this->m2BC) { case 0: if (boss->m332 == 6) { @@ -508,7 +531,7 @@ void start(bmdfoot_class* i_this) { break; case 3: if ((s32)i_this->m2B4->getFrame() == 2) { - mDoAud_seStart(JA_SE_CM_BKM_ATKVINE_MOVE_1, &i_this->mAE8, 0, dComIfGp_getReverb(fopAcM_GetRoomNo(i_this))); + mDoAud_seStart(JA_SE_CM_BKM_ATKVINE_MOVE_1, &i_this->mAE8, 0, dComIfGp_getReverb(fopAcM_GetRoomNo(actor))); } if (boss->m332 == 7) { i_this->m2BA = 0; @@ -534,23 +557,23 @@ void end(bmdfoot_class* i_this) { /* 00001FB8-000021B8 .text move__FP13bmdfoot_class */ void move(bmdfoot_class* i_this) { - /* Nonmatching - .data */ + fopAc_ac_c* actor = (fopAc_ac_c*)&i_this->actor; s16 sVar1; cXyz local_20; cXyz cStack_2c; if (boss != NULL) { - sVar1 = (u16)(i_this->base.mParameters & 0xF) << 13; - mDoMtx_YrotS(*calc_mtx, boss->shape_angle.y); - mDoMtx_XrotM(*calc_mtx, boss->shape_angle.x); - mDoMtx_ZrotM(*calc_mtx, boss->shape_angle.z); - mDoMtx_YrotM(*calc_mtx, sVar1); - i_this->current.angle.y = sVar1 + boss->shape_angle.y; + sVar1 = (u16)(fopAcM_GetParam(actor) & 0xF) << 13; + cMtx_YrotS(*calc_mtx, boss->shape_angle.y); + cMtx_XrotM(*calc_mtx, boss->shape_angle.x); + cMtx_ZrotM(*calc_mtx, boss->shape_angle.z); + cMtx_YrotM(*calc_mtx, sVar1); + actor->current.angle.y = sVar1 + boss->shape_angle.y; local_20.x = 0.0f; local_20.y = REG14_F(3); local_20.z = REG14_F(4) + 180.0f; MtxPosition(&local_20, &cStack_2c); - i_this->current.pos = boss->current.pos + cStack_2c; + actor->current.pos = boss->current.pos + cStack_2c; switch (i_this->m2BA) { case 0: wait(i_this); @@ -584,9 +607,9 @@ void move(bmdfoot_class* i_this) { } /* 000021B8-00002204 .text s_a_d_sub__FPvPv */ -void* s_a_d_sub(void* i_this, void* param_2) { - if ((fopAc_IsActor(i_this)) && (fopAcM_GetName(i_this) == PROC_BMD)) { - return i_this; +void* s_a_d_sub(void* search, void* param_2) { + if ((fopAc_IsActor(search)) && (fopAcM_GetName(search) == PROC_BMD)) { + return search; } else { return NULL; } @@ -594,15 +617,17 @@ void* s_a_d_sub(void* i_this, void* param_2) { /* 00002204-00002594 .text daBmdfoot_Execute__FP13bmdfoot_class */ static BOOL daBmdfoot_Execute(bmdfoot_class* i_this) { + fopAc_ac_c* actor = (fopAc_ac_c*)&i_this->actor; short sVar1; J3DModel* pJVar5; cXyz local_68; + s32 i; if (boss == NULL) { boss = (bmd_class*)fpcM_Search(s_a_d_sub, i_this); } i_this->m2B8++; - for (s32 i = 0; i < (s32)ARRAY_SIZE(i_this->m2C0); i++) { + for (i = 0; i < (s32)ARRAY_SIZE(i_this->m2C0); i++) { if (i_this->m2C0[i] != 0) { i_this->m2C0[i]--; } @@ -611,23 +636,23 @@ static BOOL daBmdfoot_Execute(bmdfoot_class* i_this) { i_this->m2C8[0]--; } move(i_this); - MtxTrans(i_this->current.pos.x, i_this->current.pos.y, i_this->current.pos.z, false); - mDoMtx_YrotM(*calc_mtx, i_this->current.angle.y + i_this->m2BE); - mDoMtx_XrotM(*calc_mtx, i_this->current.angle.x); - mDoMtx_ZrotM(*calc_mtx, i_this->current.angle.z + ((int)i_this->m2BE << 1)); + MtxTrans(actor->current.pos.x, actor->current.pos.y, actor->current.pos.z, false); + cMtx_YrotM(*calc_mtx, actor->current.angle.y + i_this->m2BE); + cMtx_XrotM(*calc_mtx, actor->current.angle.x); + cMtx_ZrotM(*calc_mtx, actor->current.angle.z + i_this->m2BE * 2); pJVar5 = i_this->m2B4->getModel(); - MTXCopy(*calc_mtx, pJVar5->getBaseTRMtx()); + pJVar5->setBaseTRMtx(*calc_mtx); i_this->m2B4->play(NULL, 0, 0); i_this->m2B4->calc(); if (i_this->mBD0 != 0) { if (i_this->mBD0 == 0x1e) { - mDoAud_seStart(JA_SE_CM_BKM_ATKVINE_MOVE_2, &i_this->mAE8, 0, dComIfGp_getReverb(fopAcM_GetRoomNo(i_this))); + mDoAud_seStart(JA_SE_CM_BKM_ATKVINE_MOVE_2, &i_this->mAE8, 0, dComIfGp_getReverb(fopAcM_GetRoomNo(actor))); } i_this->mBD0 = i_this->mBD0 + -1; } - sVar1 = 0x1d - i_this->mBD0; - if (sVar1 >= 0x1E) { - sVar1 = sVar1 % 0x1e; + sVar1 = 29 - i_this->mBD0; + if (sVar1 >= 30) { + sVar1 = sVar1 % 30; } i_this->btk->setFrame(sVar1); MTXCopy(pJVar5->getAnmMtx(REG14_S(6) + 0x10), *calc_mtx); @@ -639,14 +664,16 @@ static BOOL daBmdfoot_Execute(bmdfoot_class* i_this) { i_this->mAE8.y = boss->m328; } cLib_addCalcAngleS2(&i_this->m2BE, 0, 0x10, 0x80); + s16 sVar1_2; if (i_this->m2BA < 3) { - sVar1 = l_HIO.m08; + sVar1_2 = l_HIO.m08; } else { - sVar1 = REG0_S(4); + sVar1_2 = REG0_S(4); } - cLib_addCalcAngleS2(&i_this->current.angle.x, sVar1, 0x10, 0x80); - for (s32 i = 2; i <= (s32)ARRAY_SIZE(i_this->m3A4); i++) { - cLib_addCalc2(&i_this->m2CC[i].z, i_this->m3A4[i] * cM_ssin(i_this->m3EC + i * (REG0_S(6) + 9000)), 0.05f, 0.01f + REG14_F(5)); + cLib_addCalcAngleS2(&actor->current.angle.x, sVar1_2, 0x10, 0x80); + for (i = 2; i <= (s32)ARRAY_SIZE(i_this->m3A4); i++) { + f32 f1 = i_this->m3A4[i] * cM_ssin(i_this->m3EC + i * (REG0_S(6) + 9000)); + cLib_addCalc2(&i_this->m2CC[i].z, f1, 0.05f, 0.01f + REG14_F(5)); cLib_addCalc0(&i_this->m2CC[i].x, 0.05f, 0.005f + REG14_F(5)); } return TRUE; @@ -659,7 +686,7 @@ static BOOL daBmdfoot_IsDelete(bmdfoot_class*) { /* 0000259C-000026B0 .text daBmdfoot_Delete__FP13bmdfoot_class */ static BOOL daBmdfoot_Delete(bmdfoot_class* i_this) { - dComIfG_resDelete(&i_this->m2AC, "Bmdfoot"); + dComIfG_resDeleteDemo(&i_this->m2AC, "Bmdfoot"); if (i_this->mBD2 != 0) { hio_set = 0; mDoHIO_deleteChild(l_HIO.mNo); @@ -702,54 +729,58 @@ s32 useHeapInit(bmdfoot_class* i_this) { pJVar9 = i_this->m2B4->getModel(); if (pJVar9 == NULL) { return FALSE; - } else if (i_this->m2B4 == NULL) { - return FALSE; - } else { - pJVar9->setUserArea((u32)i_this); - for (u16 uVar16 = 0; uVar16 < pJVar9->getModelData()->getJointNum(); uVar16++) { - pJVar9->getModelData()->getJointNodePointer(uVar16)->setCallBack(nodeCallBack); - } - pmVar5 = new mDoExt_btkAnm(); - i_this->btk = pmVar5; - JUT_ASSERT(0x592, i_this->btk); - pAnm = (J3DAnmTextureSRTKey*)dComIfG_getObjectRes("Bmdfoot", BMDFOOT_BTK_ASI); - iVar7 = i_this->btk->init(pJVar9->getModelData(), pAnm, true, J3DFrameCtrl::EMode_NONE, 1.0f, 0, -1, false, 0); - if (iVar7 == 0) { - return FALSE; - } else { - pmVar1 = new mDoExt_McaMorf( - (J3DModelData*)dComIfG_getObjectRes("Bmdfoot", BMDFOOT_BMD_ASI), - NULL, - NULL, - (J3DAnmTransformKey*)dComIfG_getObjectRes("Bmdfoot", BMDFOOT_BCK_ASI_WAIT), - J3DFrameCtrl::EMode_LOOP, - cM_rndF(0.2f) + 0.9f, - 0, - -1, - 1, - NULL, - 0, - 0x11020203 - ); - i_this->mAF4 = pmVar1; - if (i_this->mAF4->getModel() == NULL) { - return FALSE; - } else { - return TRUE; - } - } } +#if VERSION > VERSION_DEMO + if (i_this->m2B4 == NULL) { + return FALSE; + } +#endif + + pJVar9->setUserArea((u32)i_this); + for (u16 uVar16 = 0; uVar16 < pJVar9->getModelData()->getJointNum(); uVar16++) { + pJVar9->getModelData()->getJointNodePointer(uVar16)->setCallBack(nodeCallBack); + } + pmVar5 = new mDoExt_btkAnm(); + i_this->btk = pmVar5; + JUT_ASSERT(DEMO_SELECT(1416, 1426), i_this->btk); + pAnm = (J3DAnmTextureSRTKey*)dComIfG_getObjectRes("Bmdfoot", BMDFOOT_BTK_ASI); + iVar7 = i_this->btk->init(pJVar9->getModelData(), pAnm, true, J3DFrameCtrl::EMode_NONE, 1.0f, 0, -1, false, 0); +#if VERSION > VERSION_DEMO + if (iVar7 == 0) { + return FALSE; + } +#endif + + pmVar1 = new mDoExt_McaMorf( + (J3DModelData*)dComIfG_getObjectRes("Bmdfoot", BMDFOOT_BMD_ASI), + NULL, + NULL, + (J3DAnmTransformKey*)dComIfG_getObjectRes("Bmdfoot", BMDFOOT_BCK_ASI_WAIT), + J3DFrameCtrl::EMode_LOOP, + cM_rndF(0.2f) + 0.9f, + 0, + -1, + 1, + NULL, + 0, + 0x11020203 + ); + i_this->mAF4 = pmVar1; + if (i_this->mAF4->getModel() == NULL) { + return FALSE; + } + + return TRUE; } /* 000029FC-00002A1C .text solidHeapCB__FP10fopAc_ac_c */ static BOOL solidHeapCB(fopAc_ac_c* a_this) { bmdfoot_class* i_this = (bmdfoot_class*)a_this; - useHeapInit(i_this); + return useHeapInit(i_this); } /* 00002A1C-00002E88 .text daBmdfoot_Create__FP10fopAc_ac_c */ static cPhs_State daBmdfoot_Create(fopAc_ac_c* a_this) { - /* Nonmatching - .data */ static dCcD_SrcSph cc_sph_src = { // dCcD_SrcGObjInf { @@ -790,7 +821,7 @@ static cPhs_State daBmdfoot_Create(fopAc_ac_c* a_this) { } i_this->m458[0].setFollowOff(); i_this->m458[1].setFollowOff(); - if (!fopAcM_entrySolidHeap(i_this, solidHeapCB, 0x5040)) { + if (!fopAcM_entrySolidHeap(a_this, solidHeapCB, 0x5040)) { return cPhs_ERROR_e; } if (hio_set == 0) { @@ -798,22 +829,24 @@ static cPhs_State daBmdfoot_Create(fopAc_ac_c* a_this) { i_this->mBD2 = 1; l_HIO.mNo = mDoHIO_createChild("森ボス足", &l_HIO); // Forest boss feet } - i_this->health = 2; + a_this->health = 2; i_this->m2B8 = (s16)(int)cM_rndF(10000.0f); boss = NULL; - i_this->m4D0.Init(0xFF, 0, i_this); + i_this->m4D0.Init(0xFF, 0, a_this); for (s32 i = 0; i < (s32)ARRAY_SIZE(i_this->m50C); i++) { i_this->m50C[i].SetStts(&i_this->m4D0); i_this->m50C[i].Set(cc_sph_src); } - i_this->attention_info.position.y = -20000.0f; - i_this->eyePos.y = -20000.0f; + a_this->attention_info.position.y = -20000.0f; + a_this->eyePos.y = -20000.0f; if (!(g_dComIfG_gameInfo.save.getMemory().getBit().isStageBossDemo()) && (dComIfGp_getStartStageName()[0] != 'X')) { i_this->m2BA = 10; } else { i_this->mBC8 = 1; } - i_this->mAF8 = i_this->tevStr; +#if VERSION > VERSION_DEMO + i_this->mAF8 = a_this->tevStr; +#endif return cPhs_COMPLEATE_e; } diff --git a/src/d/actor/d_a_btd.cpp b/src/d/actor/d_a_btd.cpp index 51e561306..987f09df5 100644 --- a/src/d/actor/d_a_btd.cpp +++ b/src/d/actor/d_a_btd.cpp @@ -557,7 +557,7 @@ void kubi_calc(btd_class* i_this) { mDoMtx_XrotM(*calc_mtx, i_this->m6E74.x); mDoMtx_ZrotM(*calc_mtx, i_this->m6E74.z); J3DModel* model = i_this->m02D4->getModel(); - MTXCopy(*calc_mtx, model->getBaseTRMtx()); + model->setBaseTRMtx(*calc_mtx); i_this->m02D4->calc(); i_this->m02D8->play(); i_this->m02DC->play(); diff --git a/src/d/actor/d_a_jbo.cpp b/src/d/actor/d_a_jbo.cpp index dd0ab6fad..f4b003273 100644 --- a/src/d/actor/d_a_jbo.cpp +++ b/src/d/actor/d_a_jbo.cpp @@ -50,7 +50,7 @@ void jbo_draw_SUB(jbo_class *i_this) { mDoMtx_stack_c::scaleM(scale); mDoMtx_stack_c::YrotM(-i_this->mAnimRotation); } - MTXCopy(mDoMtx_stack_c::now, model->getBaseTRMtx()); + model->setBaseTRMtx(mDoMtx_stack_c::get()); } /* 00000240-000002C4 .text daJBO_Draw__FP9jbo_class */