diff --git a/configure.py b/configure.py index 53830249e..598a8ed04 100755 --- a/configure.py +++ b/configure.py @@ -1596,7 +1596,7 @@ config.libs = [ ActorRel(NonMatching, "d_a_klft"), ActorRel(NonMatching, "d_a_kmon"), ActorRel(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d_a_komore"), - ActorRel(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d_a_lbridge"), + ActorRel(Matching, "d_a_lbridge"), ActorRel(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d_a_leaflift"), ActorRel(NonMatching, "d_a_lstair"), ActorRel(Matching, "d_a_machine"), diff --git a/include/d/actor/d_a_bpw.h b/include/d/actor/d_a_bpw.h index 2a393127f..238a05460 100644 --- a/include/d/actor/d_a_bpw.h +++ b/include/d/actor/d_a_bpw.h @@ -94,8 +94,9 @@ struct bpw_class { /* 0x3FC */ fpc_ProcID m3FC; /* 0x400 */ fpc_ProcID m400; /* 0x404 */ fpc_ProcID m404; + #if VERSION > VERSION_DEMO /* 0x408 */ s16 m408; - /* 0x40A */ u8 m40A[0x40C - 0x40A]; + #endif /* 0x40C */ cXyz m40C; /* 0x418 */ cXyz m418; /* 0x424 */ cXyz m424; @@ -132,13 +133,29 @@ struct bpw_class { /* 0x4AC */ int mChildPoeIds[15]; /* 0x4E8 */ u32 m4E8; /* 0x4EC */ LIGHT_INFLUENCE m4EC; + #if VERSION == VERSION_DEMO + /* 0x508 */ JPABaseEmitter* m508_demo; + /* 0x50C */ JPABaseEmitter* m50C_demo; + /* 0x510 */ JPABaseEmitter* m510_demo; + #endif /* 0x50C */ dPa_smokeEcallBack m50C; + #if VERSION == VERSION_DEMO + /* 0x534 */ JPABaseEmitter* m534_demo; + /* 0x538 */ JPABaseEmitter* m538_demo; + /* 0x53C */ JPABaseEmitter* m53C_demo; + /* 0x540 */ JPABaseEmitter* m540_demo; + #else /* 0x52C */ dPa_followEcallBack m52C; /* 0x540 */ dPa_followEcallBack m540; + #endif /* 0x554 */ dPa_followEcallBack m554; /* 0x568 */ dPa_followEcallBack mFire1Dousa_Pa_followEcallBack; /* 0x57C */ dPa_followEcallBack mFire1Dousa_Pa_followEcallBack2; /* 0x590 */ dPa_followEcallBack m590; + #if VERSION == VERSION_DEMO + /* 0x594 */ JPABaseEmitter* m594_demo; + /* 0x598 */ JPABaseEmitter* m598_demo; + #endif /* 0x5A4 */ dPa_followEcallBack mFireDousa2_Pa_followEcallBack; /* 0x5B8 */ dPa_followEcallBack mFireDousa2_Pa_followEcallBack2; /* 0x5CC */ dPa_followEcallBack m5CC; diff --git a/include/d/d_com_inf_game.h b/include/d/d_com_inf_game.h index 142fb0dbb..60d39b039 100644 --- a/include/d/d_com_inf_game.h +++ b/include/d/d_com_inf_game.h @@ -2667,7 +2667,7 @@ inline void dComIfGp_endMiniGame(u16 i_gameType) { g_dComIfG_gameInfo.play.endMiniGame(i_gameType); } -inline u8 dComIfGp_setMiniGameResult(u8 result) { +inline void dComIfGp_setMiniGameResult(u8 result) { g_dComIfG_gameInfo.play.setMiniGameResult(result); } diff --git a/include/m_Do/m_Do_ext.h b/include/m_Do/m_Do_ext.h index 0d67852fd..69bf040d5 100644 --- a/include/m_Do/m_Do_ext.h +++ b/include/m_Do/m_Do_ext.h @@ -186,8 +186,7 @@ public: int init(J3DModelData*, J3DAnmTransform*, int, int, f32, s16, s16, bool); - // TODO - void entry(J3DModel* i_model) {} + void entry(J3DModel* i_model) { entry(i_model, getFrame()); } private: /* 0x08 */ J3DAnmVisibilityFull* mpAnm; diff --git a/src/d/actor/d_a_arrow_iceeff.cpp b/src/d/actor/d_a_arrow_iceeff.cpp index 9e0bc26e4..7ce9ea299 100644 --- a/src/d/actor/d_a_arrow_iceeff.cpp +++ b/src/d/actor/d_a_arrow_iceeff.cpp @@ -169,7 +169,7 @@ bool daArrow_Iceeff_c::_draw() { else { g_env_light.setLightTevColorType(mpModel, &tevStr); J3DModelData* mdl_data = mpModel->getModelData(); - mBck.entry(mdl_data, mBck.getFrame()); + mBck.entry(mdl_data); if(field_0xA3C == 1) { mDoExt_modelUpdateDL(mpModel); } diff --git a/src/d/actor/d_a_arrow_lighteff.cpp b/src/d/actor/d_a_arrow_lighteff.cpp index 4b0046bfa..8c0be80b9 100644 --- a/src/d/actor/d_a_arrow_lighteff.cpp +++ b/src/d/actor/d_a_arrow_lighteff.cpp @@ -251,8 +251,8 @@ bool daArrow_Lighteff_c::_draw() { dComIfGd_setListMaskOff(); } - mBtk.entry(modelData, mBtk.getFrame()); - mBrk.entry(modelData, mBrk.getFrame()); + mBtk.entry(modelData); + mBrk.entry(modelData); mDoExt_modelUpdateDL(field_0x298); mBrk.remove(modelData); mBtk.remove(modelData); diff --git a/src/d/actor/d_a_bb.cpp b/src/d/actor/d_a_bb.cpp index 611f51427..1a4688095 100644 --- a/src/d/actor/d_a_bb.cpp +++ b/src/d/actor/d_a_bb.cpp @@ -2152,7 +2152,7 @@ void damage_check(bb_class* i_this) { dComIfGp_particle_setToon(dPa_name::ID_COMMON_0438, &a_this->current.pos, &a_this->current.angle, NULL, 0xFF, NULL, fopAcM_GetRoomNo(a_this), &a_this->tevStr.mColorK0, &a_this->tevStr.mColorK0); - i_this->mParticleCallBack.end(); + i_this->mParticleCallBack.remove(); emitter = dComIfGp_particle_setToon(dPa_name::ID_COMMON_0439, &a_this->current.pos, &a_this->current.angle, NULL, 0xFF, &i_this->mParticleCallBack, fopAcM_GetRoomNo(a_this)); @@ -2514,7 +2514,7 @@ static BOOL daBb_Delete(bb_class* i_this) { #if VERSION == VERSION_DEMO l_bbHIO.removeHIO(); #endif - i_this->mParticleCallBack.end(); + i_this->mParticleCallBack.remove(); enemy_fire_remove(&i_this->mEnemyFire); #if VERSION > VERSION_DEMO if (i_this->actor.heap != NULL) { diff --git a/src/d/actor/d_a_bdk.cpp b/src/d/actor/d_a_bdk.cpp index e176ee256..d687a9439 100644 --- a/src/d/actor/d_a_bdk.cpp +++ b/src/d/actor/d_a_bdk.cpp @@ -434,7 +434,7 @@ void kamen_draw(bdk_class* i_this) { if (i_this->m8F8 <= 3) { g_env_light.setLightTevColorType(kamen_model, &actor->tevStr); i_this->bva->setFrame(kamen_pt[i_this->m8F8]); - i_this->bva->entry(kamen_model, i_this->bva->getFrame()); + i_this->bva->entry(kamen_model); mDoExt_modelUpdateDL(kamen_model); } } @@ -1791,7 +1791,7 @@ void start(bdk_class* i_this) { } if (i_this->m2EC[0] == (s16)(REG8_S(8) + 5)) { fopAcM_monsSeStart(actor, JA_SE_CV_DK_ENTER, 0); - i_this->m61B0.end(); + i_this->m61B0.remove(); for (s32 i = 0; i < 2; i++) { JPABaseEmitter* emitter = dComIfGp_particle_set(dPa_name::ID_SCENE_8158, &actor->current.pos, &actor->shape_angle, NULL, 0xFF, NULL, (s8)fopAcM_GetRoomNo(actor), diff --git a/src/d/actor/d_a_bmd.cpp b/src/d/actor/d_a_bmd.cpp index 7932f017e..3cc467277 100644 --- a/src/d/actor/d_a_bmd.cpp +++ b/src/d/actor/d_a_bmd.cpp @@ -398,7 +398,7 @@ void eat(bmd_class* i_this) { i_this->m302 = -1; i_this->m308[0] = 0x3c; i_this->mB74 = 0x96; - dComIfGp_event_onEventFlag(8); + dComIfGp_event_reset(); i_this->m940 = -0x4000; i_this->m332 = 4; i_this->m314 = 0; @@ -840,7 +840,6 @@ void mk_voice_set(bmd_class* i_this, u32 param_2) { /* 00002F40-0000330C .text mk_move__FP9bmd_class */ void mk_move(bmd_class* i_this) { fopAc_ac_c* actor = &i_this->actor; - int iVar1; JPABaseEmitter* pJVar3; cXyz local_28; @@ -1150,8 +1149,6 @@ void ride_call_back(dBgW* bgw, fopAc_ac_c* i_ac, fopAc_ac_c* i_pt) { void demo_camera(bmd_class* i_this) { /* Nonmatching - switch case, regalloc */ fopAc_ac_c* actor = &i_this->actor; - s16 sVar2; - int iVar6; cXyz local_44; cXyz local_50; cXyz local_a4; @@ -1160,6 +1157,7 @@ void demo_camera(bmd_class* i_this) { fopAc_ac_c* player_actor = dComIfGp_getPlayer(0); daPy_py_c* player = (daPy_py_c*)dComIfGp_getPlayer(0); camera_class* camera = dComIfGp_getCamera(dComIfGp_getPlayerCameraID(0)); + switch (i_this->mB74) { case 0: break; @@ -1169,7 +1167,7 @@ void demo_camera(bmd_class* i_this) { actor->eventInfo.onCondition(dEvtCnd_UNK2_e); i_this->mB76 = 0; i_this->mB78 = 0; - break; + return; } i_this->mB74++; camera_class* camera2 = dComIfGp_getCamera(0); @@ -1259,7 +1257,7 @@ void demo_camera(bmd_class* i_this) { player->voiceStart(0x2e); } if (i_this->mB78 != 0x1e) { - return; + break; } i_this->mB78 = 0; i_this->mB74++; @@ -1269,6 +1267,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; + // Fall-through 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) { @@ -1298,12 +1297,13 @@ void demo_camera(bmd_class* i_this) { player->voiceStart(0x1d); } if (i_this->mB78 != 0x19) { - return; + break; } i_this->mB78 = 0; i_this->mB74++; i_this->mB88 = actor->eyePos; i_this->mB88.y += REG0_F(11) + 30.0f; + // Fall-through case 11: i_this->mB7C.x = -139.0f; i_this->mB7C.y = 125.0f; @@ -1399,7 +1399,7 @@ void demo_camera(bmd_class* i_this) { } if (i_this->mB76 == 0x24e) { i_this->mB74 = 0x96; - dComIfGp_event_onEventFlag(8); + dComIfGp_event_reset(); i_this->m332 = 7; i_this->mMode = 0; i_this->m302 = -1; @@ -1414,21 +1414,24 @@ void demo_camera(bmd_class* i_this) { g_dComIfG_gameInfo.save.getMemory().getBit().onStageBossDemo(); } break; - case 100: + 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; } - i_this->mB74 = sVar2 + 1; - camera = dComIfGp_getCamera(0); - i_this->mB7C = camera->mLookat.mEye; - i_this->mB88 = camera->mLookat.mCenter; + i_this->mB74++; + camera_class* camera2 = dComIfGp_getCamera(0); + i_this->mB7C = camera2->mLookat.mEye; + i_this->mB88 = camera2->mLookat.mCenter; camera->mCamera.Stop(); camera->mCamera.SetTrimSize(2); i_this->mB9C = 55.0f; player->changeOriginalDemo(); + // Fall-through + } 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; @@ -1485,9 +1488,10 @@ void demo_camera(bmd_class* i_this) { // 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, iVar6); - cLib_addCalcAngleS2(&i_this->mB94, -5000, 0x10, (int)(i_this->mBA0 * 3000.0f)); + s16 iVar6 = i_this->mBA0 * 22384.0f; + cLib_addCalcAngleS2(&i_this->mB96, (s16)(actor->shape_angle.y + REG0_S(2)) + 0x5770, 0x10, iVar6); + s16 r5 = i_this->mBA0 * 3000.0f; + cLib_addCalcAngleS2(&i_this->mB94, -5000, 0x10, r5); 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); @@ -1498,10 +1502,10 @@ void demo_camera(bmd_class* i_this) { MtxPosition(&local_44, &local_50); i_this->mB7C = actor->current.pos + local_50; i_this->mB88 = actor->current.pos; - i_this->mB88.y = i_this->mB88.y + REG0_S(3) + 100.0f; + i_this->mB88.y += REG0_S(3) + 100.0f; if (i_this->mB76 == 800) { i_this->mB74 = 0x96; - dComIfGp_event_onEventFlag(8); + dComIfGp_event_reset(); i_this->m314 = 0; player->cancelOriginalDemo(); } @@ -1515,14 +1519,16 @@ void demo_camera(bmd_class* i_this) { break; } if (i_this->mB74 != 0) { - local_b0.x = i_this->mB7C.x + i_this->mBA8 * cM_ssin(i_this->mB78 * 0x3300); - local_b0.y = i_this->mB7C.y + i_this->mBA8 * cM_scos(i_this->mB78 * 0x3000); + f32 f1 = i_this->mBA8 * cM_ssin(i_this->mB78 * 0x3300); + f32 f2 = i_this->mBA8 * cM_scos(i_this->mB78 * 0x3000); + local_b0.x = i_this->mB7C.x + f1; + local_b0.y = i_this->mB7C.y + f2; local_b0.z = i_this->mB7C.z; - local_a4.x = i_this->mB88.x + i_this->mBA8 * cM_ssin(i_this->mB78 * 0x3300); - local_a4.y = i_this->mB88.y + i_this->mBA8 * cM_scos(i_this->mB78 * 0x3000); + local_a4.x = i_this->mB88.x + f1; + local_a4.y = i_this->mB88.y + f2; local_a4.z = i_this->mB88.z; - iVar6 = (int)(i_this->mBA8 * cM_scos(i_this->m2FE * 0x1c00) * 7.5f); - camera->mCamera.Set(local_a4, local_b0, (s16)iVar6, i_this->mB9C); + s16 iVar6 = i_this->mBA8 * cM_scos(i_this->m2FE * 0x1c00) * 7.5f; + camera->mCamera.Set(local_a4, local_b0, 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); @@ -1555,10 +1561,8 @@ void bmd_kankyo(bmd_class* i_this) { /* 000055EC-00005BF4 .text daBmd_Execute__FP9bmd_class */ static BOOL daBmd_Execute(bmd_class* i_this) { - /* Nonmatching - "cMtx_YrotM" */ fopAc_ac_c* actor = &i_this->actor; f32 fVar2; - f32 in_f4; cXyz local_88; #if VERSION > VERSION_DEMO @@ -1600,7 +1604,7 @@ static BOOL daBmd_Execute(bmd_class* i_this) { i_this->pm_bgw[5]->Move(); for (s32 i = 0; i < (s32)ARRAY_SIZE(i_this->m944); i++) { MTXCopy(mDoMtx_stack_c::now, *calc_mtx); - cMtx_YrotM(*calc_mtx, 13107.2f + REG0_F(11)); + cMtx_YrotM(*calc_mtx, (i * 13107.2f) + REG0_F(11)); MtxTrans((REG0_F(4) - 200.0f), 0.0f, 0.0f, true); cMtx_ZrotM(*calc_mtx, i_this->m940); MtxTrans(-(REG0_F(4) - 200.0f), (15.0f + REG0_F(5)), REG0_F(6), true); @@ -1646,7 +1650,7 @@ static BOOL daBmd_Execute(bmd_class* i_this) { i_this->mWindInfluence.mDir.x = 0.0f; i_this->mWindInfluence.mDir.y = 1.0f; i_this->mWindInfluence.mDir.z = 0.0f; - cLib_addCalc0(&i_this->mBD8, 50.0f, in_f4); + cLib_addCalc0(&i_this->mBD8, 1.0f, 50.0f); i_this->mWindInfluence.mRadius = 2000.0f - i_this->mBD8; if (i_this->mBD8 > 1.0f) { i_this->mWindInfluence.mStrength = 1.0f; @@ -1670,7 +1674,7 @@ static BOOL daBmd_Execute(bmd_class* i_this) { } mDoMtx_stack_c::transS(0.0f, 0.1f, 0.0f); i_this->m2D0->setBaseTRMtx(mDoMtx_stack_c::get()); - i_this->m2D4->getFrameCtrl()->setFrame(i_this->m2D8); + i_this->m2D4->setFrame(i_this->m2D8); return TRUE; } @@ -1692,7 +1696,7 @@ static BOOL daBmd_Delete(bmd_class* i_this) { } } for (s32 i = 0; i < (s32)ARRAY_SIZE(i_this->mA90); i++) { - i_this->mA90[i].end(); + i_this->mA90[i].remove(); } dKyw_pntwind_cut(&i_this->mWindInfluence); mDoAud_seDeleteObject(&i_this->m2E0); diff --git a/src/d/actor/d_a_bmdfoot.cpp b/src/d/actor/d_a_bmdfoot.cpp index 7619a669f..9bcfe3c2b 100644 --- a/src/d/actor/d_a_bmdfoot.cpp +++ b/src/d/actor/d_a_bmdfoot.cpp @@ -102,7 +102,7 @@ void housi_off(bmdfoot_class* i_this) { } } if (i_this->m4B0.getEmitter() != NULL) { - i_this->m4B0.end(); + i_this->m4B0.remove(); } } @@ -329,7 +329,7 @@ s32 ug_move(bmdfoot_class* i_this) { if ((fVar7 < 300.0f) || (i_this->mBC0 > REG14_F(15) + 3000.0f)) { i_this->mBA8 = 10; if (i_this->m4B0.getEmitter() != NULL) { - i_this->m4B0.end(); + i_this->m4B0.remove(); } uVar4 = 1; } @@ -695,11 +695,11 @@ static BOOL daBmdfoot_Delete(bmdfoot_class* i_this) { mDoAud_seDeleteObject(&i_this->mAE8); mDoAud_seDeleteObject(&i_this->mBAC); for (s32 i = 0; i < (s32)ARRAY_SIZE(i_this->m41C); i++) { - i_this->m41C[i].end(); + i_this->m41C[i].remove(); } - i_this->m458[0].end(); - i_this->m458[1].end(); - i_this->m4B0.end(); + i_this->m458[0].remove(); + i_this->m458[1].remove(); + i_this->m4B0.remove(); boss = NULL; return TRUE; } diff --git a/src/d/actor/d_a_boko.cpp b/src/d/actor/d_a_boko.cpp index 95a1d5022..045f160f9 100644 --- a/src/d/actor/d_a_boko.cpp +++ b/src/d/actor/d_a_boko.cpp @@ -819,7 +819,7 @@ static BOOL daBoko_IsDelete(daBoko_c* i_this) { /* 00002A2C-00002AA4 .text bokoDelete__8daBoko_cFv */ BOOL daBoko_c::bokoDelete() { mDoAud_seDeleteObject(&m2D0); - mParticleCallBack.end(); + mParticleCallBack.remove(); dKy_plight_cut(&mLight); dComIfG_resDelete(&mPhase, m_arc_name[fopAcM_GetParam(this)]); return TRUE; diff --git a/src/d/actor/d_a_bomb2.cpp b/src/d/actor/d_a_bomb2.cpp index 602ba2b89..9917fbd33 100644 --- a/src/d/actor/d_a_bomb2.cpp +++ b/src/d/actor/d_a_bomb2.cpp @@ -617,8 +617,8 @@ namespace daBomb2 { mBombTimer = attr().field_0xA; f32 frame = 0x87 - attr().field_0xA; - mBck0.getFrameCtrl()->setFrame(frame); - mBrk0.getFrameCtrl()->setFrame(frame); + mBck0.setFrame(frame); + mBrk0.setFrame(frame); } } @@ -1263,8 +1263,8 @@ namespace daBomb2 { void Act_c::draw_nut() { J3DModelData* mdlData = (J3DModelData*)mpModel->getModelData(); - mBck0.entry(mdlData, mBck0.getFrame()); - mBrk0.entry(mdlData, mBrk0.getFrame()); + mBck0.entry(mdlData); + mBrk0.entry(mdlData); dComIfGd_setListP1(); mDoExt_modelUpdateDL(mpModel); dComIfGd_setList(); diff --git a/src/d/actor/d_a_bpw.cpp b/src/d/actor/d_a_bpw.cpp index 50b002b80..da5efc06b 100644 --- a/src/d/actor/d_a_bpw.cpp +++ b/src/d/actor/d_a_bpw.cpp @@ -16,6 +16,9 @@ #include "d/d_s_play.h" #include "f_op/f_op_camera.h" #include "m_Do/m_Do_graphic.h" +#if VERSION == VERSION_DEMO +#include "m_Do/m_Do_controller_pad.h" +#endif static bool GOUEN_FIRE_HIT; static fopAc_ac_c* check_info[100]; @@ -68,8 +71,8 @@ static BOOL body_nodeCallBack(J3DNode* node, int calcTiming) { MtxPosition(&local_28, &i_this->m3C4); } if (((jntNo == 0) || (jntNo == 2)) || (jntNo - 0x1d <= (u32)1 || (jntNo == 0x25))) { - MTXCopy(*calc_mtx, model->getAnmMtx(jntNo)); - MTXCopy(*calc_mtx, J3DSys::mCurrentMtx); + model->setAnmMtx(jntNo, *calc_mtx); + cMtx_copy(*calc_mtx, J3DSys::mCurrentMtx); } } } @@ -98,8 +101,8 @@ static BOOL kantera_nodeCallBack(J3DNode* node, int calcTiming) { MtxPosition(&local_28, &i_this->m358); } if ((jntNo == 0) || (jntNo == 1)) { - MTXCopy(*calc_mtx, model->getAnmMtx(jntNo)); - MTXCopy(*calc_mtx, J3DSys::mCurrentMtx); + model->setAnmMtx(jntNo, *calc_mtx); + cMtx_copy(*calc_mtx, J3DSys::mCurrentMtx); } } } @@ -263,11 +266,11 @@ void kantera_draw(bpw_class* i_this) { i_this->mKanteraAnim->remove(pJVar3->getModelData()); } if (i_this->m3E7 == 0) { - MTXCopy(i_this->mpAnim->getModel()->getBaseTRMtx(), *calc_mtx); + cMtx_copy(i_this->mpAnim->getModel()->getBaseTRMtx(), *calc_mtx); MtxPosition(&local_20, &local_2c); MtxTrans(local_2c.x, local_2c.y, local_2c.z, false); MtxScale(3.0f, 3.0f, 3.0f, true); - MTXCopy(*calc_mtx, i_this->m2D4); + cMtx_copy(*calc_mtx, i_this->m2D4); pdVar1.r = 0xeb; pdVar1.g = 0x7d; pdVar1.b = 0; @@ -299,7 +302,7 @@ static BOOL damage_ball_draw(bpw_class* i_this) { MtxTrans(actor->current.pos.x, actor->current.pos.y, actor->current.pos.z, false); MtxScale(0.8f, 0.8f, 0.8f, true); cMtx_YrotM(*calc_mtx, actor->shape_angle.y); - MTXCopy(*calc_mtx, i_this->m2D4); + cMtx_copy(*calc_mtx, i_this->m2D4); GXColor pdVar1; pdVar1.r = 0xeb; pdVar1.g = 0x50; @@ -337,6 +340,7 @@ void torituki_draw(bpw_class* i_this) { static BOOL daBPW_Draw(bpw_class* i_this) { fopAc_ac_c* actor = &i_this->actor; J3DModel* pJVar3 = i_this->mpAnim->getModel(); + #if VERSION > VERSION_DEMO if (i_this->m408 > 1) { mDoGph_gInf_c::setBlureRate(i_this->m408); mDoGph_gInf_c::onBlure(); @@ -344,6 +348,7 @@ static BOOL daBPW_Draw(bpw_class* i_this) { i_this->m408 = 0; mDoGph_gInf_c::offBlure(); } + #endif if (i_this->mType != bpw_class::Actor_Type_DAMAGE_BALL_e) { g_env_light.setLightTevColorType(pJVar3, &actor->tevStr); } @@ -538,7 +543,9 @@ s32 wall_HIT_check(bpw_class* i_this) { dComIfG_Bgsp()->GetTriPnt(i_this->mAcchCir, &acStack_24, &cStack_30, &cStack_3c); if (dComIfG_Bgsp()->GetAttributeCode(i_this->mAcchCir) == dBgS_Attr_DAMAGE_e) { dComIfGp_particle_set(dPa_name::ID_COMMON_BIG_HIT, &acStack_24, &player->shape_angle, &local_48); + #if VERSION > VERSION_DEMO i_this->m408 = 0xb5; + #endif return 2; } else { dComIfGp_particle_set(dPa_name::ID_COMMON_BIG_HIT, &acStack_24, &player->shape_angle, &local_48); @@ -581,6 +588,7 @@ void kankyou_hendou(bpw_class* i_this) { fVar1 = 0.0f; bVar2 = 1; + switch (i_this->mKankyouHendouState) { case 0: break; @@ -613,8 +621,11 @@ void kankyou_hendou(bpw_class* i_this) { case 6: fVar1 = 1.0f; bVar2 = 0; + break; } + cLib_addCalc2(&i_this->m3EC, fVar1, 1.0f, 0.1f); + if (i_this->mKankyouHendouState < 6) { fVar1 = i_this->m3EC; if (fVar1 > 0.5f) { @@ -650,7 +661,7 @@ void noroi_check(bpw_class* i_this) { ((i_this->mActionState != 10 && (i_this->mActionState != 0xb)) && (i_this->mActionState != 0xc && (i_this->mActionState != 0xd)))) { if ((((i_this->m3F8 == 0x2a) || (i_this->m3F8 == 0x1d)) || (i_this->m3F8 == 0x1c || (i_this->m3F8 == 0x2b))) && - (dVar6 = fopAcM_searchPlayerDistance(actor), dVar6 < 530.0f)) + (fopAcM_searchPlayerDistance(actor) < 530.0f)) { i_this->mBodyAction = bpw_class::Action_BODY_DOWN_KARADA_TAORE_e; i_this->mActionState = 0x4d; @@ -671,7 +682,13 @@ void noroi_check(bpw_class* i_this) { i_this->mFire1DousaPos = player->getHeadTopPos(); dComIfGp_particle_set(dPa_name::ID_COMMON_STARS_BLOW, &i_this->mFire1DousaPos); local_28.y = pcVar5->mAngle.y; - fopAcM_create(PROC_BPW, bpw_class::Actor_Type_TORITUKI_e, &i_this->mFire1DousaPos, fopAcM_GetRoomNo(actor), &local_28); + fopAcM_create( + PROC_BPW, + bpw_class::Actor_Type_TORITUKI_e, + &i_this->mFire1DousaPos, + fopAcM_GetRoomNo(actor), + &local_28 + ); } } } @@ -688,12 +705,43 @@ void fire_and_emitter_clear(bpw_class* i_this) { i_this->m400 = fpcM_ERROR_PROCESS_ID_e; } } - i_this->mFire1Dousa_Pa_followEcallBack.end(); - i_this->mFire1Dousa_Pa_followEcallBack2.end(); - i_this->m590.end(); - i_this->m540.end(); - i_this->m52C.end(); - i_this->m50C.end(); + #if VERSION == VERSION_DEMO + if (i_this->m534_demo) { + i_this->m534_demo->becomeInvalidEmitter(); + i_this->mFire1Dousa_Pa_followEcallBack.remove(); + i_this->m534_demo = NULL; + } + if (i_this->m538_demo) { + i_this->m538_demo->becomeInvalidEmitter(); + i_this->mFire1Dousa_Pa_followEcallBack2.remove(); + i_this->m538_demo = NULL; + } + if (i_this->m53C_demo) { + i_this->m53C_demo->becomeInvalidEmitter(); + i_this->m590.remove(); + i_this->m53C_demo = NULL; + } + if (i_this->m508_demo) { + i_this->m508_demo->becomeInvalidEmitter(); + i_this->m508_demo = NULL; + } + if (i_this->m50C_demo) { + i_this->m50C_demo->becomeInvalidEmitter(); + i_this->m50C_demo = NULL; + } + if (i_this->m510_demo) { + i_this->m510_demo->becomeInvalidEmitter(); + i_this->m510_demo = NULL; + i_this->m50C.remove(); + } + #else + i_this->mFire1Dousa_Pa_followEcallBack.remove(); + i_this->mFire1Dousa_Pa_followEcallBack2.remove(); + i_this->m590.remove(); + i_this->m540.remove(); + i_this->m52C.remove(); + i_this->m50C.remove(); + #endif } /* 00001DA0-00001F40 .text noroi_brk_check__FP9bpw_classUc */ @@ -1247,19 +1295,20 @@ void action_kougeki(bpw_class* i_this) { break; } switch (i_this->m3F6) { - case 0: + case 1: + case 2: if (player->checkConfuse()) { i_this->mActionState = 0x3c; break; } - case 1: - case 2: + // Fall-through + case 0: i_this->mActionState = 0x28; dVar14 = fopAcM_searchPlayerDistance(actor); if (dVar14 < 1050.0f) { i_this->mActionState = 0x3c; - break; } + break; } if (i_this->m3E9 != 0) { i_this->mActionState = 0x32; @@ -1272,19 +1321,28 @@ void action_kougeki(bpw_class* i_this) { anm_init(i_this, BPW_BCK_SUIKOMU1, 15.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, -1); i_this->mSomeCountdownTimers[0] = 30; i_this->mSomeCountdownTimers[0] += (int)cM_rndF(i_this->mSomeCountdownTimers[0]); + #if VERSION == VERSION_DEMO + i_this->m508_demo = dComIfGp_particle_set(dPa_name::ID_SCENE_82CE, &i_this->m394); + #else if (i_this->m540.getEmitter() != NULL) { dComIfGp_particle_set(dPa_name::ID_SCENE_82CE, &i_this->m394, NULL, NULL, 0xff, &i_this->m540); } + #endif i_this->mActionState++; // fallthrough case 0x29: mDoAud_seStart(JA_SE_OBJ_BPW_BREATH_IN, &i_this->m3C4, 0, dComIfGp_getReverb(fopAcM_GetRoomNo(actor))); i_this->m476 = fopAcM_searchPlayerAngleY(actor); search_get_skull(i_this, 0); - pJVar11 = i_this->m540.getEmitter(); - if (pJVar11 != NULL) { - pJVar11->setGlobalSRTMatrix(i_this->mpAnim->getModel()->getAnmMtx(2)); + #if VERSION == VERSION_DEMO + if (i_this->m508_demo != NULL) { + i_this->m508_demo->setGlobalSRTMatrix(i_this->mpAnim->getModel()->getAnmMtx(2)); } + #else + if (i_this->m540.getEmitter() != NULL) { + i_this->m540.getEmitter()->setGlobalSRTMatrix(i_this->mpAnim->getModel()->getAnmMtx(2)); + } + #endif if (i_this->mSomeCountdownTimers[1] == 0) { pJVar11 = dComIfGp_particle_set(dPa_name::ID_SCENE_82CD, &i_this->m394, &actor->shape_angle); if (pJVar11 != NULL) { @@ -1298,7 +1356,9 @@ void action_kougeki(bpw_class* i_this) { player->setOutPower(10.0f, fopAcM_searchPlayerAngleY(actor) + 0x8000, 1); } } else { - i_this->m540.end(); + #if VERSION > VERSION_DEMO + i_this->m540.remove(); + #endif anm_init(i_this, BPW_BCK_IKI1, 15.0f, J3DFrameCtrl::EMode_NONE, 1.0f, -1); i_this->mActionState++; } @@ -1309,8 +1369,11 @@ void action_kougeki(bpw_class* i_this) { if (i_this->mpAnim->isStop()) { i_this->mSomeCountdownTimers[0] = 0x5a; i_this->mSomeCountdownTimers[0] += (int)cM_rndF(i_this->mSomeCountdownTimers[0]); - if (i_this->m52C.getEmitter() == NULL) { - dComIfGp_particle_set(dPa_name::ID_SCENE_82CF, &i_this->m394, NULL, NULL, 0xff, &i_this->m52C); + #if VERSION > VERSION_DEMO + if (i_this->m52C.getEmitter() == NULL) + #endif + { + dComIfGp_particle_set(dPa_name::ID_SCENE_82CF, &i_this->m394, NULL, NULL, 0xff, DEMO_SELECT(NULL, &i_this->m52C)); } i_this->mFire1DousaPos = actor->current.pos; i_this->mFire1DousaPos.y = i_this->mAcch.GetGroundH(); @@ -1328,10 +1391,15 @@ void action_kougeki(bpw_class* i_this) { mDoAud_seStart(JA_SE_OBJ_BPW_BREATH_OUT, &i_this->m3C4, 0, dComIfGp_getReverb(fopAcM_GetRoomNo(actor))); i_this->m476 = fopAcM_searchPlayerAngleY(actor); search_get_skull(i_this, 1); - pJVar11 = i_this->m52C.getEmitter(); - if (pJVar11 != NULL) { - pJVar11->setGlobalSRTMatrix(i_this->mpAnim->getModel()->getAnmMtx(2)); + #if VERSION == VERSION_DEMO + if (i_this->m50C_demo != NULL) { + i_this->m50C_demo->setGlobalSRTMatrix(i_this->mpAnim->getModel()->getAnmMtx(2)); } + #else + if (i_this->m52C.getEmitter() != NULL) { + i_this->m52C.getEmitter()->setGlobalSRTMatrix(i_this->mpAnim->getModel()->getAnmMtx(2)); + } + #endif i_this->mFire1DousaPos = actor->current.pos; i_this->mFire1DousaPos.y = i_this->mAcch.GetGroundH(); i_this->mFire1DousaRot = actor->shape_angle; @@ -1375,9 +1443,11 @@ void action_kougeki(bpw_class* i_this) { if (i_this->mpAnim->isStop()) { pfVar6 = (bpw_class*)fopAcM_SearchByID(i_this->m3FC); if (pfVar6 != NULL) { + u32 params = bpw_class::Actor_Type_DAMAGE_BALL_e; + params |= bpw_class::Damage_Action_LINE_e << 8; i_this->m400 = fopAcM_create( PROC_BPW, - bpw_class::Actor_Type_DAMAGE_BALL_e | (bpw_class::Damage_Action_LINE_e << 8), + params, &pfVar6->m358, fopAcM_GetRoomNo(actor), &actor->current.angle @@ -1440,6 +1510,8 @@ void action_kougeki(bpw_class* i_this) { fopAcM_seStart(actor, JA_SE_OBJ_BPW_FIRE_OUT, 0); pfVar7 = (bpw_class*)fopAcM_SearchByID(i_this->m3FC); if (pfVar7 != NULL) { + u32 params = bpw_class::Actor_Type_DAMAGE_BALL_e; + params |= bpw_class::Damage_Action_DAMAGE_BALL_e << 8; cMtx_YrotS(*calc_mtx, (int)actor->shape_angle.y); local_38.x = 0.0f; local_38.y = 0.0f; @@ -1448,7 +1520,7 @@ void action_kougeki(bpw_class* i_this) { cStack_44 += pfVar7->m358; i_this->m400 = fopAcM_create( PROC_BPW, - bpw_class::Actor_Type_DAMAGE_BALL_e | (bpw_class::Damage_Action_DAMAGE_BALL_e << 8), + params, &cStack_44, fopAcM_GetRoomNo(actor), &actor->current.angle @@ -1502,7 +1574,7 @@ void action_karada_taore(bpw_class* i_this) { if (i_this->mpAnim->checkFrame(26.0f)) { i_this->mFire1DousaPos = actor->current.pos; i_this->mFire1DousaPos.y = i_this->mAcch.GetGroundH(); - i_this->m5E0[1].end(); + i_this->m5E0[1].remove(); pJVar4 = dComIfGp_particle_setToon( dPa_name::ID_SCENE_A401, &i_this->mFire1DousaPos, &actor->shape_angle, NULL, 0xb9, &i_this->m5E0[1], fopAcM_GetRoomNo(actor) ); @@ -1545,7 +1617,7 @@ void action_karada_taore(bpw_class* i_this) { i_this->mSomeCountdownTimers[6] = (s16)(int)(REG21_F(0) + 20.0f); i_this->mFire1DousaPos = actor->current.pos; i_this->mFire1DousaPos.y = i_this->mAcch.GetGroundH(); - i_this->m5E0[2].end(); + i_this->m5E0[2].remove(); pJVar4 = dComIfGp_particle_setToon( dPa_name::ID_SCENE_A402, &i_this->mFire1DousaPos, &actor->shape_angle, NULL, 0xb9, &i_this->m5E0[2], fopAcM_GetRoomNo(actor) ); @@ -1613,7 +1685,7 @@ void action_karada_taore(bpw_class* i_this) { if (i_this->mpAnim->checkFrame(40.0f)) { i_this->mFire1DousaPos = actor->current.pos; i_this->mFire1DousaPos.y = i_this->mAcch.GetGroundH(); - i_this->m5E0[3].end(); + i_this->m5E0[3].remove(); pJVar4 = dComIfGp_particle_setToon( dPa_name::ID_SCENE_A403, &i_this->mFire1DousaPos, &actor->shape_angle, NULL, 0xb9, &i_this->m5E0[3], fopAcM_GetRoomNo(actor) ); @@ -1917,7 +1989,7 @@ void action_damage(bpw_class* i_this) { i_this->mSomeCountdownTimers[6] = (s16)(int)(REG21_F(0) + 20.0f); i_this->mFire1DousaPos = actor->current.pos; i_this->mFire1DousaPos.y = i_this->mAcch.GetGroundH(); - i_this->m5E0[0].end(); + i_this->m5E0[0].remove(); pJVar7 = dComIfGp_particle_setToon( dPa_name::ID_SCENE_A404, &i_this->mFire1DousaPos, &actor->shape_angle, NULL, 0xb9, &i_this->m5E0[0], fopAcM_GetRoomNo(actor) ); @@ -1982,13 +2054,7 @@ void action_bunri_dousa(bpw_class* i_this) { f32 dVar7; f32 dVar8; f32 fVar9; - int childPoeId5; - int childPoeId4; - int childPoeId3; - fpc_ProcID local_d4; - fpc_ProcID childPoeId2; - fpc_ProcID childPoeId; - cXyz local_80; + cXyz sp70; cXyz local_74; cXyz local_68; s8 currHp; @@ -2058,8 +2124,7 @@ void action_bunri_dousa(bpw_class* i_this) { case 0x70: iVar6 = 0; for (iVar5 = 0; iVar5 < actor->health; iVar5++) { - childPoeId = i_this->mChildPoeIds[iVar6]; - childPoe = (pw_class*)fopAcM_SearchByID(childPoeId); + childPoe = (pw_class*)fopAcM_SearchByID(i_this->mChildPoeIds[iVar6]); if ((childPoe != NULL) && (0 < childPoe->health)) { childPoe->health = 0x14; } @@ -2083,10 +2148,10 @@ void action_bunri_dousa(bpw_class* i_this) { i_this->m480 = 0x96; i_this->mSomeCountdownTimers[2] = 0xf; i_this->m474 = 1; - local_80.x = 0.0f; - local_80.y = 0.0f; - local_80.z = 1625.0f; - player->setPlayerPosAndAngle(&local_80, fopAcM_searchActorAngleY(player, actor)); + sp70.x = 0.0f; + sp70.y = 0.0f; + sp70.z = 1625.0f; + player->setPlayerPosAndAngle(&sp70, fopAcM_searchActorAngleY(player, actor)); i_this->mActionState++; } case bpw_class::Action_State_SEPARATE_BUNRI_DOUSA_END_INIT_e: @@ -2099,52 +2164,56 @@ void action_bunri_dousa(bpw_class* i_this) { if (REG20_S(1) == 0) { REG20_S(0) = 1; } - if ((REG20_S(0) != 0) && (REG20_S(0) = 0, i_this->mSomeCountdownTimers[2] == 0)) { - actor->current.angle.y = fopAcM_searchPlayerAngleY((pw_class*)i_this); - actor->shape_angle.y = actor->current.angle.y; - i_this->m476 = actor->shape_angle.y; - cLib_addCalcAngleS2(&i_this->m47E, i_this->m480, 1, 0xf); - cLib_addCalc2(&actor->scale.x, 1.0f, 1.0f, 0.1f); - fVar9 = actor->scale.x; - actor->scale.z = fVar9; - actor->scale.y = fVar9; - if ((i_this->m3E9 == 0) && (actor->scale.x > 0.9f)) { - actor->scale.setall(1.0f); - i_this->m3E9 = 1; - i_this->mSomeCountdownTimers[5] = REG21_S(2) + 10; - i_this->mSomeCountdownTimers[1] = 300; - iVar5 = 0; - for (iVar6 = 0; iVar6 < actor->health; iVar6++) { - childPoeId2 = i_this->mChildPoeIds[iVar5]; - childPoe2 = (pw_class*)fopAcM_SearchByID(childPoeId2); - if (childPoe2 != NULL) { - fopAcM_OnStatus(childPoe2, fopAcStts_UNK4000_e); - } - iVar5 = iVar5 + 4; - } - } - if (i_this->m3F8 == 9) { - if (i_this->mpAnim->isStop()) { - anm_init(i_this, BPW_BCK_CORE1, 15.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, -1); - } - fopAcM_seStart(actor, JA_SE_OBJ_BPW_MASK_LAUGH, 0); - } - local_80.x = 0.0f; - local_80.y = 0.0f; - local_80.z = 1625.0f; - player->setPlayerPosAndAngle(&local_80, fopAcM_searchActorAngleY(player, actor)); - if (i_this->m464 != 0) { - anm_init(i_this, BPW_BCK_CORE_NIGE1, 0.0f, J3DFrameCtrl::EMode_NONE, 1.0f, -1); - i_this->m464 = 0; - } - if ((i_this->mSomeCountdownTimers[1] == 1) || (i_this->m462 >= (int)actor->health)) { - anm_init(i_this, BPW_BCK_CORE_NIGE1, 0.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, -1); - i_this->mSomeCountdownTimers[0] = 30; - i_this->mActionState++; - } - i_this->m3AC.y = 140.0f; - fuwafuwa_calc(i_this); + if (REG20_S(0) == 0) { + break; } + REG20_S(0) = 0; + if (i_this->mSomeCountdownTimers[2] != 0) { + break; + } + actor->current.angle.y = fopAcM_searchPlayerAngleY(actor); + actor->shape_angle.y = actor->current.angle.y; + i_this->m476 = actor->shape_angle.y; + cLib_addCalcAngleS2(&i_this->m47E, i_this->m480, 1, 0xf); + cLib_addCalc2(&actor->scale.x, 1.0f, 1.0f, 0.1f); + fVar9 = actor->scale.x; + actor->scale.z = fVar9; + actor->scale.y = fVar9; + if ((i_this->m3E9 == 0) && (actor->scale.x > 0.9f)) { + actor->scale.setall(1.0f); + i_this->m3E9 = 1; + i_this->mSomeCountdownTimers[5] = REG21_S(2) + 10; + i_this->mSomeCountdownTimers[1] = 300; + iVar5 = 0; + for (iVar6 = 0; iVar6 < actor->health; iVar6++) { + childPoe2 = (pw_class*)fopAcM_SearchByID(i_this->mChildPoeIds[iVar5]); + if (childPoe2 != NULL) { + fopAcM_OnStatus(childPoe2, fopAcStts_UNK4000_e); + } + iVar5 = iVar5 + 4; + } + } + if (i_this->m3F8 == 9) { + if (i_this->mpAnim->isStop()) { + anm_init(i_this, BPW_BCK_CORE1, 15.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, -1); + } + fopAcM_seStart(actor, JA_SE_OBJ_BPW_MASK_LAUGH, 0); + } + sp70.x = 0.0f; + sp70.y = 0.0f; + sp70.z = 1625.0f; + player->setPlayerPosAndAngle(&sp70, fopAcM_searchActorAngleY(player, actor)); + if (i_this->m464 != 0) { + anm_init(i_this, BPW_BCK_CORE_NIGE1, 0.0f, J3DFrameCtrl::EMode_NONE, 1.0f, -1); + i_this->m464 = 0; + } + if ((i_this->mSomeCountdownTimers[1] == 1) || (i_this->m462 >= (int)actor->health)) { + anm_init(i_this, BPW_BCK_CORE_NIGE1, 0.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, -1); + i_this->mSomeCountdownTimers[0] = 30; + i_this->mActionState++; + } + i_this->m3AC.y = 140.0f; + fuwafuwa_calc(i_this); break; case bpw_class::Action_State_SEPARATE_BUNRI_DOUSA_END_GATHER_e: if (i_this->mSomeCountdownTimers[0] == 0) { @@ -2156,7 +2225,7 @@ void action_bunri_dousa(bpw_class* i_this) { anm_init(i_this, BPW_BCK_HUKKATU1, 15.0f, J3DFrameCtrl::EMode_NONE, 1.0f, -1); fopAcM_seStart(actor, JA_SE_CM_BPW_MASK_TO_BPW, 0); i_this->mActionState++; - i_this->m43C = 0; + i_this->m43C = 0.0f; } } break; @@ -2192,24 +2261,29 @@ void action_bunri_dousa(bpw_class* i_this) { if (REG20_S(1) == 0) { REG20_S(0) = 1; } - if ((REG20_S(0) != 0) && (REG20_S(0) = 0, i_this->mSomeCountdownTimers[0] == 0)) { - dComIfGp_getVibration().StopQuake(0x20); - camera->mCamera.Reset(i_this->m40C, i_this->m418); - camera->mCamera.Start(); - camera->mCamera.SetTrimSize(0); - player->cancelOriginalDemo(); - dComIfGp_event_reset(); - next_status_clear(i_this, 1); - next_att_wait_check(i_this); - currHp = actor->health; - if (currHp < 6) { - i_this->m3F6 = 2; - } else if (currHp < 0xb) { - i_this->m3F6 = 1; - } - actor->attention_info.flags = fopAc_Attn_LOCKON_BATTLE_e; - fopAcM_OffStatus(actor, fopAcStts_UNK4000_e); + if (REG20_S(0) == 0) { + break; } + REG20_S(0) = 0; + if (i_this->mSomeCountdownTimers[0] != 0) { + break; + } + dComIfGp_getVibration().StopQuake(0x20); + camera->mCamera.Reset(i_this->m40C, i_this->m418); + camera->mCamera.Start(); + camera->mCamera.SetTrimSize(0); + player->cancelOriginalDemo(); + dComIfGp_event_reset(); + next_status_clear(i_this, 1); + next_att_wait_check(i_this); + currHp = actor->health; + if (currHp < 6) { + i_this->m3F6 = 2; + } else if (currHp < 0xb) { + i_this->m3F6 = 1; + } + actor->attention_info.flags = fopAc_Attn_LOCKON_BATTLE_e; + fopAcM_OffStatus(actor, fopAcStts_UNK4000_e); break; case 0x78: if (actor->eventInfo.checkCommandDemoAccrpt()) { @@ -2233,15 +2307,13 @@ void action_bunri_dousa(bpw_class* i_this) { actor->scale.setall(0.0f); anm_init(i_this, BPW_BCK_CORE1, 15.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, -1); if (i_this->m3FC != fpcM_ERROR_PROCESS_ID_e) { - local_d4 = i_this->m3FC; - i_actor = fopAcM_SearchByID(local_d4); + i_actor = fopAcM_SearchByID(i_this->m3FC); fopAcM_createDisappear(i_actor, &i_actor->current.pos, 5, daDisItem_NONE3_e, 0xFF); fopAcM_delete(i_actor); } iVar5 = 0; for (iVar6 = 0; iVar6 < (char)actor->max_health; iVar6++) { - childPoeId3 = i_this->mChildPoeIds[iVar5]; - childPoe3 = (pw_class*)fopAcM_SearchByID(childPoeId3); + childPoe3 = (pw_class*)fopAcM_SearchByID(i_this->mChildPoeIds[iVar5]); if ((childPoe3 != NULL) && (childPoe3->m344 != 0)) { fopAcM_OnStatus(childPoe3, fopAcStts_UNK4000_e); i_this->m462 = (s16)iVar6; @@ -2260,14 +2332,12 @@ void action_bunri_dousa(bpw_class* i_this) { i_this->m474 = 1; i_this->mSomeCountdownTimers[0] = (s16)(int)(REG20_F(0) + 135.0f); i_this->mActionState++; - childPoeId4 = i_this->mChildPoeIds[i_this->m462]; - childPoe4 = (pw_class*)fopAcM_SearchByID(childPoeId4); + childPoe4 = (pw_class*)fopAcM_SearchByID(i_this->mChildPoeIds[i_this->m462]); if (childPoe4 != NULL) { i_this->m40C = childPoe4->current.pos; } case 0x79: - childPoeId5 = i_this->mChildPoeIds[i_this->m462]; - childPoe5 = (pw_class*)fopAcM_SearchByID(childPoeId5); + childPoe5 = (pw_class*)fopAcM_SearchByID(i_this->mChildPoeIds[i_this->m462]); if (childPoe5 != NULL) { i_this->m424 = childPoe5->current.pos; i_this->m464 = fopAcM_searchPlayerAngleY(childPoe5); @@ -2295,11 +2365,11 @@ void action_bunri_dousa(bpw_class* i_this) { if (REG20_S(0) != 0) { REG20_S(0) = 0; player->changeDemoMode(daPy_demo_c::DEMO_N_WAIT_e); - local_80.x = -36.0f; - local_80.y = player->current.pos.y; - local_80.z = -777.0f; + sp70.x = -36.0f; + sp70.y = player->current.pos.y; + sp70.z = -777.0f; iVar5 = cM_atan2s(player->current.pos.x - (i_this->m424).x, player->current.pos.z - (i_this->m424).z); - player->setPlayerPosAndAngle(&local_80, (int)(short)iVar5); + player->setPlayerPosAndAngle(&sp70, (int)(short)iVar5); i_this->mActionState++; } } @@ -2315,10 +2385,10 @@ void action_bunri_dousa(bpw_class* i_this) { i_this->m418.x = -527.0f; i_this->m418.y = 698.0f; i_this->m418.z = -1645.0f; - local_80.x = -36.0f; - local_80.y = player->current.pos.y; - local_80.z = -777.0f; - player->setPlayerPosAndAngle(&local_80, fopAcM_searchPlayerAngleY(actor) + 0x8000); + sp70.x = -36.0f; + sp70.y = player->current.pos.y; + sp70.z = -777.0f; + player->setPlayerPosAndAngle(&sp70, fopAcM_searchPlayerAngleY(actor) + 0x8000); if (i_this->mSomeCountdownTimers[0] != 0) { if (i_this->mSomeCountdownTimers[0] == 1) { fopAcM_seStart(actor, JA_SE_OBJ_BPW_MASK_APPEAR, 0); @@ -2334,14 +2404,20 @@ void action_bunri_dousa(bpw_class* i_this) { if (REG20_S(1) == 0) { REG20_S(0) = 1; } - if ((REG20_S(0) == 0) || (REG20_S(0) = 0, actor->scale.x < 0.9f)) + if (REG20_S(0) == 0) { break; + } + REG20_S(0) = 0; + if (actor->scale.x < 0.9f) { + break; + } actor->scale.setall(1.0f); i_this->mSomeCountdownTimers[0] = (s16)(int)(REG20_F(9) + 10.0f); i_this->mSomeCountdownTimers[1] = (s16)(int)(REG20_F(10) + 100.0f); i_this->mSomeCountdownTimers[4] = (s16)(int)(REG12_F(0xc) + 30.0f); i_this->mActionState++; - i_this->m43C = 0; + i_this->m43C = 0.0f; + // Fall-through case 0x7b: if (i_this->mSomeCountdownTimers[0] != 0) { i_this->mSomeCountdownTimers[1] = (s16)(int)(REG20_F(10) + 100.0f); @@ -2420,7 +2496,7 @@ void action_bunri_dousa(bpw_class* i_this) { anm_init(i_this, BPW_BCK_CORE_NIGE1, 8.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, -1); i_this->mSomeCountdownTimers[0] = 4; i_this->mActionState++; - i_this->m43C = 0; + i_this->m43C = 0.0f; } } // fallthrough @@ -2447,10 +2523,10 @@ void action_bunri_dousa(bpw_class* i_this) { dVar7 = actor->current.pos.x - -1130.0f; dVar8 = actor->current.pos.z - 30.0f; i_this->m476 = cM_atan2s(dVar7, dVar8) + 0x8000; - local_80.x = -36.0f; - local_80.y = player->current.pos.y; - local_80.z = -777.0f; - player->setPlayerPosAndAngle(&local_80, fopAcM_searchPlayerAngleY(actor) + 0x8000); + sp70.x = -36.0f; + sp70.y = player->current.pos.y; + sp70.z = -777.0f; + player->setPlayerPosAndAngle(&sp70, fopAcM_searchPlayerAngleY(actor) + 0x8000); fVar9 = std::sqrtf((f32)(dVar7 * dVar7) + (f32)(dVar8 * dVar8)); if (fVar9 < 5.0f) { actor->gravity = 0.0f; @@ -2467,7 +2543,7 @@ void action_bunri_dousa(bpw_class* i_this) { i_this->mSomeCountdownTimers[1] = (s16)(int)(REG18_F(6) + 75.0f); mDoAud_bgmStreamPrepare(JA_STRM_BOSS_CLEAR); i_this->mActionState++; - i_this->m43C = 0; + i_this->m43C = 0.0f; } } break; @@ -2587,7 +2663,7 @@ void action_bunri_dousa(bpw_class* i_this) { REG20_S(0) = 0; player->changeDemoMode(daPy_demo_c::DEMO_UNK_029_e); i_this->mActionState++; - i_this->m43C = 0; + i_this->m43C = 0.0f; } // fallthrough case 0x85: @@ -2603,10 +2679,10 @@ void action_bunri_dousa(bpw_class* i_this) { cLib_addCalc2(&i_this->m43C, 1.0f, 1.0f, 0.04f); cLib_addCalc0(&i_this->m3AC.y, 1.0f, 3.0f); cLib_addCalc2(&i_this->m48C, -120.0f, 1.0f, 3.0f); - local_80.x = -36.0f; - local_80.y = player->current.pos.y; - local_80.z = -777.0f; - player->setPlayerPosAndAngle(&local_80, (fopAcM_searchPlayerAngleY((pw_class*)i_this) + 0x8000)); + sp70.x = -36.0f; + sp70.y = player->current.pos.y; + sp70.z = -777.0f; + player->setPlayerPosAndAngle(&sp70, (fopAcM_searchPlayerAngleY(actor) + 0x8000)); if (!(REG6_F(0x13) + ((i_this->mAcch).GetGroundH() + 1350.0f) < actor->current.pos.y)) { if (REG20_S(1) == 0) { REG20_S(0) = 1; @@ -2614,7 +2690,7 @@ void action_bunri_dousa(bpw_class* i_this) { if (REG20_S(0) != 0) { REG20_S(0) = 0; i_this->mActionState++; - i_this->m43C = 0; + i_this->m43C = 0.0f; } } // fallthrough @@ -2646,9 +2722,9 @@ void action_bunri_dousa(bpw_class* i_this) { unk2->setGlobalPrmColor(g_env_light.mBG0_K0.r, g_env_light.mBG0_K0.g, g_env_light.mBG0_K0.b); } fopAcM_seStart(actor, JA_SE_CM_BOSS_EXPLODE, 0); - local_80 = actor->current.pos; - local_80.y += REG8_F(5) + 80.0f; - fopAcM_createDisappear(actor, &local_80, 0xF, daDisItem_HEART_CONTAINER_e, 0xFF); + sp70 = actor->current.pos; + sp70.y += REG8_F(5) + 80.0f; + fopAcM_createDisappear(actor, &sp70, 0xF, daDisItem_HEART_CONTAINER_e, 0xFF); fopAcM_seStart(actor, JA_SE_CM_BPW_MASK_BREAK, 0); actor->scale.setall(0.0f); i_this->mActionState++; @@ -2660,11 +2736,13 @@ void action_bunri_dousa(bpw_class* i_this) { if (i_this->mSomeCountdownTimers[0] != 0) { cLib_addCalc2(&i_this->m40C.y, REG12_F(0xd) + 186.0f, 0.3f, REG12_F(0xe) + 100.0f); } else { - local_80.x = -36.0f; - local_80.y = player->current.pos.y; - local_80.z = -777.0f; - iVar5 = cM_atan2s(player->current.pos.x - i_this->mBodyPos.x, player->current.pos.z - i_this->mBodyPos.z); - player->setPlayerPosAndAngle(&local_80, (int)(short)((short)iVar5 + -0x8000)); + f32 f1 = player->current.pos.x - i_this->mBodyPos.x; + f32 f2 = player->current.pos.z - i_this->mBodyPos.z; + sp70.x = -36.0f; + sp70.y = player->current.pos.y; + sp70.z = -777.0f; + s16 r5 = cM_atan2s(f1, f2) + 0x8000; + player->setPlayerPosAndAngle(&sp70, r5); i_this->m40C.setall(0.0f); i_this->m3F0 = REG9_F(1) + 1400.0f; i_this->m3F4 = (s16)(int)(REG9_F(2) + -15000.0f); @@ -2690,16 +2768,18 @@ void action_bunri_dousa(bpw_class* i_this) { } // fallthrough case 0x88: - local_80.x = -36.0f; - local_80.y = player->current.pos.y; - local_80.z = -777.0f; - iVar5 = cM_atan2s(player->current.pos.x - i_this->mBodyPos.x, player->current.pos.z - i_this->mBodyPos.z); - player->setPlayerPosAndAngle(&local_80, (int)(short)((short)iVar5 + -0x8000)); + f32 f1 = player->current.pos.x - i_this->mBodyPos.x; + f32 f2 = player->current.pos.z - i_this->mBodyPos.z; + sp70.x = -36.0f; + sp70.y = player->current.pos.y; + sp70.z = -777.0f; + s16 r5 = cM_atan2s(f1, f2) + 0x8000; + player->setPlayerPosAndAngle(&sp70, r5); if (i_this->mSomeCountdownTimers[9] == 1) { i_this->m3EC = 0.0f; i_this->mKankyouHendouState = 6; } - if (i_this->mSomeCountdownTimers[2] == 0) { + if (i_this->mSomeCountdownTimers[2] != 0) { if (i_this->mSomeCountdownTimers[1] == 1) { fopAcM_createWarpFlower(&i_this->mBodyPos, 0, fopAcM_GetRoomNo(actor), 0); i_this->mSomeCountdownTimers[9] = REG6_S(5) + 30; @@ -2755,7 +2835,7 @@ void action_bunri_dousa(bpw_class* i_this) { /* 00008D3C-0000A064 .text action_start_demo__FP9bpw_class */ void action_start_demo(bpw_class* i_this) { - /* Nonmatching - "cLib_addCalc2" */ + /* Nonmatching */ fopAc_ac_c* actor = &i_this->actor; f32 fVar1; daPy_py_c* player; @@ -2771,9 +2851,11 @@ void action_start_demo(bpw_class* i_this) { i_this->m47E = 0; i_this->mActionState++; case 0xc9: - if (actor->eventInfo.checkCommandDemoAccrpt()) { + if (!actor->eventInfo.checkCommandDemoAccrpt()) { + dComIfGp_event_onEventFlag(1); fopAcM_orderPotentialEvent(actor, dEvtFlag_STAFF_ALL_e, 0xFFFF, 0); actor->eventInfo.onCondition(dEvtCnd_UNK2_e); + break; } else { player->changeOriginalDemo(); player->changeDemoMode(daPy_demo_c::DEMO_S_SURP_e); @@ -2785,7 +2867,7 @@ void action_start_demo(bpw_class* i_this) { anm_init(i_this, BPW_BCK_CORE1, 0.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, -1); i_this->mActionState++; } - break; + // Fall-through case 0xca: i_this->m40C.x = 72.0f; i_this->m40C.y = 103.0f; @@ -2793,16 +2875,19 @@ void action_start_demo(bpw_class* i_this) { i_this->m418.x = 89.0f; i_this->m418.y = 108.0f; i_this->m418.z = 1788.0f; - if (i_this->mSomeCountdownTimers[0] == 0) { - if (REG20_S(1) == 0) { - REG20_S(0) = 1; - } - if (REG20_S(0) != 0) { - REG20_S(0) = 0; - i_this->mSomeCountdownTimers[0] = (s16)(int)(REG9_F(1) + 50.0f); - i_this->mActionState++; - } + if (i_this->mSomeCountdownTimers[0] != 0) { + break; } + if (REG20_S(1) == 0) { + REG20_S(0) = 1; + } + if (REG20_S(0) == 0) { + break; + } + REG20_S(0) = 0; + i_this->mSomeCountdownTimers[0] = (s16)(int)(REG9_F(1) + 50.0f); + i_this->mActionState++; + // Fall-through case 0xcb: i_this->m440 = REG6_F(1) + 50.0f; i_this->m40C.x = 1646.0f; @@ -2811,27 +2896,32 @@ void action_start_demo(bpw_class* i_this) { i_this->m418.x = 1767.0f; i_this->m418.y = 1321.0f; i_this->m418.z = -129.0f; - if (i_this->mSomeCountdownTimers[0] == 0) { - if (REG20_S(1) == 0) { - REG20_S(0) = 1; - } - if (REG20_S(0) != 0) { - REG20_S(0) = 0; - i_this->mSomeCountdownTimers[0] = (s16)(int)(REG9_F(2) + 40.0f); - i_this->mSomeCountdownTimers[1] = (s16)(int)(REG9_F(3) + 20.0f); - i_this->mActionState++; - } + if (i_this->mSomeCountdownTimers[0] != 0) { + break; } + if (REG20_S(1) == 0) { + REG20_S(0) = 1; + } + if (REG20_S(0) == 0) { + break; + } + REG20_S(0) = 0; + i_this->mSomeCountdownTimers[0] = (s16)(int)(REG9_F(2) + 40.0f); + i_this->mSomeCountdownTimers[1] = (s16)(int)(REG9_F(3) + 20.0f); + i_this->mActionState++; + // Fall-through case 0xcc: if (i_this->mSomeCountdownTimers[1] == 1) { i_this->m3EA = 1; mDoAud_bgmStreamPlay(); } - if (i_this->mSomeCountdownTimers[0] == 0) { - i_this->mSomeCountdownTimers[0] = (s16)(int)(REG9_F(4) + 38.0f); - i_this->mSomeCountdownTimers[1] = (s16)(int)(REG9_F(5) + 28.0f); - i_this->mActionState++; + if (i_this->mSomeCountdownTimers[0] != 0) { + break; } + i_this->mSomeCountdownTimers[0] = (s16)(int)(REG9_F(4) + 38.0f); + i_this->mSomeCountdownTimers[1] = (s16)(int)(REG9_F(5) + 28.0f); + i_this->mActionState++; + // Fall-through case 0xcd: i_this->m440 = REG6_F(2) + 55.0f; i_this->m40C.x = 72.0f; @@ -2843,48 +2933,70 @@ void action_start_demo(bpw_class* i_this) { if (i_this->mSomeCountdownTimers[1] == 0) { i_this->m3EA = 2; } - if (i_this->mSomeCountdownTimers[0] == 0) { - player->changeDemoMode(daPy_demo_c::DEMO_SURPRISED_e); - if (REG20_S(1) == 0) { - REG20_S(0) = 1; - } - if (REG20_S(0) != 0) { - REG20_S(0) = 0; - i_this->mSomeCountdownTimers[0] = (s16)(int)(REG18_F(0) + 40.0f); - i_this->mSomeCountdownTimers[1] = (s16)(int)(REG18_F(1) + 110.0f); - i_this->mSomeCountdownTimers[2] = (s16)(int)(REG18_F(0xb) + 20.0f); - i_this->mActionState++; - i_this->m43C = 0; - } + if (i_this->mSomeCountdownTimers[0] != 0) { + break; } + player->changeDemoMode(daPy_demo_c::DEMO_SURPRISED_e); + if (REG20_S(1) == 0) { + REG20_S(0) = 1; + } + if (REG20_S(0) == 0) { + break; + } + REG20_S(0) = 0; + i_this->mSomeCountdownTimers[0] = (s16)(int)(REG18_F(0) + 40.0f); + i_this->mSomeCountdownTimers[1] = (s16)(int)(REG18_F(1) + 110.0f); + i_this->mSomeCountdownTimers[2] = (s16)(int)(REG18_F(0xb) + 20.0f); + i_this->mActionState++; + i_this->m43C = 0.0f; + // Fall-through case 0xce: if (i_this->mSomeCountdownTimers[2] == 1) { i_this->m3EA = 3; } - if (i_this->mSomeCountdownTimers[0] == 0) { - cLib_addCalc2(&i_this->m440, REG6_F(3) + 55.0f, 1.0f, std::fabsf(i_this->m440 - (REG6_F(3) + 55.0f)) * (REG18_F(2) + 0.05f) * i_this->m43C); - cLib_addCalc2(&i_this->m40C.x, 0.0f, 0.1f, std::fabsf(i_this->m40C.x) * (REG18_F(2) + 0.05f) * i_this->m43C); - cLib_addCalc2(&i_this->m40C.y, 233.0f, 0.1f, std::fabsf(i_this->m40C.y - 233.0f) * (REG18_F(2) + 0.05f) * i_this->m43C); - cLib_addCalc2(&i_this->m40C.z, 552.0f, 0.1f, std::fabsf(i_this->m40C.z - 552.0f) * (REG18_F(2) + 0.05f) * i_this->m43C); - cLib_addCalc2(&i_this->m418.x, 0.0f, 1.0f, std::fabsf(i_this->m418.x) * (REG18_F(2) + 0.05f) * i_this->m43C); - cLib_addCalc2(&i_this->m418.y, 270.0f, 1.0f, std::fabsf(i_this->m418.y - 270.0f) * (REG18_F(2) + 0.05f) * i_this->m43C); - cLib_addCalc2(&i_this->m418.z, 722.0f, 1.0f, std::fabsf(i_this->m418.z - 722.0f) * (REG18_F(2) + 0.05f) * i_this->m43C); - cLib_addCalc2(&i_this->m43C, 1.0f, 1.0f, 0.04f); - i_this->m3EA = 4; - if (i_this->mSomeCountdownTimers[1] == 0) { - if (REG20_S(1) == 0) { - REG20_S(0) = 1; - } - if (REG20_S(0) != 0) { - REG20_S(0) = 0; - i_this->m3EA = 5; - i_this->mSomeCountdownTimers[0] = (s16)(int)(REG18_F(3) + 30.0f); - i_this->m480 = 0x96; - fopAcM_seStart(actor, JA_SE_OBJ_BPW_MASK_APPEAR, 0); - i_this->mActionState++; - } - } + if (i_this->mSomeCountdownTimers[0] != 0) { + break; } + f32 f3; + f3 = std::fabsf(i_this->m440 - (REG6_F(3) + 55.0f)); + f3 *= REG18_F(2) + 0.05f; + cLib_addCalc2(&i_this->m440, REG6_F(3) + 55.0f, 1.0f, f3 * i_this->m43C); + f3 = std::fabsf(i_this->m40C.x); + f3 *= REG18_F(2) + 0.05f; + cLib_addCalc2(&i_this->m40C.x, 0.0f, 0.1f, f3 * i_this->m43C); + f3 = std::fabsf(i_this->m40C.y - 233.0f); + f3 *= REG18_F(2) + 0.05f; + cLib_addCalc2(&i_this->m40C.y, 233.0f, 0.1f, f3 * i_this->m43C); + f3 = std::fabsf(i_this->m40C.z - 552.0f); + f3 *= REG18_F(2) + 0.05f; + cLib_addCalc2(&i_this->m40C.z, 552.0f, 0.1f, f3 * i_this->m43C); + f3 = std::fabsf(i_this->m418.x); + f3 *= REG18_F(2) + 0.05f; + cLib_addCalc2(&i_this->m418.x, 0.0f, 1.0f, f3 * i_this->m43C); + f3 = std::fabsf(i_this->m418.y - 270.0f); + f3 *= REG18_F(2) + 0.05f; + cLib_addCalc2(&i_this->m418.y, 270.0f, 1.0f, f3 * i_this->m43C); + f3 = std::fabsf(i_this->m418.z - 722.0f); + f3 *= REG18_F(2) + 0.05f; + cLib_addCalc2(&i_this->m418.z, 722.0f, 1.0f, f3 * i_this->m43C); + cLib_addCalc2(&i_this->m43C, 1.0f, 1.0f, 0.04f); + i_this->m3EA = 4; + if (i_this->mSomeCountdownTimers[1] != 0) { + break; + } + if (REG20_S(1) == 0) { + REG20_S(0) = 1; + } + if (REG20_S(0) == 0) { + break; + } + REG20_S(0) = 0; + i_this->m3EA = 5; + i_this->mSomeCountdownTimers[0] = (s16)(int)(REG18_F(3) + 30.0f); + i_this->m480 = 0x96; + fopAcM_seStart(actor, JA_SE_OBJ_BPW_MASK_APPEAR, 0); + i_this->mActionState++; + // Fall-through case 0xcf: cLib_addCalcAngleS2(&i_this->m47E, i_this->m480, 1, 5); cLib_addCalc2(&actor->scale.x, 1.0f, 1.0f, 0.1f); @@ -2928,66 +3040,109 @@ void action_start_demo(bpw_class* i_this) { i_this->mSomeCountdownTimers[0] = (s16)(int)(REG18_F(4) + 30.0f); i_this->mSomeCountdownTimers[1] = (s16)(int)(REG18_F(5) + 55.0f); i_this->mActionState++; - i_this->m43C = 0; - case 0xd1: - if (i_this->mSomeCountdownTimers[1] == 0) { - cLib_addCalc2(&i_this->m440, REG6_F(4) + 65.0f, 1.0f, std::fabsf(i_this->m440 - (REG6_F(4) + 65.0f)) * (REG18_F(8) + 0.08f) * i_this->m43C); - cLib_addCalc2(&i_this->m40C.x, 281.0f, 0.1f, std::fabsf(i_this->m40C.x - 281.0f) * (REG18_F(8) + 0.08f) * i_this->m43C); - cLib_addCalc2(&i_this->m40C.y, 93.0f, 0.1f, std::fabsf(i_this->m40C.y - 93.0f) * (REG18_F(8) + 0.08f) * i_this->m43C); - cLib_addCalc2(&i_this->m40C.z, 725.0f, 0.1f, std::fabsf(i_this->m40C.z - 725.0f) * (REG18_F(8) + 0.08f) * i_this->m43C); - cLib_addCalc2(&i_this->m418.x, 336.0f, 1.0f, std::fabsf(i_this->m418.x - 336.0f) * (REG18_F(8) + 0.08f) * i_this->m43C); - cLib_addCalc2(&i_this->m418.y, 30.0f, 1.0f, std::fabsf(i_this->m418.y - 30.0f) * (REG18_F(8) + 0.08f) * i_this->m43C); - cLib_addCalc2(&i_this->m418.z, 877.0f, 1.0f, std::fabsf(i_this->m418.z - 877.0f) * (REG18_F(8) + 0.08f) * i_this->m43C); - cLib_addCalc2(&i_this->m43C, 1.0f, 1.0f, 0.04f); - if (REG20_S(1) == 0) { - REG20_S(0) = 1; - } - if ((REG20_S(0) != 0) && (REG20_S(0) = 0, i_this->mSomeCountdownTimers[0] == 0)) { - anm_init(i_this, BPW_BCK_OPENING1, (REG18_F(7) + 10.0f), J3DFrameCtrl::EMode_NONE, 1.0f, -1); - pbVar3 = (bpw_class*)fopAcM_SearchByID(i_this->m3FC); - if (pbVar3 != NULL) { - anm_init(pbVar3, BPW_BCK_OPENING_KAN1, (REG18_F(7) + 10.0f), J3DFrameCtrl::EMode_NONE, 1.0f, -1); - } - i_this->mFire1DousaPos = i_this->m3B8; - i_this->mFire1DousaRot = actor->shape_angle; - if (i_this->m554.getEmitter() == NULL) { - dComIfGp_particle_set(dPa_name::ID_SCENE_845A, &i_this->mFire1DousaPos, &i_this->mFire1DousaRot, NULL, 0xff, &i_this->m554); - } - fopAcM_seStart(actor, JA_SE_CM_BPW_MASK_TO_BPW, 0); - i_this->mActionState++; - } + #if VERSION > VERSION_DEMO + i_this->m43C = 0.0f; + #endif + case 0xd1: { + if (i_this->mSomeCountdownTimers[1] != 0) { + break; } - break; - case 0xd2: + f32 f3; + f3 = std::fabsf(i_this->m440 - (REG6_F(4) + 65.0f)); + f3 *= REG18_F(8) + 0.08f; + cLib_addCalc2(&i_this->m440, REG6_F(4) + 65.0f, 1.0f, f3 * i_this->m43C); + f3 = std::fabsf(i_this->m40C.x - 281.0f); + f3 *= REG18_F(8) + 0.08f; + cLib_addCalc2(&i_this->m40C.x, 281.0f, 0.1f, f3 * i_this->m43C); + f3 = std::fabsf(i_this->m40C.y - 93.0f); + f3 *= REG18_F(8) + 0.08f; + cLib_addCalc2(&i_this->m40C.y, 93.0f, 0.1f, f3 * i_this->m43C); + f3 = std::fabsf(i_this->m40C.z - 725.0f); + f3 *= REG18_F(8) + 0.08f; + cLib_addCalc2(&i_this->m40C.z, 725.0f, 0.1f, f3 * i_this->m43C); + f3 = std::fabsf(i_this->m418.x - 336.0f); + f3 *= REG18_F(8) + 0.08f; + cLib_addCalc2(&i_this->m418.x, 336.0f, 1.0f, f3 * i_this->m43C); + f3 = std::fabsf(i_this->m418.y - 30.0f); + f3 *= REG18_F(8) + 0.08f; + cLib_addCalc2(&i_this->m418.y, 30.0f, 1.0f, f3 * i_this->m43C); + f3 = std::fabsf(i_this->m418.z - 877.0f); + f3 *= REG18_F(8) + 0.08f; + cLib_addCalc2(&i_this->m418.z, 877.0f, 1.0f, f3 * i_this->m43C); + cLib_addCalc2(&i_this->m43C, 1.0f, 1.0f, 0.04f); + if (REG20_S(1) == 0) { + REG20_S(0) = 1; + } + if (REG20_S(0) == 0) { + break; + } + REG20_S(0) = 0; + if (i_this->mSomeCountdownTimers[0] != 0) { + break; + } + anm_init(i_this, BPW_BCK_OPENING1, (REG18_F(7) + 10.0f), J3DFrameCtrl::EMode_NONE, 1.0f, -1); + pbVar3 = (bpw_class*)fopAcM_SearchByID(i_this->m3FC); + if (pbVar3 != NULL) { + anm_init(pbVar3, BPW_BCK_OPENING_KAN1, (REG18_F(7) + 10.0f), J3DFrameCtrl::EMode_NONE, 1.0f, -1); + } + i_this->mFire1DousaPos = i_this->m3B8; + i_this->mFire1DousaRot = actor->shape_angle; + if (i_this->m554.getEmitter() == NULL) { + dComIfGp_particle_set(dPa_name::ID_SCENE_845A, &i_this->mFire1DousaPos, &i_this->mFire1DousaRot, NULL, 0xff, &i_this->m554); + } + fopAcM_seStart(actor, JA_SE_CM_BPW_MASK_TO_BPW, 0); + i_this->mActionState++; + // Fall-through + } + case 0xd2: { if (i_this->m554.getEmitter() != NULL) { i_this->mFire1DousaPos = i_this->m3B8; i_this->mFire1DousaRot = actor->shape_angle; } - cLib_addCalc2(&i_this->m440, REG6_F(4) + 65.0f, 1.0f, std::fabsf(i_this->m440 - (REG6_F(4) + 65.0f)) * (REG18_F(8) + 0.08f) * i_this->m43C); - cLib_addCalc2(&i_this->m40C.x, 281.0f, 0.1f, std::fabsf(i_this->m40C.x - 281.0f) * (REG18_F(8) + 0.08f) * i_this->m43C); - cLib_addCalc2(&i_this->m40C.y, 93.0f, 0.1f, std::fabsf(i_this->m40C.y - 93.0f) * (REG18_F(8) + 0.08f) * i_this->m43C); - cLib_addCalc2(&i_this->m40C.z, 725.0f, 0.1f, std::fabsf(i_this->m40C.z - 725.0f) * (REG18_F(8) + 0.08f) * i_this->m43C); - cLib_addCalc2(&i_this->m418.x, 336.0f, 1.0f, std::fabsf(i_this->m418.x - 336.0f) * (REG18_F(8) + 0.08f) * i_this->m43C); - cLib_addCalc2(&i_this->m418.y, 30.0f, 1.0f, std::fabsf(i_this->m418.y - 30.0f) * (REG18_F(8) + 0.08f) * i_this->m43C); - cLib_addCalc2(&i_this->m418.z, 877.0f, 1.0f, std::fabsf(i_this->m418.z - 877.0f) * (REG18_F(8) + 0.08f) * i_this->m43C); + f32 f3; + f3 = std::fabsf(i_this->m440 - (REG6_F(4) + 65.0f)); + f3 *= REG18_F(8) + 0.08f; + cLib_addCalc2(&i_this->m440, REG6_F(4) + 65.0f, 1.0f, f3 * i_this->m43C); + f3 = std::fabsf(i_this->m40C.x - 281.0f); + f3 *= REG18_F(8) + 0.08f; + cLib_addCalc2(&i_this->m40C.x, 281.0f, 0.1f, f3 * i_this->m43C); + f3 = std::fabsf(i_this->m40C.y - 93.0f); + f3 *= REG18_F(8) + 0.08f; + cLib_addCalc2(&i_this->m40C.y, 93.0f, 0.1f, f3 * i_this->m43C); + f3 = std::fabsf(i_this->m40C.z - 725.0f); + f3 *= REG18_F(8) + 0.08f; + cLib_addCalc2(&i_this->m40C.z, 725.0f, 0.1f, f3 * i_this->m43C); + f3 = std::fabsf(i_this->m418.x - 336.0f); + f3 *= REG18_F(8) + 0.08f; + cLib_addCalc2(&i_this->m418.x, 336.0f, 1.0f, f3 * i_this->m43C); + f3 = std::fabsf(i_this->m418.y - 30.0f); + f3 *= REG18_F(8) + 0.08f; + cLib_addCalc2(&i_this->m418.y, 30.0f, 1.0f, f3 * i_this->m43C); + f3 = std::fabsf(i_this->m418.z - 877.0f); + f3 *= REG18_F(8) + 0.08f; + cLib_addCalc2(&i_this->m418.z, 877.0f, 1.0f, f3 * i_this->m43C); cLib_addCalc2(&i_this->m43C, 1.0f, 1.0f, 0.04f); cLib_addCalc2(&i_this->m3AC.y, 340.0f, 1.0f, 5.0f); if (REG20_S(1) == 0) { REG20_S(0) = 1; } - if (REG20_S(0) != 0) { - REG20_S(0) = 0; - if (i_this->mpAnim->isStop()) { - i_this->m554.end(); - i_this->mSomeCountdownTimers[0] = (s16)(int)(REG6_F(5) + 40.0f); - anm_init(i_this, BPW_BCK_OPENING2, 0.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, -1); - pbVar3 = (bpw_class*)fopAcM_SearchByID(i_this->m3FC); - if (pbVar3 != NULL) { - anm_init(pbVar3, BPW_BCK_OPENING_KAN2, 0.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, -1); - } - i_this->mActionState++; - } + if (REG20_S(0) == 0) { + break; } + REG20_S(0) = 0; + if (!i_this->mpAnim->isStop()) { + break; + } + i_this->m554.remove(); + i_this->mSomeCountdownTimers[0] = (s16)(int)(REG6_F(5) + 40.0f); + anm_init(i_this, BPW_BCK_OPENING2, 0.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, -1); + pbVar3 = (bpw_class*)fopAcM_SearchByID(i_this->m3FC); + if (pbVar3 != NULL) { + anm_init(pbVar3, BPW_BCK_OPENING_KAN2, 0.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, -1); + } + i_this->mActionState++; + // Fall-through + } case 0xd3: if (i_this->mSomeCountdownTimers[0] == 0) { if (REG20_S(1) == 0) { @@ -2996,8 +3151,13 @@ void action_start_demo(bpw_class* i_this) { if (REG20_S(0) != 0) { REG20_S(0) = 0; i_this->mActionState++; + } else { + break; } + } else { + break; } + // Fall-through case 0xd4: if (i_this->mSomeCountdownTimers[0] == 0) { dComIfGp_getVibration().StopQuake(0x20); @@ -3012,7 +3172,7 @@ void action_start_demo(bpw_class* i_this) { pcVar9->mCamera.Start(); pcVar9->mCamera.SetTrimSize(0); player->cancelOriginalDemo(); - dComIfGp_event_onEventFlag(8); + dComIfGp_event_reset(); mDoAud_bgmStart(JA_BGM_BIG_POW); dComIfGs_onStageBossDemo(); i_this->m3F6 = 0; @@ -3126,9 +3286,31 @@ void kantera_calc(bpw_class* i_this) { /* 0000A494-0000A8C8 .text body_execute__FP9bpw_class */ void body_execute(bpw_class* i_this) { fopAc_ac_c* actor = &i_this->actor; - cXyz local_28; + cXyz local_28 = i_this->m358; + + #if VERSION == VERSION_DEMO + if (CPad_CHECK_HOLD_Z(0) && CPad_CHECK_HOLD_DOWN(0)) { + dComIfGs_onStageBossEnemy(); + if (dComIfGp_getStartStageName()[0] == 'X') { + dComIfGs_onEventBit(0x3210); + dComIfGs_onTmpBit(0x0480); + dLib_setNextStageBySclsNum(0, actor->current.roomNo); + mDoAud_seStart(JA_SE_LK_B_BOSS_WARP, NULL, 0, dComIfGp_getReverb(fopAcM_GetRoomNo(actor))); + fopAcM_delete(actor); + } else { + fopAcM_createWarpFlower(&i_this->mBodyPos, 0, fopAcM_GetRoomNo(actor), 0); + fopAcM_delete(actor); + if (i_this->m3FC != fpcM_ERROR_PROCESS_ID_e) { + i_this = (bpw_class*)fopAcM_SearchByID(i_this->m3FC); + actor = &i_this->actor; + fopAcM_createDisappear(actor, &actor->current.pos, 10, daDisItem_NONE3_e, 0xFF); + fopAcM_delete(actor); + } + } + return; + } + #endif - local_28 = i_this->m358; if (REG8_S(2) != 0) { actor->speedF = 0.0f; actor->attention_info.position = actor->current.pos; @@ -3161,6 +3343,7 @@ void body_execute(bpw_class* i_this) { break; case bpw_class::Action_START_DEMO_e: action_start_demo(i_this); + break; } if (i_this->m3E5 == 0) { cLib_addCalcAngleS2(&actor->current.angle.y, i_this->m476, 1, i_this->m47A); @@ -3439,11 +3622,11 @@ void action_b_fire_1_dousa(bpw_class* i_this) { i_this->m67E = 0x4000; i_this->m680 = cM_atan2s(fVar1, fVar2); } - if ((i_this->m590).getEmitter() == NULL) { + if (i_this->m590.getEmitter() == NULL) { dComIfGp_particle_set(dPa_name::ID_SCENE_8312, &i_this->m66C, (csXyz*)&i_this->m67E, NULL, 0xff, &i_this->m590); } } else { - i_this->m590.end(); + i_this->m590.remove(); } i_this->mFire1DousaPos = actor->current.pos; i_this->mFire1DousaRot = actor->shape_angle; @@ -3522,8 +3705,8 @@ void action_b_fire_2_dousa(bpw_class* i_this) { dComIfGp_particle_set(dPa_name::ID_SCENE_82D5, &local_30, &local_38); dComIfGp_particle_set(dPa_name::ID_SCENE_82D6, &local_30, &local_38); dComIfGp_particle_set(dPa_name::ID_SCENE_82D3, &local_30, &actor->current.angle); - i_this->mFireDousa2_Pa_followEcallBack.end(); - i_this->mFireDousa2_Pa_followEcallBack2.end(); + i_this->mFireDousa2_Pa_followEcallBack.remove(); + i_this->mFireDousa2_Pa_followEcallBack2.remove(); if (i_this->mSomeCountdownTimers[1] == 0) { i_this->mSomeCountdownTimers[1] = (s16)(int)cM_rndF(5.0f); i_this->m47E = (s16)(int)(cM_rndF(5.0f) + 8.0f); @@ -3558,8 +3741,8 @@ void action_b_fire_2_dousa(bpw_class* i_this) { } break; case 0x17: - i_this->mFireDousa2_Pa_followEcallBack.end(); - i_this->mFireDousa2_Pa_followEcallBack2.end(); + i_this->mFireDousa2_Pa_followEcallBack.remove(); + i_this->mFireDousa2_Pa_followEcallBack2.remove(); fopAcM_delete(actor); break; } @@ -3679,11 +3862,13 @@ static BOOL daBPW_Execute(bpw_class* i_this) { cXyz local_1c; cXyz local_28; + #if VERSION > VERSION_DEMO if (dComIfGp_getStartStageName()[0] == 'X') { i_this->m408 = 0x32; } else if (i_this->m408 > 2) { i_this->m408 -= 2; } + #endif for (s32 i = 0; i < 10; i++) { if (i_this->mSomeCountdownTimers[i] != 0) { i_this->mSomeCountdownTimers[i]--; @@ -3793,24 +3978,28 @@ static BOOL daBPW_IsDelete(bpw_class*) { /* 0000C5C8-0000C770 .text daBPW_Delete__FP9bpw_class */ static BOOL daBPW_Delete(bpw_class* i_this) { + #if VERSION > VERSION_DEMO mDoAud_seDeleteObject(&i_this->m358); mDoAud_seDeleteObject(&i_this->m3C4); - dComIfG_resDelete((request_of_phase_process_class*)&i_this->m2AC, "BPW"); + #endif + dComIfG_resDeleteDemo(&i_this->m2AC, "BPW"); if (i_this->mType == bpw_class::Actor_Type_KANTERA_e) { - i_this->m5CC.end(); + i_this->m5CC.remove(); } for (s32 i = 0; i < (s32)ARRAY_SIZE(i_this->m5E0); i++) { - i_this->m5E0[i].end(); + i_this->m5E0[i].remove(); } - i_this->mFire1Dousa_Pa_followEcallBack.end(); - i_this->mFire1Dousa_Pa_followEcallBack2.end(); - i_this->m590.end(); - i_this->m554.end(); - i_this->mFireDousa2_Pa_followEcallBack.end(); - i_this->mFireDousa2_Pa_followEcallBack2.end(); - i_this->m540.end(); - i_this->m52C.end(); - i_this->m50C.end(); + i_this->mFire1Dousa_Pa_followEcallBack.remove(); + i_this->mFire1Dousa_Pa_followEcallBack2.remove(); + i_this->m590.remove(); + i_this->m554.remove(); + i_this->mFireDousa2_Pa_followEcallBack.remove(); + i_this->mFireDousa2_Pa_followEcallBack2.remove(); + #if VERSION > VERSION_DEMO + i_this->m540.remove(); + i_this->m52C.remove(); + #endif + i_this->m50C.remove(); if (i_this->mUnknownParam2 == bpw_class::Damage_Action_DAMAGE_BALL_e) { dKy_plight_cut(&i_this->m4EC); } @@ -4061,7 +4250,7 @@ void kantera_create_init(bpw_class* i_this) { i_this->mBodyAction = bpw_class::Action_MOVE_DOUSA_e; i_this->mActionState = 0; i_this->m404 = actor->parentActorID; - if (i_this->m404 == -1) { + if (i_this->m404 == fpcM_ERROR_PROCESS_ID_e) { fopAcM_delete(actor); } } @@ -4174,16 +4363,19 @@ static cPhs_State daBPW_Create(fopAc_ac_c* a_this) { uint uVar7; int iVar8; f32 dVar9; - csXyz local_80; - csXyz local_78; cXyz local_70; bpw_class* i_this = (bpw_class*)a_this; fopAc_ac_c* actor = &i_this->actor; - local_78 = actor->shape_angle; + csXyz sp18 = actor->shape_angle; + #if VERSION > VERSION_DEMO fopAcM_SetupActor(a_this, bpw_class); + #endif res = dComIfG_resLoad(&i_this->m2AC, "BPW"); if (res == cPhs_COMPLEATE_e) { + #if VERSION == VERSION_DEMO + fopAcM_SetupActor(a_this, bpw_class); + #endif i_this->mType = (bpw_class::Actor_Type_e)fopAcM_GetParam(actor); i_this->mUnknownParam2 = (bpw_class::Damage_Action_e)((uint)fopAcM_GetParam(actor) >> 8); i_this->mLightState = (u8)((uint)fopAcM_GetParam(actor) >> 0x10); @@ -4222,15 +4414,20 @@ static cPhs_State daBPW_Create(fopAc_ac_c* a_this) { i_this->mpAnim->play(NULL, 0, 0); BG_check(i_this); draw_SUB(i_this); - local_78.y += 0x4000; + sp18.y += 0x4000; i_this->m3FC = fopAcM_createChild( - PROC_BPW, fopAcM_GetID(i_this), bpw_class::Actor_Type_KANTERA_e, &i_this->mChildActorPos, fopAcM_GetRoomNo(actor), &local_78 + PROC_BPW, + fopAcM_GetID(i_this), + bpw_class::Actor_Type_KANTERA_e, + &i_this->mChildActorPos, + fopAcM_GetRoomNo(actor), + &sp18 ); i_this->mAttWaitTimer = 1; kantera_calc(i_this); if ((dComIfGp_getStartStageName()[0] != 'X') && (REG0_S(9) != 0 || (!dComIfGs_isStageBossDemo()))) { fopAcM_OnStatus(actor, fopAcStts_UNK4000_e); - local_80 = actor->shape_angle; + csXyz sp10 = actor->shape_angle; local_70 = actor->current.pos; iVar2 = (65536.0f / actor->health); local_70.y = i_this->mAcch.GetGroundH() + 20.0f; @@ -4239,11 +4436,11 @@ static cPhs_State daBPW_Create(fopAc_ac_c* a_this) { iVar6 = uVar7 << 9 | 0xff000004; for (s32 i = 0; i < 0xF; i++) { dVar9 = ((s16)iVar2 * 0.25f); - pwID = fopAcM_createChild(PROC_PW, fopAcM_GetID(i_this), iVar6, &local_70, fopAcM_GetRoomNo(actor), &local_80); + pwID = fopAcM_createChild(PROC_PW, fopAcM_GetID(i_this), iVar6, &local_70, fopAcM_GetRoomNo(actor), &sp10); i_this->mChildPoeIds[i] = pwID; iVar8 = iVar8 + iVar2; - local_80.y = (s16)iVar8; - local_80.y += (int)cM_rndFX(dVar9); + sp10.y = (s16)iVar8; + sp10.y += (int)cM_rndFX(dVar9); uVar7++; if (5 < uVar7) { uVar7 = uVar7 << 9 | 0xff000004; @@ -4263,7 +4460,9 @@ static cPhs_State daBPW_Create(fopAc_ac_c* a_this) { } else { mDoAud_bgmStart(JA_BGM_BIG_POW); } + #if VERSION > VERSION_DEMO kankyou_hendou(i_this); + #endif i_this->mBodyAction = bpw_class::Action_MOVE_DOUSA_e; i_this->mActionState = 0; } diff --git a/src/d/actor/d_a_bst.cpp b/src/d/actor/d_a_bst.cpp index 1b661d3b2..227df9153 100644 --- a/src/d/actor/d_a_bst.cpp +++ b/src/d/actor/d_a_bst.cpp @@ -1174,15 +1174,14 @@ static void head_damage(bst_class* i_this) { cLib_addCalc2(&bomb->current.pos.y, actor->current.pos.y + 90.0f + REG0_F(0xb), 1.0f, 30.0f); cLib_addCalc2(&bomb->current.pos.z, actor->current.pos.z, 1.0f, 30.0f); } - if (i_this->m10FC[0] == 0) { - anm_init(i_this, BST_BCK_BOM_NOMI, 1.0f, J3DFrameCtrl::EMode_NONE, 1.0f, -1); - i_this->mDamage++; - i_this->m2EE0[0] = dComIfGp_particle_set(dPa_name::ID_SCENE_81E3, &actor->current.pos); - fopAcM_seStart(actor, JA_SE_CM_BST_MOUTH_CLOSE, 0); - i_this->m10FC[0] = 0x3c; - } else { + if (i_this->m10FC[0] != 0) { break; } + anm_init(i_this, BST_BCK_BOM_NOMI, 1.0f, J3DFrameCtrl::EMode_NONE, 1.0f, -1); + i_this->mDamage++; + i_this->m2EE0[0] = dComIfGp_particle_set(dPa_name::ID_SCENE_81E3, &actor->current.pos); + fopAcM_seStart(actor, JA_SE_CM_BST_MOUTH_CLOSE, 0); + i_this->m10FC[0] = 0x3c; // fallthrough } case 5: diff --git a/src/d/actor/d_a_btd.cpp b/src/d/actor/d_a_btd.cpp index 628319771..0394c23bf 100644 --- a/src/d/actor/d_a_btd.cpp +++ b/src/d/actor/d_a_btd.cpp @@ -404,9 +404,12 @@ void startdemo(btd_class* i_this) { i_this->m6E48 = 40.0f; hahen_set2(i_this); } - if (((i_this->m6E1A >= 0x46) && (i_this->m6E1A <= 0xC3)) && (i_this->m602E = 3, i_this->m6E1A >= 0x5A)) { - mDoAud_seStart(JA_SE_CM_BTD_HIFUKI, &i_this->eyePos, 0, dComIfGp_getReverb(fopAcM_GetRoomNo(i_this))); - i_this->mKankyoState = 2; + if (((i_this->m6E1A >= 0x46) && (i_this->m6E1A <= 0xC3))) { + i_this->m602E = 3; + if (i_this->m6E1A >= 0x5A) { + mDoAud_seStart(JA_SE_CM_BTD_HIFUKI, &i_this->eyePos, 0, dComIfGp_getReverb(fopAcM_GetRoomNo(i_this))); + i_this->mKankyoState = 2; + } } if (i_this->m6E1A >= 0x46) { i_this->m602C = 3; @@ -2122,7 +2125,7 @@ void demo_camera(btd_class* i_this) { i_this->m6E16 = 0; pcVar7->mCamera.Start(); pcVar7->mCamera.SetTrimSize(0); - dComIfGp_event_onEventFlag(8); + dComIfGp_event_reset(); fopAcM_OffStatus(i_this, fopAcStts_UNK4000_e); break; } diff --git a/src/d/actor/d_a_bwd.cpp b/src/d/actor/d_a_bwd.cpp index 42a23af1e..5a9ade908 100644 --- a/src/d/actor/d_a_bwd.cpp +++ b/src/d/actor/d_a_bwd.cpp @@ -405,15 +405,18 @@ void start(bwd_class* i_this) { if (i_this->m18AC == 0x28f) { i_this->m1865 = 1; } - if ((i_this->m18AC >= 600) && (i_this->m394C = 1, i_this->m18AC == 0x294)) { - i_this->m18AE = 0xB; - i_this->m18B0 = 0; - actor->current.pos.x = 0.0f; - actor->current.pos.y = ((l_HIO.m28 + -2000.0f) - 200.0f) + REG0_F(0xb); - actor->current.pos.z = 0.0f; - i_this->m18CC[1] = 0x28; - g_eff_on(i_this); - dComIfGp_getVibration().StopQuake(-1); + if (i_this->m18AC >= 600) { + i_this->m394C = 1; + if (i_this->m18AC == 0x294) { + i_this->m18AE = 0xB; + i_this->m18B0 = 0; + actor->current.pos.x = 0.0f; + actor->current.pos.y = ((l_HIO.m28 + -2000.0f) - 200.0f) + REG0_F(0xb); + actor->current.pos.z = 0.0f; + i_this->m18CC[1] = 0x28; + g_eff_on(i_this); + dComIfGp_getVibration().StopQuake(-1); + } } break; } @@ -715,7 +718,7 @@ void eat_attack(bwd_class* i_this) { if (fVar1 >= 27.0f) { if (((int)fVar1 == 0x1b) && (i_this->m3AE6 == 0)) { i_this->m3AE6 = REG0_S(4) + 10; - i_this->m3978[3].end(); + i_this->m3978[3].remove(); i_this->m3954.x = actor->current.pos.x; i_this->m3954.z = actor->current.pos.z; dComIfGp_particle_setToon( @@ -743,7 +746,7 @@ void eat_attack(bwd_class* i_this) { dComIfGp_particle_set(dPa_name::ID_SCENE_8250, &i_this->m3954, &actor->shape_angle); if (i_this->m3AE8 == 0) { i_this->m3AE8 = 0x3c; - i_this->m3978[4].end(); + i_this->m3978[4].remove(); i_this->m3954.x = actor->current.pos.x; i_this->m3954.z = actor->current.pos.z; dComIfGp_particle_setToon( @@ -788,7 +791,7 @@ void eat_attack(bwd_class* i_this) { i_this->m3C20 = 0; if (i_this->m3AEA == 0) { i_this->m3AEA = 0x14; - i_this->m3978[5].end(); + i_this->m3978[5].remove(); i_this->m3954.x = actor->current.pos.x; i_this->m3954.z = actor->current.pos.z; dComIfGp_particle_setToon(dPa_name::ID_SCENE_A24A, &i_this->m3954, NULL, NULL, eff_col.a, &i_this->m3978[5], (s8)actor->current.roomNo); @@ -1065,7 +1068,7 @@ void end(bwd_class* i_this) { fpcM_Search(ko_delete_sub, i_this); if (i_this->m3AEC == 0) { i_this->m3AEC = 0x28; - i_this->m3978[6].end(); + i_this->m3978[6].remove(); i_this->m3954.x = actor->current.pos.x; i_this->m3954.z = actor->current.pos.z; dComIfGp_particle_setToon( @@ -1824,7 +1827,7 @@ void demo_camera(bwd_class* i_this) { break; } i_this->m3C1E = 0x96; - dComIfGp_event_onEventFlag(8); + dComIfGp_event_reset(); i_this->m3C1E = 0; pcVar11->mCamera.Reset(i_this->m3C34, i_this->m3C28); pcVar11->mCamera.Start(); @@ -2167,7 +2170,7 @@ static BOOL daBwd_Execute(bwd_class* i_this) { if (i_this->m17E6[iVar19] >= 0x3b) { i_this->m17E4[iVar8] = 0; for (s32 j = 0; j < 3; j++) { - i_this->m3B54[j + iVar21].end(); + i_this->m3B54[j + iVar21].remove(); } } break; @@ -2207,11 +2210,11 @@ static BOOL daBwd_Execute(bwd_class* i_this) { if (sVar2 != 0) { if (sVar2 == 1) { i_this->m3960++; - i_this->m3AF4.end(); + i_this->m3AF4.remove(); dComIfGp_particle_set(dPa_name::ID_SCENE_824D, &i_this->m3954, &actor->shape_angle, NULL, 0xff, &i_this->m3AF4, (s8)actor->current.roomNo); } else if (sVar2 < 0) { i_this->m3960 = 0; - i_this->m3AF4.end(); + i_this->m3AF4.remove(); } else { mDoAud_seStart(JA_SE_CM_BWD_SAND_MOVE, &i_this->m3954, 0, dComIfGp_getReverb(fopAcM_GetRoomNo(actor))); } @@ -2220,9 +2223,9 @@ static BOOL daBwd_Execute(bwd_class* i_this) { if (i_this->m3AE0[j] != 0) { i_this->m3AE0[j]--; if (i_this->m3AE0[j] == 0) { - i_this->m3978[j].end(); + i_this->m3978[j].remove(); if (j < 2) { - i_this->m3AB8[j].end(); + i_this->m3AB8[j].remove(); } } } @@ -2302,14 +2305,14 @@ static BOOL daBwd_Delete(bwd_class* i_this) { mDoAud_seDeleteObject(¢er_pos); mDoAud_seDeleteObject(&i_this->m3954); for (s32 i = 0; i < (s32)ARRAY_SIZE(i_this->m3978); i++) { - i_this->m3978[i].end(); + i_this->m3978[i].remove(); if (i < 2) { - i_this->m3AB8[i].end(); + i_this->m3AB8[i].remove(); } } - i_this->m3AF4.end(); + i_this->m3AF4.remove(); for (s32 i = 0; i < (s32)ARRAY_SIZE(i_this->m3B54); i++) { - i_this->m3B54[i].end(); + i_this->m3B54[i].remove(); } return TRUE; } @@ -2350,10 +2353,10 @@ static BOOL useHeapInit(fopAc_ac_c* a_this) { 0x11020203 ); i_this->m02C0 = pmVar1; - if ((i_this->m02C0 == NULL) || (pJVar4 = i_this->m02C0->getModel(), pJVar4 == NULL)) { + if ((i_this->m02C0 == NULL) || (i_this->m02C0->getModel() == NULL)) { return FALSE; } - pJVar4 = mDoExt_J3DModel__create(pJVar4->getModelData(), 0, 0x11020203); + pJVar4 = mDoExt_J3DModel__create(i_this->m02C0->getModel()->getModelData(), 0, 0x11020203); i_this->m02CC = pJVar4; if (i_this->m02CC == NULL) { return FALSE; diff --git a/src/d/actor/d_a_dk.cpp b/src/d/actor/d_a_dk.cpp index 5703fa72a..1830a8911 100644 --- a/src/d/actor/d_a_dk.cpp +++ b/src/d/actor/d_a_dk.cpp @@ -306,7 +306,7 @@ static BOOL daDk_IsDelete(dk_class*) { /* 00000D10-00000D7C .text daDk_Delete__FP8dk_class */ static BOOL daDk_Delete(dk_class* a_this) { dComIfG_resDelete(&a_this->mPhs, "Dk"); - a_this->field_0xACC.end(); + a_this->field_0xACC.remove(); mDoHIO_deleteChild(l_HIO.mNo); return TRUE; } diff --git a/src/d/actor/d_a_dr2.cpp b/src/d/actor/d_a_dr2.cpp index 14b14abd4..c31367441 100644 --- a/src/d/actor/d_a_dr2.cpp +++ b/src/d/actor/d_a_dr2.cpp @@ -125,7 +125,7 @@ void iwa_draw(dr2_class* i_this) { mDoExt_modelUpdateDL(i_this->unk_418); if (i_this->unk_424 != 0) { J3DModelData* modelData = i_this->unk_41C->getModelData(); - i_this->unk_420->entry(modelData, i_this->unk_420->getFrame()); + i_this->unk_420->entry(modelData); g_env_light.setLightTevColorType(i_this->unk_41C, &i_this->actor.tevStr); mDoExt_modelUpdateDL(i_this->unk_41C); } @@ -160,14 +160,14 @@ void yuka_draw(dr2_class* i_this) { if (!i_this->unk_43C) { g_env_light.setLightTevColorType(i_this->unk_428, &i_this->actor.tevStr); modelData = i_this->unk_428->getModelData(); - i_this->unk_430->entry(modelData, i_this->unk_430->getFrame()); + i_this->unk_430->entry(modelData); mDoExt_modelUpdateDL(i_this->unk_428); } else { g_env_light.setLightTevColorType(i_this->unk_42C, &i_this->actor.tevStr); modelData = i_this->unk_42C->getModelData(); - i_this->unk_434->entry(modelData, i_this->unk_434->getFrame()); + i_this->unk_434->entry(modelData); modelData = i_this->unk_42C->getModelData(); - i_this->unk_438->entry(modelData, i_this->unk_438->getFrame()); + i_this->unk_438->entry(modelData); mDoExt_modelUpdateDL(i_this->unk_42C); } } diff --git a/src/d/actor/d_a_esa.cpp b/src/d/actor/d_a_esa.cpp index 6431a7caf..3793ce1d2 100644 --- a/src/d/actor/d_a_esa.cpp +++ b/src/d/actor/d_a_esa.cpp @@ -160,7 +160,7 @@ void esa_1_move(esa_class* i_this) { i_this->mTimer[0] = 10000; } - i_this->field_0x2A4.end(); + i_this->field_0x2A4.remove(); i_this->current.pos.y = daSea_calcWave(i_this->current.pos.x, i_this->current.pos.z); if(i_this->mTimer[0] == 0) { @@ -219,7 +219,7 @@ static BOOL daEsa_IsDelete(esa_class* i_this) { /* 800E89C0-800E89E8 .text daEsa_Delete__FP9esa_class */ static BOOL daEsa_Delete(esa_class* i_this) { - i_this->field_0x2A4.end(); + i_this->field_0x2A4.remove(); return true; } diff --git a/src/d/actor/d_a_fganon.cpp b/src/d/actor/d_a_fganon.cpp index 842670b4c..d7247aec6 100644 --- a/src/d/actor/d_a_fganon.cpp +++ b/src/d/actor/d_a_fganon.cpp @@ -250,15 +250,14 @@ void shot(fganon_class* i_this) { cLib_addCalcAngleS2(&i_this->shape_angle.y, fopAcM_searchPlayerAngleY(actor), 10, 0x400); switch(i_this->mMode) { case 0: { - if (!i_this->m408) { - anm_init(i_this, FGANON_BCK_TAME1, 10.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, -1); - i_this->mMode++; - i_this->m3A4[0] = 40; - fopAcM_monsSeStart(actor, JA_SE_CV_PG_EBALL_MAKE_S, 0); - // Fall-through - } else { + if (i_this->m408) { break; } + anm_init(i_this, FGANON_BCK_TAME1, 10.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, -1); + i_this->mMode++; + i_this->m3A4[0] = 40; + fopAcM_monsSeStart(actor, JA_SE_CV_PG_EBALL_MAKE_S, 0); + // Fall-through } case 1: { if (i_this->m3A4[0] == 30) { @@ -611,15 +610,14 @@ void shot2(fganon_class* i_this) { } case 2: { fopAcM_seStart(i_this, JA_SE_CM_PG_EBALL_MAKING_L, 0); - if (i_this->m3A4[0] == 0) { - anm_init(i_this, FGANON_BCK_NAGERU_S1, 3.0f, J3DFrameCtrl::EMode_NONE, 1.0f, -1); - i_this->mMode++; - i_this->mEmitters2[0] = dComIfGp_particle_set(dPa_name::ID_SCENE_821C, &i_this->current.pos, NULL); - i_this->mEmitters2[1] = dComIfGp_particle_set(dPa_name::ID_SCENE_821D, &i_this->current.pos, NULL); - } - else { + if (i_this->m3A4[0] != 0) { break; } + anm_init(i_this, FGANON_BCK_NAGERU_S1, 3.0f, J3DFrameCtrl::EMode_NONE, 1.0f, -1); + i_this->mMode++; + i_this->mEmitters2[0] = dComIfGp_particle_set(dPa_name::ID_SCENE_821C, &i_this->current.pos, NULL); + i_this->mEmitters2[1] = dComIfGp_particle_set(dPa_name::ID_SCENE_821D, &i_this->current.pos, NULL); + // Fall-through } case 3: { if (mFrame == REG8_S(5) + 15) { @@ -716,11 +714,8 @@ void spinattack2(fganon_class* i_this) { i_this->mMode = 3; i_this->speedF = 0.0f; fopAcM_monsSeStart(i_this, JA_SE_CV_PG_EBALL_FIRE_S, 0); - break; - } - else { - break; } + break; } case 3: { if (mFrame == 14) { @@ -944,49 +939,47 @@ void fail(fganon_class* i_this) { break; } case 1: { - if (i_this->mpMorf->isStop()) { - i_this->mMode = 2; - i_this->m3A4[0] = 30; - - dBgS_LinChk linChk; - - cMtx_YrotS(*calc_mtx, i_this->home.angle.y); - - cXyz offset; - offset.x = 0.0f; - offset.y = 0.0f; - offset.z = 10000.0f; - - cXyz transformedPos; - MtxPosition(&offset, &transformedPos); - - offset = i_this->home.pos; - offset.y += 100.0f; - - transformedPos += offset; - - linChk.Set(&offset, &transformedPos, a_this); - - cMtx_copy(i_this->mpMorf->getModel()->getAnmMtx(0x18), *calc_mtx); - - offset.x = 0.0f; - offset.y = 0.0f; - offset.z = 0.0f; - - MtxPosition(&offset, &transformedPos); - - if (dComIfG_Bgsp()->LineCross(&linChk)) { - offset = linChk.GetCross(); - } - - i_this->m6A0 = i_this->shape_angle.y - cM_atan2s(transformedPos.x - offset.x, transformedPos.z - offset.z) + 0x7058 + REG0_S(8); - i_this->m6A4 = REG0_S(5) + 0x80; - i_this->m6A8 = 100; + if (!i_this->mpMorf->isStop()) { break; } - else { - break; + i_this->mMode = 2; + i_this->m3A4[0] = 30; + + dBgS_LinChk linChk; + + cMtx_YrotS(*calc_mtx, i_this->home.angle.y); + + cXyz offset; + offset.x = 0.0f; + offset.y = 0.0f; + offset.z = 10000.0f; + + cXyz transformedPos; + MtxPosition(&offset, &transformedPos); + + offset = i_this->home.pos; + offset.y += 100.0f; + + transformedPos += offset; + + linChk.Set(&offset, &transformedPos, a_this); + + cMtx_copy(i_this->mpMorf->getModel()->getAnmMtx(0x18), *calc_mtx); + + offset.x = 0.0f; + offset.y = 0.0f; + offset.z = 0.0f; + + MtxPosition(&offset, &transformedPos); + + if (dComIfG_Bgsp()->LineCross(&linChk)) { + offset = linChk.GetCross(); } + + i_this->m6A0 = i_this->shape_angle.y - cM_atan2s(transformedPos.x - offset.x, transformedPos.z - offset.z) + 0x7058 + REG0_S(8); + i_this->m6A4 = REG0_S(5) + 0x80; + i_this->m6A8 = 100; + break; } case 2: { if (i_this->m3A4[0] == 0) { @@ -1865,14 +1858,13 @@ void demo_camera(fganon_class* i_this) { } case 54: { cLib_addCalc2(&i_this->mB68.y, (i_this->eyePos.y - 30.0f) + REG0_F(11), 0.1f, 20.0f); - if (i_this->mB56 == 100) { - i_this->mB54 = 55; - player->changeDemoMode(daPy_demo_c::DEMO_LAROUND_e); - i_this->mB56 = 0; - } - else { + if (i_this->mB56 != 100) { break; } + i_this->mB54 = 55; + player->changeDemoMode(daPy_demo_c::DEMO_LAROUND_e); + i_this->mB56 = 0; + // Fall-through } case 55: { if (i_this->mB56 == 20) { diff --git a/src/d/actor/d_a_floor.cpp b/src/d/actor/d_a_floor.cpp index 0c356d52f..bc057b833 100644 --- a/src/d/actor/d_a_floor.cpp +++ b/src/d/actor/d_a_floor.cpp @@ -30,7 +30,7 @@ void rideCallBack(dBgW*, fopAc_ac_c* i_this, fopAc_ac_c* i_other) { /* 000000DC-0000012C .text Delete__9daFloor_cFv */ BOOL daFloor_c::Delete() { - mSmokeCallBack.end(); + mSmokeCallBack.remove(); dComIfG_resDelete(&mPhs, m_arcname); return TRUE; } diff --git a/src/d/actor/d_a_ghostship.cpp b/src/d/actor/d_a_ghostship.cpp index 23972a143..a24466e4c 100644 --- a/src/d/actor/d_a_ghostship.cpp +++ b/src/d/actor/d_a_ghostship.cpp @@ -451,7 +451,7 @@ bool daGhostship_c::_draw() { modelData->getMaterialNodePointer(i)->getTevKColor(3)->mColor.a = alpha; } - mBtk.entry(modelData, mBtk.getFrame()); + mBtk.entry(modelData); mDoExt_modelUpdateDL(mpModel); mBtk.remove(modelData); diff --git a/src/d/actor/d_a_ki.cpp b/src/d/actor/d_a_ki.cpp index 7bf1da640..c2ca825df 100644 --- a/src/d/actor/d_a_ki.cpp +++ b/src/d/actor/d_a_ki.cpp @@ -236,7 +236,7 @@ static BOOL daKi_Draw(ki_class* i_this) { dComIfGd_setList(); } else { J3DModelData* pModelData = pModel->getModelData(); - i_this->m920->entry(pModelData, i_this->m920->getFrame()); + i_this->m920->entry(pModelData); dComIfGd_setListMaskOff(); i_this->mpMorf->entryDL(); diff --git a/src/d/actor/d_a_knob00.cpp b/src/d/actor/d_a_knob00.cpp index dd1c9e436..4f2bb79a6 100644 --- a/src/d/actor/d_a_knob00.cpp +++ b/src/d/actor/d_a_knob00.cpp @@ -807,7 +807,7 @@ BOOL daKnob00_c::draw() { g_env_light.setLightTevColorType(mpModel2, &tevStr); J3DModelData* modelData = mpModel->getModelData(); - mBckAnm.entry(modelData, mBckAnm.getFrame()); + mBckAnm.entry(modelData); mpModel->calc(); mpModel2->setBaseTRMtx(mpModel->getAnmMtx(m_jnt)); mDoExt_modelUpdateDL(mpModel2); diff --git a/src/d/actor/d_a_lbridge.cpp b/src/d/actor/d_a_lbridge.cpp index 14c23c4c0..f1db1d587 100644 --- a/src/d/actor/d_a_lbridge.cpp +++ b/src/d/actor/d_a_lbridge.cpp @@ -20,7 +20,7 @@ static BOOL CheckCreateHeap(fopAc_ac_c* i_this) { /* 00000098-00000384 .text CreateHeap__11daLbridge_cFv */ BOOL daLbridge_c::CreateHeap() { J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes(m_arcname, GBRG00_BDL_GBRG00); - JUT_ASSERT(0xD6, modelData != NULL); + JUT_ASSERT(DEMO_SELECT(213, 214), modelData != NULL); mpModel = mDoExt_J3DModel__create(modelData, 0x80000U, 0x11000223U); @@ -29,14 +29,14 @@ BOOL daLbridge_c::CreateHeap() { } J3DAnmTextureSRTKey* pbtk = (J3DAnmTextureSRTKey*)dComIfG_getObjectRes(m_arcname, GBRG00_BTK_GBRG00); - JUT_ASSERT(0xE8, pbtk != NULL); + JUT_ASSERT(DEMO_SELECT(231, 232), pbtk != NULL); if (!mBtkAnm.init(modelData, pbtk, TRUE, J3DFrameCtrl::EMode_LOOP, 1.0f, 0, -1, false, 0)) { return FALSE; } J3DAnmColor* pbpk = (J3DAnmColor*)dComIfG_getObjectRes(m_arcname, GBRG00_BPK_GBRG00); - JUT_ASSERT(0xF6, pbpk != NULL); + JUT_ASSERT(DEMO_SELECT(245, 246), pbpk != NULL); if (!mBpkAnm.init(modelData, pbpk, TRUE, J3DFrameCtrl::EMode_NONE, 1.0f, 0, -1, false, 0)) { return FALSE; @@ -46,7 +46,7 @@ BOOL daLbridge_c::CreateHeap() { mBpkAnm.setPlaySpeed(1.0f); J3DAnmTevRegKey* pbrk = (J3DAnmTevRegKey*)dComIfG_getObjectRes(m_arcname, GBRG00_BRK_GBRG00); - JUT_ASSERT(0x106, pbrk != NULL); + JUT_ASSERT(DEMO_SELECT(261, 262), pbrk != NULL); if (!mBrkAnm.init(modelData, pbrk, TRUE, J3DFrameCtrl::EMode_LOOP, 1.0f, 0, -1, false, 0)) { return FALSE; @@ -168,7 +168,7 @@ void daLbridge_c::sw_check() { u8 alpha; if (!isSw) { - if (mBpkAnm.getFrame() == (f32)mBpkAnm.getFrameCtrl()->getStart()) { + if (mBpkAnm.getFrame() == mBpkAnm.getStartFrame()) { fopAcM_offDraw(this); } @@ -300,11 +300,16 @@ bool daLbridge_c::_delete() { bool isSw = fopAcM_isSwitch(this, mSwitchNo); - if ((mSwitchNo == 0xFF || isSw == true) && heap != NULL) { + if ( + (mSwitchNo == 0xFF || isSw == true) + #if VERSION > VERSION_DEMO + && heap != NULL + #endif + ) { dComIfG_Bgsp()->Release(mpBgW); } - dComIfG_resDelete(&mPhs, m_arcname); + dComIfG_resDeleteDemo(&mPhs, m_arcname); return TRUE; } diff --git a/src/d/actor/d_a_machine.cpp b/src/d/actor/d_a_machine.cpp index 7bc414071..205e9b380 100644 --- a/src/d/actor/d_a_machine.cpp +++ b/src/d/actor/d_a_machine.cpp @@ -379,7 +379,7 @@ void daMachine_c::set_body() { void daMachine_c::set_at() { f32 f1 = 5.0f; f32 f2 = 25.0f; - f32 frame = field_0xc04.getFrameCtrl()->getFrame(); + f32 frame = field_0xc04.getFrame(); if (f1 < frame && f2 > frame) { field_0xc6c.set(field_0xc3c[0][3], field_0xc3c[1][3], diff --git a/src/d/actor/d_a_npc_bmsw.cpp b/src/d/actor/d_a_npc_bmsw.cpp index bdb623f68..fda6ad7cc 100644 --- a/src/d/actor/d_a_npc_bmsw.cpp +++ b/src/d/actor/d_a_npc_bmsw.cpp @@ -997,7 +997,7 @@ BOOL daNpc_Bmsw_c::shiwake_game_action(void*) { dComIfGp_evmng_cutEnd(staff_id); if (dComIfGp_evmng_endCheck(field_0x9D8)) { - dComIfGp_event_onEventFlag(8); + dComIfGp_event_reset(); s16 rupees = dComIfGp_getMiniGameRupee(); fpc_ProcID msg = daNpc_Bmsw_getGameEndMsg(rupees); field_0x9C0 = msg; diff --git a/src/d/actor/d_a_npc_btsw.cpp b/src/d/actor/d_a_npc_btsw.cpp index f4d8dbcf0..b6be40032 100644 --- a/src/d/actor/d_a_npc_btsw.cpp +++ b/src/d/actor/d_a_npc_btsw.cpp @@ -665,7 +665,7 @@ BOOL daNpc_Btsw_c::dummy_event_action(void*) { if (dComIfGp_evmng_endCheck(field_0x9C8)) { field_0x9C8 = -1; field_0x9C7 = 3; - dComIfGp_event_onEventFlag(8); + dComIfGp_event_reset(); setAction(&daNpc_Btsw_c::wait_action, NULL); } @@ -833,7 +833,7 @@ BOOL daNpc_Btsw_c::shiwake_game_action(void*) { } else if (dComIfG_getTimerPtr() == NULL) { s32 staff_id = dComIfGp_evmng_getMyStaffId("Btsw"); dComIfGp_evmng_cutEnd(staff_id); - dComIfGp_event_onEventFlag(8); + dComIfGp_event_reset(); s16 rupees = dComIfGp_getMiniGameRupee(); field_0x9B0 = daNpc_Btsw_getGameEndMsg(rupees); @@ -867,7 +867,7 @@ BOOL daNpc_Btsw_c::getdemo_action(void*) { if (mActionStatus == ACTION_STARTING) { mActionStatus++; } else if (mActionStatus != ACTION_ENDING && dComIfGp_evmng_endCheck("GETMOTHERLETTER")) { - dComIfGp_event_onEventFlag(8); + dComIfGp_event_reset(); field_0x9C7 = 1; field_0x9B0 = 0x1A9C; diff --git a/src/d/actor/d_a_npc_cb1.cpp b/src/d/actor/d_a_npc_cb1.cpp index debca4c72..77b755805 100644 --- a/src/d/actor/d_a_npc_cb1.cpp +++ b/src/d/actor/d_a_npc_cb1.cpp @@ -2972,7 +2972,7 @@ BOOL daNpc_Cb1_c::draw() { } else if(mpNutModel && isNut()) { J3DModelData* pModelData = mpNutModel->getModelData(); - mNutBckAnim.entry(pModelData, mNutBckAnim.getFrame()); + mNutBckAnim.entry(pModelData); g_env_light.setLightTevColorType(mpNutModel, &tevStr); diff --git a/src/d/actor/d_a_npc_fa1.cpp b/src/d/actor/d_a_npc_fa1.cpp index 5bee72834..3f4751634 100644 --- a/src/d/actor/d_a_npc_fa1.cpp +++ b/src/d/actor/d_a_npc_fa1.cpp @@ -906,7 +906,7 @@ void daNpc_Fa1_c::findPlayer() { /* 800FD050-800FD0F0 .text _delete__11daNpc_Fa1_cFv */ BOOL daNpc_Fa1_c::_delete() { - mSparklePtclCallback.end(); + mSparklePtclCallback.remove(); if (isTypeBaba()) { dKy_efplight_cut(&mPointLight); } diff --git a/src/d/actor/d_a_npc_km1.cpp b/src/d/actor/d_a_npc_km1.cpp index c6829a27f..d408ec676 100644 --- a/src/d/actor/d_a_npc_km1.cpp +++ b/src/d/actor/d_a_npc_km1.cpp @@ -503,7 +503,7 @@ void daNpc_Km1_c::privateCut() { /* 00001144-00001164 .text endEvent__11daNpc_Km1_cFv */ void daNpc_Km1_c::endEvent() { - dComIfGp_event_onEventFlag(8); + dComIfGp_event_reset(); field_0x7CB = 0xFF; } diff --git a/src/d/actor/d_a_npc_nz.cpp b/src/d/actor/d_a_npc_nz.cpp index 9c4242fc3..67d7dd9c0 100644 --- a/src/d/actor/d_a_npc_nz.cpp +++ b/src/d/actor/d_a_npc_nz.cpp @@ -907,7 +907,7 @@ BOOL daNpc_Nz_c::createInit() { /* 00002768-0000282C .text setSmokeParticle__10daNpc_Nz_cFv */ void daNpc_Nz_c::setSmokeParticle() { if(field_0x914.getEmitter() != NULL) { - field_0x914.end(); + field_0x914.remove(); } if(field_0x914.getEmitter() == NULL) { @@ -966,7 +966,7 @@ daNpc_Nz_c::daNpc_Nz_c() { /* 00002E00-00002E6C .text _delete__10daNpc_Nz_cFv */ bool daNpc_Nz_c::_delete() { if(field_0x914.getEmitter()) { - field_0x914.end(); + field_0x914.remove(); } dComIfG_resDelete(&mPhs1, m_arc_name); diff --git a/src/d/actor/d_a_npc_os.cpp b/src/d/actor/d_a_npc_os.cpp index 5deec091f..0a04df278 100644 --- a/src/d/actor/d_a_npc_os.cpp +++ b/src/d/actor/d_a_npc_os.cpp @@ -2079,7 +2079,7 @@ BOOL daNpc_Os_c::draw() { g_env_light.settingTevStruct(TEV_TYPE_ACTOR, ¤t.pos, &tevStr); g_env_light.setLightTevColorType(pModel, &tevStr); - mBrkAnm.entry(pModelData, mBrkAnm.getFrame()); + mBrkAnm.entry(pModelData); mpMorf->entryDL(); mBrkAnm.remove(pModelData); diff --git a/src/d/actor/d_a_obj_barrel2.cpp b/src/d/actor/d_a_obj_barrel2.cpp index b07b1bd41..dd100bbe9 100644 --- a/src/d/actor/d_a_obj_barrel2.cpp +++ b/src/d/actor/d_a_obj_barrel2.cpp @@ -1096,7 +1096,7 @@ bool daObjBarrel2::Act_c::_draw() { g_env_light.settingTevStruct(TEV_TYPE_ACTOR, ¤t.pos, &tevStr); g_env_light.setLightTevColorType(m298, &tevStr); J3DModelData* mdl_data = m298->getModelData(); - m29C->entry(mdl_data, m29C->getFrame()); + m29C->entry(mdl_data); mDoExt_modelUpdateDL(m298); } return TRUE; diff --git a/src/d/actor/d_a_obj_canon.cpp b/src/d/actor/d_a_obj_canon.cpp index 8f348e734..ab619591a 100644 --- a/src/d/actor/d_a_obj_canon.cpp +++ b/src/d/actor/d_a_obj_canon.cpp @@ -496,7 +496,7 @@ bool daObj_Canon_c::_execute() { if(field_0x470.getEmitter()) { if(cLib_calcTimer(&field_0x484) == 0) { - field_0x470.end(); + field_0x470.remove(); } } @@ -604,7 +604,7 @@ cPhs_State daObj_Canon_c::_create() { /* 00001BEC-00001C50 .text _delete__13daObj_Canon_cFv */ bool daObj_Canon_c::_delete() { dComIfG_resDelete(&mPhs, m_arc_name); - field_0x470.end(); + field_0x470.remove(); #if VERSION > VERSION_DEMO mDoAud_seDeleteObject(&field_0x450); #endif diff --git a/src/d/actor/d_a_obj_eskban.cpp b/src/d/actor/d_a_obj_eskban.cpp index b7975390a..e4c2feaa3 100644 --- a/src/d/actor/d_a_obj_eskban.cpp +++ b/src/d/actor/d_a_obj_eskban.cpp @@ -168,7 +168,7 @@ daObjEskban::Act_c::Act_c() {} /* 000009C0-00000A10 .text Delete__Q211daObjEskban5Act_cFv */ BOOL daObjEskban::Act_c::Delete() { if (M_smoke) { - M_smoke->end(); + M_smoke->remove(); M_smoke = NULL; } return TRUE; diff --git a/src/d/actor/d_a_obj_figure.cpp b/src/d/actor/d_a_obj_figure.cpp index 20d1a8328..3e25b690f 100644 --- a/src/d/actor/d_a_obj_figure.cpp +++ b/src/d/actor/d_a_obj_figure.cpp @@ -614,7 +614,7 @@ BOOL daObjFigure_c::_draw() { if(mbDisplay) { if(mpBrkAnm) { J3DModelData* pModelData2 = mpModel->getModelData(); - mpBrkAnm->entry(pModelData2, mpBrkAnm->getFrame()); + mpBrkAnm->entry(pModelData2); } mBtpAnm1.entry(pModelData, 1); diff --git a/src/d/actor/d_a_obj_homensmoke.cpp b/src/d/actor/d_a_obj_homensmoke.cpp index 215605360..af3120f10 100644 --- a/src/d/actor/d_a_obj_homensmoke.cpp +++ b/src/d/actor/d_a_obj_homensmoke.cpp @@ -68,7 +68,7 @@ namespace daObjHomensmoke { /* 0000048C-000004C8 .text _delete__Q215daObjHomensmoke5Act_cFv */ bool Act_c::_delete() { if (mSmokeCb.getEmitter()) { - mSmokeCb.end(); + mSmokeCb.remove(); } return true; } diff --git a/src/d/actor/d_a_obj_ikada.cpp b/src/d/actor/d_a_obj_ikada.cpp index a401a0c13..c62618521 100644 --- a/src/d/actor/d_a_obj_ikada.cpp +++ b/src/d/actor/d_a_obj_ikada.cpp @@ -1244,7 +1244,7 @@ bool daObj_Ikada_c::_draw() { if (mType == 4) { J3DModelData* modelData = mpModel->getModelData(); - mBckAnm.entry(modelData, mBckAnm.getFrame()); + mBckAnm.entry(modelData); mDoExt_modelUpdateDL(mpModel); mpModel->getModelData()->getJointNodePointer(0)->setMtxCalc(NULL); } else { diff --git a/src/d/actor/d_a_obj_kanat.cpp b/src/d/actor/d_a_obj_kanat.cpp index 7a21e2bdb..94418df7f 100644 --- a/src/d/actor/d_a_obj_kanat.cpp +++ b/src/d/actor/d_a_obj_kanat.cpp @@ -52,7 +52,7 @@ cPhs_State daObjKanat::Act_c::Mthd_Create() { /* 000002EC-0000031C .text Delete__Q210daObjKanat5Act_cFv */ BOOL daObjKanat::Act_c::Delete() { - mSmokeCb.end(); + mSmokeCb.remove(); return TRUE; } diff --git a/src/d/actor/d_a_obj_mkiek.cpp b/src/d/actor/d_a_obj_mkiek.cpp index d7a89a077..d93ac27d5 100644 --- a/src/d/actor/d_a_obj_mkiek.cpp +++ b/src/d/actor/d_a_obj_mkiek.cpp @@ -191,7 +191,7 @@ void daObjMkiek::Act_c::demo() { return; } - dComIfGp_event_onEventFlag(8); + dComIfGp_event_reset(); fopAcM_seStartCurrent(this, JA_SE_OBJ_L_WALL_BREAK, 0); dComIfGp_getVibration().StartShock(4, -0x21, cXyz(0.0f, 1.0f, 0.0f)); fopAcM_delete(this); @@ -230,7 +230,7 @@ BOOL daObjMkiek::Act_c::Draw() { if (m458) { g_env_light.setLightTevColorType(mpModelV, &tevStr); J3DModelData* model_v_data = mpModelV->getModelData(); - mBrkAnm.entry(model_v_data, mBrkAnm.getFrameCtrl()->getFrame()); + mBrkAnm.entry(model_v_data); dComIfGd_setListBG(); mDoExt_modelUpdateDL(mpModelV); dComIfGd_setList(); diff --git a/src/d/actor/d_a_obj_movebox.cpp b/src/d/actor/d_a_obj_movebox.cpp index 3a6cc3a60..9c2101229 100644 --- a/src/d/actor/d_a_obj_movebox.cpp +++ b/src/d/actor/d_a_obj_movebox.cpp @@ -1534,14 +1534,14 @@ namespace daObjMovebox { /* 00002A14-00002A74 .text eff_smoke_slip_end__Q212daObjMovebox5Act_cFv */ void Act_c::eff_smoke_slip_end() { for (int i = 0; i < (int)ARRAY_SIZE(mSmokeCbs); i++) { - mSmokeCbs[i].end(); + mSmokeCbs[i].remove(); } } /* 00002A74-00002AD4 .text eff_smoke_slip_remove__Q212daObjMovebox5Act_cFv */ void Act_c::eff_smoke_slip_remove() { for (int i = 0; i < (int)ARRAY_SIZE(mSmokeCbs); i++) { - mSmokeCbs[i].end(); + mSmokeCbs[i].remove(); } } diff --git a/src/d/actor/d_a_obj_rcloud.cpp b/src/d/actor/d_a_obj_rcloud.cpp index 98be380ad..dd4fb2f5e 100644 --- a/src/d/actor/d_a_obj_rcloud.cpp +++ b/src/d/actor/d_a_obj_rcloud.cpp @@ -220,7 +220,7 @@ bool daObjRcloud_c::_draw() { g_env_light.settingTevStruct(TEV_TYPE_BG0, ¤t.pos, &tevStr); g_env_light.setLightTevColorType(mpModel, &tevStr); J3DModelData* modelData = mpModel->getModelData(); - mBtkAnm.entry(modelData, mBtkAnm.getFrame()); + mBtkAnm.entry(modelData); mpModel->calc(); mpModel->calcMaterial(); setTexMtx(); diff --git a/src/d/actor/d_a_obj_vmc.cpp b/src/d/actor/d_a_obj_vmc.cpp index 138413170..9944b7163 100644 --- a/src/d/actor/d_a_obj_vmc.cpp +++ b/src/d/actor/d_a_obj_vmc.cpp @@ -200,7 +200,7 @@ bool daObjVmc::Act_c::_delete() { dComIfG_Bgsp()->Release(mpBgBase); if (mHasTreeBg == 1) dComIfG_Bgsp()->Release(mpBgTree); - mSmoke.end(); + mSmoke.remove(); dComIfG_resDeleteDemo(&mPhs, M_arcname); return true; } diff --git a/src/d/actor/d_a_player_dproc.inc b/src/d/actor/d_a_player_dproc.inc index 6685ab76f..3e4117bc5 100644 --- a/src/d/actor/d_a_player_dproc.inc +++ b/src/d/actor/d_a_player_dproc.inc @@ -1249,8 +1249,7 @@ BOOL daPy_lk_c::dProcTalismanWait() { mpEquipItemModel->setBaseTRMtx(mDoMtx_stack_c::get()); mSwordAnim.play(); J3DModelData* modelData = mpEquipItemModel->getModelData(); - f32 frame = mSwordAnim.getFrameCtrl()->getFrame(); - mSwordAnim.entry(modelData, frame); + mSwordAnim.entry(modelData); mDoAud_seStart(JA_SE_OBJ_OMAMORI, pcVar1, 0, mReverb); if (mDemo.getParam0() != 0) { onModeFlg(ModeFlg_00000080); diff --git a/src/d/actor/d_a_player_main.cpp b/src/d/actor/d_a_player_main.cpp index e998a8954..89d34c1dd 100644 --- a/src/d/actor/d_a_player_main.cpp +++ b/src/d/actor/d_a_player_main.cpp @@ -5888,7 +5888,7 @@ BOOL daPy_lk_c::commonProcInit(daPy_PROC proc) { m33A8.end(); m32E4.end(); m32F0.end(); - mSmokeEcallBack.end(); + mSmokeEcallBack.remove(); if (!checkGrabWear()) { m35D8 = 0.0f; @@ -10132,9 +10132,9 @@ void daPy_lk_c::setCollision() { mAtCyl.ResetAtHit(); mAtCyl.OffAtSetBit(); offNoResetFlg0(daPyFlg0_CUT_AT_FLG); - m331C.end(); - m332C.end(); - m333C.end(); + m331C.remove(); + m332C.remove(); + m333C.remove(); } if (fanWindCrashEffectDraw()) { f32 fVar3 = mpYbafo00Btk->getFrame() + 1.0f; @@ -11813,7 +11813,7 @@ BOOL daPy_lk_c::playerDelete() { mFanSwingCb.deleteCallBack(); m338C.end(); m33A8.end(); - m3280.end(); + m3280.remove(); m334C.end(); m336C.end(); mSwimTailEcallBack[0].remove(); diff --git a/src/d/actor/d_a_player_particle.inc b/src/d/actor/d_a_player_particle.inc index 0d49149e9..87ab66bb4 100644 --- a/src/d/actor/d_a_player_particle.inc +++ b/src/d/actor/d_a_player_particle.inc @@ -654,7 +654,7 @@ void daPy_lk_c::setWaterRipple() { JPABaseEmitter* emitter = m3280.getEmitter(); if (emitter != NULL && ((emitter->mGlobalParticleScale.x < 0.8f && checkNoResetFlg0(daPyFlg0_UNK80)) || (emitter->mGlobalParticleScale.x > 0.8f && !checkNoResetFlg0(daPyFlg0_UNK80)))) { - m3280.end(); + m3280.remove(); emitter = dComIfGp_particle_setShipTail(dPa_name::ID_COMMON_0033, ¤t.pos, NULL, NULL, 0xFF, &m3280); } @@ -667,7 +667,7 @@ void daPy_lk_c::setWaterRipple() { } } } else if (m3280.getEmitter() != NULL) { - m3280.end(); + m3280.remove(); } if (checkModeFlg(ModeFlg_SWIM)) { diff --git a/src/d/actor/d_a_player_sword.inc b/src/d/actor/d_a_player_sword.inc index 0fd51baac..4b76653c1 100644 --- a/src/d/actor/d_a_player_sword.inc +++ b/src/d/actor/d_a_player_sword.inc @@ -1460,7 +1460,7 @@ BOOL daPy_lk_c::procCutTurn() { if (frameCtrl.getFrame() > m35A0) { m32F0.end(); - mSmokeEcallBack.end(); + mSmokeEcallBack.remove(); } setSpecialBattle(1); if (doTrigger() && dComIfGp_getDoStatus() == dActStts_PARRY_e) { diff --git a/src/d/actor/d_a_ship.cpp b/src/d/actor/d_a_ship.cpp index f33138a81..1db576452 100644 --- a/src/d/actor/d_a_ship.cpp +++ b/src/d/actor/d_a_ship.cpp @@ -2514,7 +2514,7 @@ BOOL daShip_c::procTalk() { return procTurn_init(); } mpHeadAnm->setPlaySpeed(-1.0f); - dComIfGp_event_onEventFlag(8); + dComIfGp_event_reset(); changeDemoEndProc(); return TRUE; } @@ -2601,7 +2601,7 @@ BOOL daShip_c::procTurn() { if (m037A <= 0) { camera->mCamera.Start(); camera->mCamera.Reset(); - dComIfGp_event_onEventFlag(8); + dComIfGp_event_reset(); changeDemoEndProc(); m038E = 0; onStateFlg(daSFLG_UNK100000_e); @@ -2804,7 +2804,7 @@ BOOL daShip_c::procTactWarp() { daTornado_c* mpTornado = (daTornado_c*)fopAcM_SearchByID(mTactWarpID); if (mpTornado == NULL || fpcM_IsCreating(mTactWarpID)) { if (mTactWarpID == fpcM_ERROR_PROCESS_ID_e) { - dComIfGp_event_onEventFlag(8); + dComIfGp_event_reset(); m1984.remove(); m1998.remove(); procPaddleMove_init(); diff --git a/src/d/actor/d_a_syan.cpp b/src/d/actor/d_a_syan.cpp index 6613b61c0..9729f8449 100644 --- a/src/d/actor/d_a_syan.cpp +++ b/src/d/actor/d_a_syan.cpp @@ -187,7 +187,7 @@ static BOOL daSyan_IsDelete(syan_class* i_this) { static BOOL daSyan_Delete(syan_class* i_this) { dComIfG_resDelete(&i_this->mPhs, "Syan"); for (s32 i = 0; i < (s32)ARRAY_SIZE(i_this->emtrCallBack); i++) - i_this->emtrCallBack[i].end(); + i_this->emtrCallBack[i].remove(); return TRUE; } diff --git a/src/d/actor/d_a_tbox.cpp b/src/d/actor/d_a_tbox.cpp index 1550e21e0..c355a17f8 100644 --- a/src/d/actor/d_a_tbox.cpp +++ b/src/d/actor/d_a_tbox.cpp @@ -462,16 +462,14 @@ void daTbox_c::CreateInit() { mOpenAnm.setPlaySpeed(0.0f); if (checkOpen()) { - J3DFrameCtrl* frameCtrl = mOpenAnm.getFrameCtrl(); - frameCtrl->setFrame(frameCtrl->getEnd()); + mOpenAnm.setFrame(mOpenAnm.getEndFrame()); setAction(&daTbox_c::actionWait); if (checkEnv()) { mInvisibleScrollVal = 2.0f; - frameCtrl = mpAppearRegAnm->getFrameCtrl(); - frameCtrl->setFrame(frameCtrl->getEnd()); + mpAppearRegAnm->setFrame(mpAppearRegAnm->getEndFrame()); } } else { @@ -490,8 +488,7 @@ void daTbox_c::CreateInit() { mInvisibleScrollVal = 2.0f; - J3DFrameCtrl* frameCtrl = mpAppearRegAnm->getFrameCtrl(); - frameCtrl->setFrame(frameCtrl->getEnd()); + mpAppearRegAnm->setFrame(mpAppearRegAnm->getEndFrame()); } else { flagOn(daTboxFlg_UNK_04); @@ -744,7 +741,7 @@ void daTbox_c::demoProcAppear() { } if (mAppearTimer == 0x04 && mSmokeCB.getEmitter() != NULL) { - mSmokeCB.end(); + mSmokeCB.remove(); } if (mAppearTimer != 0x00) { diff --git a/src/d/actor/d_a_wall.cpp b/src/d/actor/d_a_wall.cpp index d1ccfc245..037d5a305 100644 --- a/src/d/actor/d_a_wall.cpp +++ b/src/d/actor/d_a_wall.cpp @@ -85,7 +85,7 @@ static dCcD_SrcTri l_tri_src = { /* 00000078-00000100 .text _delete__8daWall_cFv */ bool daWall_c::_delete() { - mSmokeCb.end(); + mSmokeCb.remove(); if (heap != NULL && mState == false) dComIfG_Bgsp()->Release(mpBgW); diff --git a/src/d/d_door.cpp b/src/d/d_door.cpp index f1888e722..4ef90e4b5 100644 --- a/src/d/d_door.cpp +++ b/src/d/d_door.cpp @@ -417,7 +417,7 @@ void dDoor_smoke_c::smokeProc(dDoor_info_c* door) { /* 8006C41C-8006C448 .text smokeEnd__13dDoor_smoke_cFv */ void dDoor_smoke_c::smokeEnd() { - mSmokeCb.end(); + mSmokeCb.remove(); } /* 8006C448-8006C478 .text keyResLoad__12dDoor_key2_cFv */ diff --git a/src/m_Do/m_Do_ext.cpp b/src/m_Do/m_Do_ext.cpp index b7b87d060..a2bae260e 100644 --- a/src/m_Do/m_Do_ext.cpp +++ b/src/m_Do/m_Do_ext.cpp @@ -65,12 +65,10 @@ void mDoExt_setJ3DData(Mtx mtx, const J3DTransformInfo* transformInfo, u16 jnt_n J3DSys::mParentS.z = transformInfo->mScale.z; } -static void dummy1() { +static void dummy1(J3DJoint* joint, J3DAnmTransform* anmTransform) { // Fix the weak function order of J3DAnmTransform::getTransform. // There was most likely an unused function here that got stripped out. j3dSys.setCurrentMtxCalc(NULL); - J3DJoint* joint; - J3DAnmTransform* anmTransform; anmTransform->getTransform(0, &joint->getTransformInfo()); }