diff --git a/configure.py b/configure.py index 21edcc10a..22427f24f 100755 --- a/configure.py +++ b/configure.py @@ -1542,7 +1542,7 @@ config.libs = [ ActorRel(Matching, "d_a_ykgr"), ActorRel(Matching, "d_a_alldie"), ActorRel(Matching, "d_a_am"), - ActorRel(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d_a_am2"), + ActorRel(Matching, "d_a_am2"), ActorRel(Matching, "d_a_amiprop"), ActorRel(Matching, "d_a_arrow_iceeff"), ActorRel(Matching, "d_a_arrow_lighteff"), @@ -1756,10 +1756,10 @@ config.libs = [ ActorRel(Matching, "d_a_obj_hha"), ActorRel(Matching, "d_a_obj_hlift"), ActorRel(Matching, "d_a_obj_homen"), - ActorRel(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d_a_obj_homensmoke"), + ActorRel(Matching, "d_a_obj_homensmoke"), ActorRel(Matching, "d_a_obj_hsehi1"), ActorRel(NonMatching, "d_a_obj_htetu1"), - ActorRel(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d_a_obj_iceisland"), + ActorRel(Matching, "d_a_obj_iceisland"), ActorRel(Matching, "d_a_obj_jump"), ActorRel(NonMatching, "d_a_obj_kanoke"), ActorRel(Matching, "d_a_obj_ladder"), @@ -1808,8 +1808,8 @@ config.libs = [ ActorRel(Matching, "d_a_sail"), ActorRel(Matching, "d_a_salvage_tbox"), ActorRel(Matching, "d_a_scene_change"), - ActorRel(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d_a_shutter"), - ActorRel(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d_a_shutter2"), + ActorRel(Matching, "d_a_shutter"), + ActorRel(Matching, "d_a_shutter2"), ActorRel(Matching, "d_a_st"), ActorRel(Matching, "d_a_steam_tag"), ActorRel(Matching, "d_a_swattack"), diff --git a/include/JSystem/J3DGraphBase/J3DTexture.h b/include/JSystem/J3DGraphBase/J3DTexture.h index 45fd1d5e3..7a8eaba9e 100644 --- a/include/JSystem/J3DGraphBase/J3DTexture.h +++ b/include/JSystem/J3DGraphBase/J3DTexture.h @@ -38,19 +38,16 @@ public: J3DTexture(u16 num, ResTIMG* res) : mNum(num), mpRes(res) {} virtual ~J3DTexture() {} - void loadGX(u16, GXTexMapID) const; - void entryNum(u16); - void addResTIMG(u16, ResTIMG const*); - u16 getNum() const { return mNum; } - ResTIMG* getResTIMG(u16 entry) const { - J3D_ASSERT(72, entry < mNum, "Error : range over."); - return &mpRes[entry]; + ResTIMG* getResTIMG(u16 index) const { + J3D_ASSERT(72, index < mNum, "Error : range over."); + return &mpRes[index]; } - void setResTIMG(u16 entry, const ResTIMG& timg) { - mpRes[entry] = timg; - mpRes[entry].imageOffset = ((mpRes[entry].imageOffset + (u32)&timg - (u32)(mpRes + entry))); - mpRes[entry].paletteOffset = ((mpRes[entry].paletteOffset + (u32)&timg - (u32)(mpRes + entry))); + void setResTIMG(u16 index, const ResTIMG& timg) { + J3D_ASSERT(81, index < mNum, "Error : range over."); + mpRes[index] = timg; + mpRes[index].imageOffset = ((mpRes[index].imageOffset + (u32)&timg - (u32)(mpRes + index))); + mpRes[index].paletteOffset = ((mpRes[index].paletteOffset + (u32)&timg - (u32)(mpRes + index))); } }; diff --git a/include/d/actor/d_a_obj_homensmoke.h b/include/d/actor/d_a_obj_homensmoke.h index afa7eb0cc..dfd56f618 100644 --- a/include/d/actor/d_a_obj_homensmoke.h +++ b/include/d/actor/d_a_obj_homensmoke.h @@ -24,10 +24,13 @@ namespace daObjHomensmoke { /* 0x29C */ Mtx mMtx; /* 0x2CC */ int mType; #if VERSION == VERSION_DEMO - /* 0x2D0 */ JPABaseEmitter* m2D0; + /* 0x2D0 */ JPABaseEmitter* mpSmokeEmitter; + /* 0x2D4 */ JPABaseEmitter* mpRubbleEmitter; #endif /* 0x2D0 */ dPa_smokeEcallBack mSmokeCb; +#if VERSION > VERSION_DEMO /* 0x2F0 */ BOOL mbInitialized; +#endif /* 0x2F4 */ cXyz mSmokePos; }; }; diff --git a/include/d/actor/d_a_obj_mknjd.h b/include/d/actor/d_a_obj_mknjd.h index 0c5fbec94..768c04359 100644 --- a/include/d/actor/d_a_obj_mknjd.h +++ b/include/d/actor/d_a_obj_mknjd.h @@ -24,7 +24,7 @@ namespace daObjMknjD { int prm_get_swSave() const { return daObj::PrmAbstract(this, PRM_SWITCH_W, PRM_SWITCH_S); } u8 prm_get_Type() const { return daObj::PrmAbstract(this, PRM_TYPE_W, PRM_TYPE_S); } - void anmAtr(u16) {} + void anmAtr(u16 i_msgStatus) { UNUSED(i_msgStatus); } u32 getMsg() { if (m0500 == 0) { dComIfGp_setMelodyNum(mMelodyNum); diff --git a/include/d/actor/d_a_tbox.h b/include/d/actor/d_a_tbox.h index 279363dfb..11e44cc53 100644 --- a/include/d/actor/d_a_tbox.h +++ b/include/d/actor/d_a_tbox.h @@ -32,7 +32,7 @@ public: typedef BOOL (daTbox_c::*ActionFunc)(); - u8 getTboxNo() { return fopAcM_GetParam(this) >> 0x07 & 0x1F; } + int getTboxNo() { return fopAcM_GetParam(this) >> 0x07 & 0x1F; } int getSwNo() { return fopAcM_GetParam(this) >> 0x0C & 0xFF; } u8 getItemNo() { return home.angle.z >> 8 & 0xFF; } void flagOn(u16 flag) { mFlags |= flag; } diff --git a/include/d/d_com_inf_game.h b/include/d/d_com_inf_game.h index f74501b02..fac2d1962 100644 --- a/include/d/d_com_inf_game.h +++ b/include/d/d_com_inf_game.h @@ -1631,6 +1631,10 @@ inline void dComIfGs_onSaveTbox(int i_stageNo, int i_no) { void dComIfGs_onStageTbox(int i_stageNo, int i_no); BOOL dComIfGs_isStageTbox(int i_stageNo, int i_no); +inline BOOL dComIfGs_isTbox(int i_stageNo, int i_no) { + return dComIfGs_isStageTbox(i_stageNo, i_no); +} + /** * This does not appear in the demo debug maps, but it likely existed and was simply unused until the * final release based on the fact that dComIfGs_onSaveSwitch does appear in the maps. diff --git a/src/d/actor/d_a_am2.cpp b/src/d/actor/d_a_am2.cpp index d7a68f8b8..5066f112f 100644 --- a/src/d/actor/d_a_am2.cpp +++ b/src/d/actor/d_a_am2.cpp @@ -38,7 +38,7 @@ static BOOL nodeCallBack(J3DNode* node, int calcTiming) { J3DModel* model = j3dSys.getModel(); am2_class* i_this = (am2_class*)model->getUserArea(); if (i_this) { - cMtx_copy(model->getAnmMtx(jntNo), *calc_mtx); + MTXCopy(model->getAnmMtx(jntNo), *calc_mtx); cXyz offset; switch (jntNo) { @@ -63,7 +63,7 @@ static BOOL nodeCallBack(J3DNode* node, int calcTiming) { } model->setAnmMtx(jntNo, *calc_mtx); - cMtx_copy(*calc_mtx, J3DSys::mCurrentMtx); + MTXCopy(*calc_mtx, J3DSys::mCurrentMtx); } } return TRUE; @@ -75,7 +75,7 @@ static void draw_SUB(am2_class* i_this) { J3DModel* model = i_this->mpMorf->getModel(); model->setBaseScale(actor->scale); - mDoMtx_stack_c::transS(actor->current.pos); + mDoMtx_stack_c::transS(actor->current.pos.x, actor->current.pos.y, actor->current.pos.z); mDoMtx_stack_c::YrotM(actor->shape_angle.y); mDoMtx_stack_c::XrotM(actor->shape_angle.x); mDoMtx_stack_c::ZrotM(actor->shape_angle.z); @@ -103,7 +103,7 @@ static BOOL daAM2_Draw(am2_class* i_this) { i_this->mpBrkAnm->remove(model->getModelData()); i_this->mpBtkAnm->remove(model->getModelData()); - if (!fopAcM_CheckStatus(actor, fopAcStts_CARRY_e)) { + if (!fopAcM_checkCarryNow(actor)) { dComIfGd_setSimpleShadow2( &actor->current.pos, i_this->mAcch.GetGroundH(), 50.0f, i_this->mAcch.m_gnd, 0, 1.0f, dDlst_shadowControl_c::getSimpleTex() @@ -181,7 +181,7 @@ static BOOL medama_atari_check(am2_class* i_this) { anm_init(i_this, dRes_INDEX_AM2_BCK_WAIT_e, 1.0f, J3DFrameCtrl::EMode_NONE, 1.0f, -1); actor->attention_info.flags = fopAc_Attn_LOCKON_BATTLE_e; fopAcM_OnStatus(actor, fopAcStts_SHOWMAP_e); - i_this->mNeedleCyl.OnAtSetBit(); + i_this->mNeedleCyl.OnAtSPrmBit(cCcD_AtSPrm_Set_e); i_this->mNeedleCyl.OnAtHitBit(); i_this->mNeedleCyl.OnTgSetBit(); i_this->mAction = ACTION_DOUSA; @@ -224,7 +224,7 @@ static BOOL week_atari_check(am2_class* i_this) { } u8 hitType = 0; - if (hitObj->ChkAtType(AT_TYPE_LIGHT_ARROW)) { + if (hitObj->GetAtType() & AT_TYPE_LIGHT_ARROW) { i_this->mEnemyIce.mLightShrinkTimer = 1; i_this->mEnemyIce.mParticleScale = 1.0f; i_this->mEnemyIce.mYOffset = 80.0f; @@ -327,9 +327,7 @@ static BOOL week_atari_check(am2_class* i_this) { /* 00000D30-00000F54 .text body_atari_check__FP9am2_class */ static BOOL body_atari_check(am2_class* i_this) { fopAc_ac_c* actor = &i_this->actor; - // For VERSION_JPN, the redundant daPy_py_c* cast is required to fix a regswap. - // For the other versions, the cast has no effect (it doesn't create another regswap). - daPy_py_c* player = (daPy_py_c*)daPy_getPlayerActorClass(); + daPy_py_c* player = (daPy_py_c*)dComIfGp_getPlayer(0); i_this->mStts.Move(); @@ -422,14 +420,13 @@ static BOOL naraku_check(am2_class* i_this) { } } - if (i_this->mAcch.ChkWaterIn()) { + if (i_this->mAcch.MaskWaterIn() != 0) { if (!i_this->mbMadeWaterSplash) { cXyz waterPillarPos = actor->current.pos; if (i_this->mCountDownTimers[4] == 0) { i_this->mCountDownTimers[4] = 1*30; waterPillarPos.y = i_this->mAcch.m_wtr.GetHeight(); - f32 centerY = actor->current.pos.y + 80.0f; - f32 scaleY = (0.1f + REG8_F(1)) * (waterPillarPos.y - centerY); + f32 scaleY = (0.1f + REG8_F(1)) * (waterPillarPos.y - (actor->current.pos.y + 80.0f)); if (scaleY < 0.0f) { scaleY = 0.3f; } else if (scaleY > 1.0f) { @@ -447,8 +444,7 @@ static BOOL naraku_check(am2_class* i_this) { } } - f32 waterSinkDepth = 80.0f + REG12_F(0); - if (actor->current.pos.y < i_this->mAcch.m_wtr.GetHeight() - waterSinkDepth) { + if (actor->current.pos.y < i_this->mAcch.m_wtr.GetHeight() - (80.0f + REG12_F(0))) { actor->speedF = 0.0f; actor->speed.setall(0.0f); actor->gravity = 0.0f; @@ -515,16 +511,16 @@ static void action_dousa(am2_class* i_this) { i_this->mMode++; // Fall-through case 3: { + f32 radiusAdjust = 200.0f; for (int i = 0; i < ARRAY_SIZE(i_this->mCountUpTimers); i++) { i_this->mCountUpTimers[i] = 0; } actor->speedF = 0.0f; f32 playerDist = fopAcM_searchPlayerDistance(actor); - f32 radiusAdjust = 200.0f; if (playerDist > i_this->mAreaRadius + radiusAdjust) { i_this->mMode = 6; } else { - i_this->mNeedleCyl.OnAtSetBit(); + i_this->mNeedleCyl.OnAtSPrmBit(cCcD_AtSPrm_Set_e); i_this->mNeedleCyl.OnAtHitBit(); i_this->mNeedleCyl.OnTgSetBit(); i_this->mTargetAngleY = fopAcM_searchPlayerAngleY(actor); @@ -562,15 +558,20 @@ static void action_dousa(am2_class* i_this) { i_this->mSmokeCb.remove(); fopAcM_seStart(actor, JA_SE_CM_AM_JUMP_S, 0); - dComIfGp_particle_setToon(dPa_name::ID_AK_ST_AMOTHSMOKE00, &actor->current.pos, &actor->shape_angle, NULL, 0xB9, &i_this->mSmokeCb, fopAcM_GetRoomNo(actor)); - if (i_this->mSmokeCb.getEmitter()) { - i_this->mSmokeCb.getEmitter()->setRate(12.0f); + JPABaseEmitter* emitter = dComIfGp_particle_setToon( + dPa_name::ID_AK_ST_AMOTHSMOKE00, + &actor->current.pos, &actor->shape_angle, + NULL, 0xB9, &i_this->mSmokeCb, fopAcM_GetRoomNo(actor) + ); + if (DEMO_SELECT(emitter, i_this->mSmokeCb.getEmitter())) { + DEMO_SELECT(emitter, i_this->mSmokeCb.getEmitter())->setRate(12.0f); JGeometry::TVec3 scale; scale.set(0.45f, 0.45f, 0.45f); - i_this->mSmokeCb.getEmitter()->setGlobalScale(scale); + DEMO_SELECT(emitter, i_this->mSmokeCb.getEmitter())->setGlobalScale(scale); } - if (i_this->mCountUpTimers[0] > 8) { + s16 r0 = 8; + if (i_this->mCountUpTimers[0] > r0) { i_this->mMode = 3; } else { actor->speedF = 9.0f; @@ -596,8 +597,8 @@ static void action_dousa(am2_class* i_this) { for (int i = 0; i < ARRAY_SIZE(i_this->mCountUpTimers); i++) { i_this->mCountUpTimers[i] = 0; } - i_this->mNeedleCyl.OffAtSetBit(); - i_this->mNeedleCyl.OffAtSetBit(); + i_this->mNeedleCyl.OffAtSPrmBit(cCcD_AtSPrm_Set_e); + i_this->mNeedleCyl.ClrAtSet(); i_this->mNeedleCyl.OffTgSetBit(); i_this->mNeedleCyl.ClrTgHit(); i_this->m304 = actor->current.pos; @@ -636,8 +637,8 @@ static void action_mahi(am2_class* i_this) { for (int i = 0; i < ARRAY_SIZE(i_this->mCountUpTimers); i++) { i_this->mCountUpTimers[i] = 0; } - i_this->mNeedleCyl.OffAtSetBit(); - i_this->mNeedleCyl.OffAtSetBit(); + i_this->mNeedleCyl.ClrAtSet(); + i_this->mNeedleCyl.ClrAtSet(); i_this->mNeedleCyl.OffTgSetBit(); i_this->mNeedleCyl.ClrTgHit(); @@ -679,7 +680,7 @@ static void action_mahi(am2_class* i_this) { fopAcM_seStart(actor, JA_SE_CM_AM2_JUMP, 0); i_this->mCountUpTimers[1] = 0; } - if (fopAcM_CheckStatus(actor, fopAcStts_CARRY_e)) { + if (fopAcM_checkCarryNow(actor)) { i_this->mAcchRadius = 40.0f + REG8_F(10); i_this->mbMadeWaterSplash = false; i_this->mRippleCb.remove(); @@ -690,23 +691,23 @@ static void action_mahi(am2_class* i_this) { actor->speed.setall(0.0f); actor->speedF = 0.0f; i_this->mbNotInHomeRoom = false; - i_this->mBodyCyl.OffCoSetBit(); + i_this->mBodyCyl.ClrCoSet(); i_this->mMode++; } } break; case 13: actor->current.angle.y = player->shape_angle.y; - if (actor->home.roomNo != actor->current.roomNo) { + if (fopAcM_GetHomeRoomNo(actor) != fopAcM_GetRoomNo(actor)) { i_this->mbNotInHomeRoom = true; } if (i_this->mPickedUpYPos + 10.0f <= actor->current.pos.y) { cLib_addCalcAngleS2(&actor->shape_angle.y, actor->current.angle.y, 1, 0x1000); } - if (!fopAcM_CheckStatus(actor, fopAcStts_CARRY_e)) { + if (!fopAcM_checkCarryNow(actor)) { i_this->mAcchRadius = 40.0f + REG8_F(10); i_this->mBodyCyl.OnCoSetBit(); - if (actor->speedF > 0.0f) { + if (fopAcM_GetSpeedF(actor) > 0.0f) { actor->gravity = -5.0f; actor->speed.y = 25.0f; actor->speedF = 35.0f; @@ -722,6 +723,9 @@ static void action_mahi(am2_class* i_this) { case 14: if (i_this->mAcch.ChkWallHit()) { actor->speedF = 0.0f; +#if VERSION == VERSION_DEMO + i_this->mCountUpTimers[0] = 1; +#endif } if (naraku_check(i_this)) { if (i_this->mbNotInHomeRoom) { @@ -744,12 +748,16 @@ static void action_mahi(am2_class* i_this) { i_this->mSmokeCb.remove(); fopAcM_seStart(actor, JA_SE_CM_AM2_LANDING, 0); - dComIfGp_particle_setToon(dPa_name::ID_AK_ST_AMOTHSMOKE00, &actor->current.pos, &actor->shape_angle, NULL, 0xB9, &i_this->mSmokeCb, fopAcM_GetRoomNo(actor)); - if (i_this->mSmokeCb.getEmitter()) { - i_this->mSmokeCb.getEmitter()->setRate(12.0f); + JPABaseEmitter* emitter = dComIfGp_particle_setToon( + dPa_name::ID_AK_ST_AMOTHSMOKE00, + &actor->current.pos, &actor->shape_angle, + NULL, 0xB9, &i_this->mSmokeCb, fopAcM_GetRoomNo(actor) + ); + if (DEMO_SELECT(emitter, i_this->mSmokeCb.getEmitter())) { + DEMO_SELECT(emitter, i_this->mSmokeCb.getEmitter())->setRate(12.0f); JGeometry::TVec3 scale; scale.set(0.8f, 0.8f, 0.8f); - i_this->mSmokeCb.getEmitter()->setGlobalScale(scale); + DEMO_SELECT(emitter, i_this->mSmokeCb.getEmitter())->setGlobalScale(scale); } actor->speedF = 7.0f; @@ -802,7 +810,7 @@ static void action_mahi(am2_class* i_this) { i_this->mAction = ACTION_DOUSA; i_this->mMode = 0; - if (fopAcM_CheckStatus(actor, fopAcStts_CARRY_e)) { + if (fopAcM_checkCarryNow(actor)) { fopAcM_cancelCarryNow(actor); cLib_offBit(actor->attention_info.flags, fopAc_Attn_ACTION_CARRY_e); actor->gravity = -4.0f; @@ -822,7 +830,7 @@ static void action_mahi(am2_class* i_this) { } if (i_this->mCountDownTimers[3] == 1) { - if (fopAcM_CheckStatus(actor, fopAcStts_CARRY_e)) { + if (fopAcM_checkCarryNow(actor)) { fopAcM_cancelCarryNow(actor); cLib_offBit(actor->attention_info.flags, fopAc_Attn_ACTION_CARRY_e); } @@ -835,7 +843,7 @@ static void action_mahi(am2_class* i_this) { } } - if (fopAcM_CheckStatus(actor, fopAcStts_CARRY_e) || i_this->mMode == 15 || !week_atari_check(i_this)) { + if (fopAcM_checkCarryNow(actor) || i_this->mMode == 15 || !week_atari_check(i_this)) { body_atari_check(i_this); } } @@ -843,13 +851,15 @@ static void action_mahi(am2_class* i_this) { /* 00002B08-000032AC .text action_itai__FP9am2_class */ static void action_itai(am2_class* i_this) { fopAc_ac_c* actor = &i_this->actor; + daPy_py_c* player = (daPy_py_c*)dComIfGp_getPlayer(0); + switch (i_this->mMode) { case 20: for (int i = 0; i < ARRAY_SIZE(i_this->mCountUpTimers); i++) { i_this->mCountUpTimers[i] = 0; } - i_this->mNeedleCyl.OffAtSetBit(); - i_this->mNeedleCyl.OffAtSetBit(); + i_this->mNeedleCyl.ClrAtSet(); + i_this->mNeedleCyl.ClrAtSet(); i_this->mNeedleCyl.OffTgSetBit(); i_this->mNeedleCyl.ClrTgHit(); @@ -897,7 +907,7 @@ static void action_itai(am2_class* i_this) { if (!i_this->mpMorf->isStop()) { break; } - i_this->mNeedleCyl.OnAtSetBit(); + i_this->mNeedleCyl.OnAtSPrmBit(cCcD_AtSPrm_Set_e); i_this->mNeedleCyl.OnAtHitBit(); actor->speed.y = 25.0f; actor->gravity = -10.0f; @@ -917,12 +927,16 @@ static void action_itai(am2_class* i_this) { if (i_this->mAcch.ChkGroundHit()) { i_this->mSmokeCb.remove(); - dComIfGp_particle_setToon(dPa_name::ID_AK_ST_AMOTHSMOKE00, &actor->current.pos, &actor->shape_angle, NULL, 0xB9, &i_this->mSmokeCb, fopAcM_GetRoomNo(actor)); - if (i_this->mSmokeCb.getEmitter()) { - i_this->mSmokeCb.getEmitter()->setRate(12.0f); + JPABaseEmitter* emitter = dComIfGp_particle_setToon( + dPa_name::ID_AK_ST_AMOTHSMOKE00, + &actor->current.pos, &actor->shape_angle, + NULL, 0xB9, &i_this->mSmokeCb, fopAcM_GetRoomNo(actor) + ); + if (DEMO_SELECT(emitter, i_this->mSmokeCb.getEmitter())) { + DEMO_SELECT(emitter, i_this->mSmokeCb.getEmitter())->setRate(12.0f); JGeometry::TVec3 scale; scale.set(0.45f, 0.45f, 0.45f); - i_this->mSmokeCb.getEmitter()->setGlobalScale(scale); + DEMO_SELECT(emitter, i_this->mSmokeCb.getEmitter())->setGlobalScale(scale); } fopAcM_seStart(actor, JA_SE_CM_AM2_JUMP2, 0); @@ -976,7 +990,7 @@ static void action_itai(am2_class* i_this) { /* 000032AC-000034A4 .text action_handou_move__FP9am2_class */ static void action_handou_move(am2_class* i_this) { fopAc_ac_c* actor = &i_this->actor; - daPy_py_c* player = daPy_getPlayerActorClass(); + daPy_py_c* player = (daPy_py_c*)dComIfGp_getPlayer(0); switch (i_this->mMode) { case 30: { actor->speedF = 40.0f; @@ -986,8 +1000,8 @@ static void action_handou_move(am2_class* i_this) { actor->current.angle.y = player->shape_angle.y - 0x4000; actor->speedF = 40.0f; } - i_this->mNeedleCyl.OffAtSetBit(); - i_this->mNeedleCyl.OffAtSetBit(); + i_this->mNeedleCyl.ClrAtSet(); + i_this->mNeedleCyl.ClrAtSet(); i_this->mNeedleCyl.OffTgSetBit(); i_this->mNeedleCyl.ClrTgHit(); i_this->mTargetAngleY = actor->current.angle.y; @@ -1070,8 +1084,8 @@ static void action_modoru_move(am2_class* i_this) { i_this->mCountUpTimers[1] = 0; actor->scale.setall(1.0f); i_this->mWeakSph.OffTgSetBit(); - i_this->mNeedleCyl.OffAtSetBit(); - i_this->mNeedleCyl.OffCoSetBit(); + i_this->mNeedleCyl.ClrAtSet(); + i_this->mNeedleCyl.ClrCoSet(); i_this->mNeedleCyl.OffTgSetBit(); i_this->mWeakSph.ClrTgHit(); i_this->mNeedleCyl.ClrTgHit(); @@ -1099,10 +1113,13 @@ static BOOL daAM2_Execute(am2_class* i_this) { } } +#if VERSION > VERSION_DEMO fopAcM_setGbaName(actor, dItemNo_BOW_e, 0xB, 0x29); +#endif if (enemy_ice(&i_this->mEnemyIce)) { - i_this->mpMorf->getModel()->setBaseTRMtx(mDoMtx_stack_c::get()); + J3DModel* model = i_this->mpMorf->getModel(); + model->setBaseTRMtx(mDoMtx_stack_c::get()); i_this->mpMorf->calc(); return TRUE; } @@ -1192,7 +1209,7 @@ static BOOL daAM2_IsDelete(am2_class* i_this) { /* 00003AC0-00003B18 .text daAM2_Delete__FP9am2_class */ static BOOL daAM2_Delete(am2_class* i_this) { - dComIfG_resDelete(&i_this->mPhase, "AM2"); + dComIfG_resDeleteDemo(&i_this->mPhase, "AM2"); i_this->mSmokeCb.remove(); i_this->mRippleCb.remove(); @@ -1237,7 +1254,7 @@ static BOOL useHeapInit(fopAc_ac_c* i_this) { a_this->mpMorf->getModel()->getModelData()->getJointNodePointer(i)->setCallBack(nodeCallBack); } - static Vec cyl_eye_offset[] = { + static Vec cyl_offset_1[] = { {80.0f, -25.0f, 0.0f}, {80.0f, -30.0f, 0.0f}, }; @@ -1249,7 +1266,7 @@ static BOOL useHeapInit(fopAc_ac_c* i_this) { /* mShapeType */ JntHitType_CYL2_e, /* mJointIndex */ AM2_JNT_BODY_e, /* mRadius */ 20.0f, - /* mpOffsets */ cyl_eye_offset, + /* mpOffsets */ cyl_offset_1, }, { /* mShapeType */ JntHitType_SPH_e, @@ -1260,7 +1277,7 @@ static BOOL useHeapInit(fopAc_ac_c* i_this) { }; a_this->mEyeJntHit = JntHit_create(a_this->mpMorf->getModel(), search_data, ARRAY_SIZE(search_data)); if (a_this->mEyeJntHit) { - i_this->jntHit = a_this->mEyeJntHit; + fopAcM_SetJntHit(i_this, a_this->mEyeJntHit); } else { return FALSE; } @@ -1270,12 +1287,13 @@ static BOOL useHeapInit(fopAc_ac_c* i_this) { /* 00003E70-00004250 .text daAM2_Create__FP10fopAc_ac_c */ static cPhs_State daAM2_Create(fopAc_ac_c* i_this) { - fopAcM_ct(i_this, am2_class); + fopAcM_ct_Retail(i_this, am2_class); am2_class* a_this = (am2_class*)i_this; cPhs_State phase_state = dComIfG_resLoad(&a_this->mPhase, "AM2"); if (phase_state == cPhs_COMPLEATE_e) { + fopAcM_ct_Demo(i_this, am2_class); if (!fopAcM_entrySolidHeap(i_this, useHeapInit, 0x1AA0)) { return cPhs_ERROR_e; } @@ -1460,9 +1478,9 @@ static cPhs_State daAM2_Create(fopAc_ac_c* i_this) { a_this->mNeedleCyl.Set(sword_co_cyl_src); a_this->mNeedleCyl.SetStts(&a_this->mStts); - a_this->mNeedleCyl.OffAtSetBit(); - a_this->mNeedleCyl.OffAtSetBit(); - a_this->mNeedleCyl.OffCoSetBit(); + a_this->mNeedleCyl.ClrAtSet(); + a_this->mNeedleCyl.ClrAtSet(); + a_this->mNeedleCyl.ClrCoSet(); a_this->mNeedleCyl.OffTgSetBit(); a_this->m304 = i_this->current.pos; diff --git a/src/d/actor/d_a_obj_homensmoke.cpp b/src/d/actor/d_a_obj_homensmoke.cpp index c07fd1948..187ac3ef7 100644 --- a/src/d/actor/d_a_obj_homensmoke.cpp +++ b/src/d/actor/d_a_obj_homensmoke.cpp @@ -22,21 +22,23 @@ void Act_c::set_mtx() { mDoMtx_stack_c::YrotM(shape_angle.y); mDoMtx_stack_c::XrotM(shape_angle.x); mDoMtx_stack_c::transM(backOffset); - mDoMtx_copy(mDoMtx_stack_c::get(), mMtx); + MTXCopy(mDoMtx_stack_c::get(), mMtx); } else { mDoMtx_stack_c::transS(current.pos); mDoMtx_stack_c::ZrotM(shape_angle.z); mDoMtx_stack_c::YrotM(shape_angle.y); mDoMtx_stack_c::XrotM(shape_angle.x); - mDoMtx_copy(mDoMtx_stack_c::get(), mMtx); + MTXCopy(mDoMtx_stack_c::get(), mMtx); } } /* 0000026C-0000048C .text _create__Q215daObjHomensmoke5Act_cFv */ cPhs_State Act_c::_create() { fopAcM_ct(this, Act_c); - + +#if VERSION > VERSION_DEMO mbInitialized = FALSE; +#endif set_mtx(); fopAcM_SetMtx(this, mMtx); @@ -66,16 +68,20 @@ cPhs_State Act_c::_create() { /* 0000048C-000004C8 .text _delete__Q215daObjHomensmoke5Act_cFv */ bool Act_c::_delete() { +#if VERSION == VERSION_DEMO + mSmokeCb.remove(); +#else if (mSmokeCb.getEmitter()) { mSmokeCb.remove(); } +#endif return true; } /* 000004C8-00000738 .text _execute__Q215daObjHomensmoke5Act_cFv */ bool Act_c::_execute() { #if VERSION == VERSION_DEMO - if (m2D0 == NULL) + if (mpSmokeEmitter == NULL) #else if (!mbInitialized) #endif @@ -89,34 +95,45 @@ bool Act_c::_execute() { } JPABaseEmitter* smokeEmitter = dComIfGp_particle_setToon(dPa_name::ID_AK_JT_ELEMENTSMOKE01, &mSmokePos, NULL, NULL, 0xFF, &mSmokeCb, fopAcM_GetRoomNo(this)); +#if VERSION == VERSION_DEMO + mpSmokeEmitter = smokeEmitter; +#endif if (smokeEmitter) { static f32 rate_table[2] = {1.0f, 0.5f}; f32 rate = rate_table[mType & 1]; - smokeEmitter->setGlobalAlpha(0xB4); - smokeEmitter->setRate(50.0f); - smokeEmitter->setMaxFrame(1); + DEMO_SELECT(mpSmokeEmitter, smokeEmitter)->setGlobalAlpha(0xB4); + DEMO_SELECT(mpSmokeEmitter, smokeEmitter)->setRate(50.0f); + DEMO_SELECT(mpSmokeEmitter, smokeEmitter)->setMaxFrame(1); JGeometry::TVec3 scale; scale.set(rate, 0.0f, rate); - smokeEmitter->setEmitterScale(scale); + DEMO_SELECT(mpSmokeEmitter, smokeEmitter)->setEmitterScale(scale); scale.set(rate*5.0f, rate*5.0f, rate*5.0f); - smokeEmitter->setGlobalDynamicsScale(scale); + DEMO_SELECT(mpSmokeEmitter, smokeEmitter)->setGlobalDynamicsScale(scale); scale.set(rate*6.0f, rate*6.0f, rate*6.0f); - smokeEmitter->setGlobalParticleScale(scale); + DEMO_SELECT(mpSmokeEmitter, smokeEmitter)->setGlobalParticleScale(scale); } JPABaseEmitter* rubbleEmitter = dComIfGp_particle_setToon(dPa_name::ID_AK_SN_KAZEMASKHAHEN00, ¤t.pos); +#if VERSION == VERSION_DEMO + mpRubbleEmitter = rubbleEmitter; +#endif if (rubbleEmitter) { - rubbleEmitter->setGlobalPrmColor(tevStr.mColorK0.r, tevStr.mColorK0.g, tevStr.mColorK0.b); + DEMO_SELECT(mpRubbleEmitter, rubbleEmitter)->setGlobalPrmColor(tevStr.mColorK0.r, tevStr.mColorK0.g, tevStr.mColorK0.b); if (mType == 1) { JGeometry::TVec3 scale(0.6f, 0.6f, 0.6f); - rubbleEmitter->setEmitterScale(scale); - rubbleEmitter->setGlobalDynamicsScale(scale); - rubbleEmitter->setGlobalParticleScale(scale); + DEMO_SELECT(mpRubbleEmitter, rubbleEmitter)->setEmitterScale(scale); + DEMO_SELECT(mpRubbleEmitter, rubbleEmitter)->setGlobalDynamicsScale(scale); + DEMO_SELECT(mpRubbleEmitter, rubbleEmitter)->setGlobalParticleScale(scale); } - rubbleEmitter->setGlobalRTMatrix(mMtx); + DEMO_SELECT(mpRubbleEmitter, rubbleEmitter)->setGlobalRTMatrix(mMtx); +#if VERSION == VERSION_DEMO + mpRubbleEmitter = NULL; +#endif } +#if VERSION > VERSION_DEMO mbInitialized = TRUE; +#endif } else if (mSmokeCb.isEnd()) { fopAcM_delete(this); } diff --git a/src/d/actor/d_a_obj_iceisland.cpp b/src/d/actor/d_a_obj_iceisland.cpp index bee962ff3..6089d7da5 100644 --- a/src/d/actor/d_a_obj_iceisland.cpp +++ b/src/d/actor/d_a_obj_iceisland.cpp @@ -6,6 +6,7 @@ #include "d/dolzel_rel.h" // IWYU pragma: keep #include "d/actor/d_a_obj_iceisland.h" #include "d/d_com_inf_game.h" +#include "d/d_s_play.h" #include "res/Object/GiceL.h" #include "JSystem/JKernel/JKRExpHeap.h" @@ -58,7 +59,12 @@ void daObjIceisland_c::CreateInit() { u8 switchNo = daObjIceisland_prm::getSwitchNo(this); if(fopAcM_isSwitch(this, switchNo)){ mBrkAnm.setFrame(mBrkAnm.getEndFrame()); - if(dComIfGs_getStartPoint() == 2 && current.roomNo == dComIfGs_getRestartRoomNo()){ + if( + dComIfGs_getStartPoint() == 2 +#if VERSION > VERSION_DEMO + && current.roomNo == dComIfGs_getRestartRoomNo() +#endif + ){ field_0x39C = 6; }else { field_0x39C = 3; @@ -71,6 +77,9 @@ void daObjIceisland_c::CreateInit() { } mMeltIceEventIdx = dComIfGp_evmng_getEventIdx("MELT_ICE"); mFreezeIceEventIdx = dComIfGp_evmng_getEventIdx("FREEZE_ICE"); +#if VERSION == VERSION_DEMO + REG17_S(0) = 0x80; +#endif } /* 00000588-00000608 .text set_mtx__16daObjIceisland_cFv */ @@ -92,7 +101,7 @@ void daObjIceisland_c::daObjIceisland_freeze_main() { /* 0000067C-00000774 .text daObjIceisland_melt_demo_wait__16daObjIceisland_cFv */ void daObjIceisland_c::daObjIceisland_melt_demo_wait() { - if(eventInfo.mCommand == dEvtCmd_INDEMO_e){ + if(eventInfo.checkCommandDemoAccrpt()){ mDoAud_seStart(JA_SE_READ_RIDDLE_1); JPABaseEmitter* emitter = mEmitter1; if(emitter != NULL) { @@ -131,7 +140,7 @@ void daObjIceisland_c::daObjIceisland_melt_main() { /* 00000850-000008C0 .text daObjIceisland_freeze_demo_wait__16daObjIceisland_cFv */ void daObjIceisland_c::daObjIceisland_freeze_demo_wait() { - if(eventInfo.mCommand == dEvtCmd_INDEMO_e){ + if(eventInfo.checkCommandDemoAccrpt()){ daObjIceisland_particle_set(); mBrkAnm.setPlaySpeed(-1.0f); field_0x39C = 5; @@ -233,17 +242,13 @@ bool daObjIceisland_c::_execute(){ field_0x396++; } fopAcM_seStartCurrent(this, JA_SE_ATM_ICEBERG_WIND, field_0x396); - JPABaseEmitter* emitter = mEmitter1; - if(emitter != NULL) { - - u8 colorK0R = (mTevStr.mColorK0.r / 2) + 0x80; - u8 colorK0G = (mTevStr.mColorK0.g / 2) + 0x80; - u8 colorK0B = (mTevStr.mColorK0.b / 2) + 0x80; + if(mEmitter1 != NULL) { + u8 colorK0R = DEMO_SELECT(REG17_S(0), 0x80) + (mTevStr.mColorK0.r / 2); + u8 colorK0G = DEMO_SELECT(REG17_S(0), 0x80) + (mTevStr.mColorK0.g / 2); + u8 colorK0B = DEMO_SELECT(REG17_S(0), 0x80) + (mTevStr.mColorK0.b / 2); - emitter->setGlobalPrmColor(colorK0R, colorK0G, colorK0B); - emitter = mEmitter1; - emitter->setGlobalEnvColor(colorK0R, colorK0G, colorK0B); - + mEmitter1->setGlobalPrmColor(colorK0R, colorK0G, colorK0B); + mEmitter1->setGlobalEnvColor(colorK0R, colorK0G, colorK0B); } return true; } diff --git a/src/d/actor/d_a_obj_mknjd.cpp b/src/d/actor/d_a_obj_mknjd.cpp index 7b0240402..1f7c4c713 100644 --- a/src/d/actor/d_a_obj_mknjd.cpp +++ b/src/d/actor/d_a_obj_mknjd.cpp @@ -351,8 +351,8 @@ BOOL daObjMknjD::Act_c::Mthd_Delete() { /* 00000C34-00000CC8 .text set_mtx__Q210daObjMknjD5Act_cFv */ void daObjMknjD::Act_c::set_mtx() { - mDoMtx_stack_c::transS(current.pos); - mDoMtx_stack_c::ZXYrotM(shape_angle); + mDoMtx_stack_c::transS(current.pos.x, current.pos.y, current.pos.z); + mDoMtx_stack_c::ZXYrotM(shape_angle.x, shape_angle.y, shape_angle.z); mMainMdl->setBaseTRMtx(mDoMtx_stack_c::get()); mBreakMdl->setBaseTRMtx(mDoMtx_stack_c::get()); @@ -372,12 +372,12 @@ void daObjMknjD::Act_c::init_mtx() { void daObjMknjD::Act_c::setGoal(int i_staffIdx) { cXyz pos = *dComIfGp_evmng_getMyXyzP(i_staffIdx, "Posion"); - mDoMtx_stack_c::transS(current.pos); + mDoMtx_stack_c::transS(current.pos.x, current.pos.y, current.pos.z); mDoMtx_stack_c::YrotM(current.angle.y); - mDoMtx_stack_c::transM(pos); + mDoMtx_stack_c::transM(pos.x, pos.y, pos.z); - mDoMtx_multVecZero(mDoMtx_stack_c::get(), &pos); + mDoMtx_stack_c::multVecZero(&pos); mGoalPos = pos; dComIfGp_evmng_setGoal(&mGoalPos); @@ -416,9 +416,11 @@ u16 daObjMknjD::Act_c::talk(int i_param1) { fopMsgM_messageSendOn(); } + anmAtr(fopMsgStts_MSG_ENDS_e); mMsgPtr->mStatus = fopMsgStts_MSG_ENDS_e; } else if (msgStatus == fopMsgStts_BOX_CLOSED_e) { + anmAtr(fopMsgStts_MSG_DESTROYED_e); mMsgPtr->mStatus = fopMsgStts_MSG_DESTROYED_e; mMsgPID = fpcM_ERROR_PROCESS_ID_e; } @@ -433,7 +435,7 @@ u16 daObjMknjD::Act_c::talk(int i_param1) { /* 00000F88-00001348 .text privateCut__Q210daObjMknjD5Act_cFv */ void daObjMknjD::Act_c::privateCut() { - static char* cut_name_table[] = { + static char* cut_name_tbl[] = { "SETGOAL", "SETANGLE", "WAIT", @@ -449,7 +451,7 @@ void daObjMknjD::Act_c::privateCut() { int staffIdx = dComIfGp_evmng_getMyStaffId("MknjD"); if (staffIdx != -1) { - mActionIdx = dComIfGp_evmng_getMyActIdx(staffIdx, cut_name_table, ARRAY_SIZE(cut_name_table), TRUE, 0); + mActionIdx = dComIfGp_evmng_getMyActIdx(staffIdx, cut_name_tbl, ARRAY_SIZE(cut_name_tbl), TRUE, 0); if (mActionIdx == -1) { dComIfGp_evmng_cutEnd(staffIdx); diff --git a/src/d/actor/d_a_shutter.cpp b/src/d/actor/d_a_shutter.cpp index 49c1a95ab..5bd23df40 100644 --- a/src/d/actor/d_a_shutter.cpp +++ b/src/d/actor/d_a_shutter.cpp @@ -47,7 +47,7 @@ static BOOL CheckCreateHeap(fopAc_ac_c* i_this) { /* 00000128-000002B8 .text CreateHeap__11daShutter_cFv */ BOOL daShutter_c::CreateHeap() { J3DModelData* modelData = (J3DModelData *)dComIfG_getObjectRes(m_arcname[mType], m_bdlidx[mType]); - JUT_ASSERT(0x121, modelData != NULL); + JUT_ASSERT(DEMO_SELECT(286, 289), modelData != NULL); for (int i = 0; i < (int)ARRAY_SIZE(mMtx); i++) { mpModel[i] = mDoExt_J3DModel__create(modelData, 0x80000, 0x11000022); if (!mpModel[i]) { @@ -55,8 +55,7 @@ BOOL daShutter_c::CreateHeap() { } mdBgW[i] = new dBgW(); if (mdBgW[i]) { - cBgD_t* pData = (cBgD_t *)dComIfG_getObjectRes(m_arcname[mType], m_dzbidx[mType]); - if (mdBgW[i]->Set(pData, cBgW::MOVE_BG_e, &mMtx[i]) == true) { + if (mdBgW[i]->Set((cBgD_t *)dComIfG_getObjectRes(m_arcname[mType], m_dzbidx[mType]), cBgW::MOVE_BG_e, &mMtx[i]) == true) { return FALSE; } } @@ -186,13 +185,13 @@ void daShutter_c::shutter_move() { field_0x33A++; if (field_0x339 == 0) { field_0x339 = 1; - if (dStage_stagInfo_GetSaveTbl(dComIfGp_getStage().getStagInfo()) == 5) { + if (dStage_stagInfo_GetSaveTbl(dComIfGp_getStageStagInfo()) == dSv_save_c::STAGE_TOTG) { fopAcM_seStart(this, JA_SE_OBJ_B_SHUTTER_OPEN, 0); } } fVar4 = cLib_addCalc(&mcXyz[0].x, -m_move_len[mType] - m_width[mType] / 2.0f, 0.1f, maxVel, minVel); fVar5 = cLib_addCalc(&mcXyz[1].x, m_move_len[mType] + m_width[mType] / 2.0f, 0.1f, maxVel, minVel); - if ((dStage_stagInfo_GetSaveTbl(dComIfGp_getStage().getStagInfo()) == 5) && (field_0x33A == 75)) { + if ((dStage_stagInfo_GetSaveTbl(dComIfGp_getStageStagInfo()) == dSv_save_c::STAGE_TOTG) && (field_0x33A == 75)) { fopAcM_seStart(this, JA_SE_OBJ_B_SHUTTER_STOP, 0); dComIfGp_getVibration().StartShock(4, -0x21, cXyz(0.0f, 1.0f, 0.0f)); } @@ -267,9 +266,8 @@ void daShutter_c::demo() { /* 00000CF0-00000DD8 .text _draw__11daShutter_cFv */ bool daShutter_c::_draw() { - cXyz actorPos; for (int i = 0; i < (int)ARRAY_SIZE(mMtx); i++) { - actorPos = current.pos; + cXyz actorPos = current.pos; actorPos += mcXyz[i]; g_env_light.settingTevStruct(TEV_TYPE_BG0, &actorPos, &tevStr); g_env_light.setLightTevColorType(mpModel[i], &tevStr); diff --git a/src/d/actor/d_a_shutter2.cpp b/src/d/actor/d_a_shutter2.cpp index b778beeb9..bdbc845b4 100644 --- a/src/d/actor/d_a_shutter2.cpp +++ b/src/d/actor/d_a_shutter2.cpp @@ -26,14 +26,14 @@ char* daShutter2_c::m_staff_name[1] = {"Htobi3"}; /* 00000078-000000B8 .text Delete__12daShutter2_cFv */ BOOL daShutter2_c::Delete() { - dComIfG_resDelete(&mPhs, m_arcname[mType]); + dComIfG_resDeleteDemo(&mPhs, m_arcname[mType]); return TRUE; } /* 000000B8-00000194 .text CreateHeap__12daShutter2_cFv */ int daShutter2_c::CreateHeap() { J3DModelData* modelData = (J3DModelData *)dComIfG_getObjectRes(m_arcname[mType], m_bdlidx[mType]); - JUT_ASSERT(0xe0, modelData != NULL); + JUT_ASSERT(DEMO_SELECT(223, 224), modelData != NULL); mpModel = mDoExt_J3DModel__create(modelData, 0x80000, 0x11000022); if (!mpModel) { return FALSE; diff --git a/src/d/actor/d_a_tbox.cpp b/src/d/actor/d_a_tbox.cpp index a096f0e01..dec216d1c 100644 --- a/src/d/actor/d_a_tbox.cpp +++ b/src/d/actor/d_a_tbox.cpp @@ -146,7 +146,7 @@ cPhs_State daTbox_c::commonShapeSet() { mpChestMdl->setBaseScale(scale); - mDoMtx_stack_c::transS(current.pos); + mDoMtx_stack_c::transS(current.pos.x, current.pos.y, current.pos.z); mDoMtx_stack_c::YrotM(current.angle.y); mpChestMdl->setBaseTRMtx(mDoMtx_stack_c::get()); @@ -155,7 +155,7 @@ cPhs_State daTbox_c::commonShapeSet() { mpTactPlatformMdl->setBaseTRMtx(mDoMtx_stack_c::get()); } - mDoMtx_copy(mDoMtx_stack_c::get(), mMtx); + MTXCopy(mDoMtx_stack_c::get(), mMtx); return cPhs_COMPLEATE_e; } @@ -170,18 +170,15 @@ cPhs_State daTbox_c::effectShapeSet() { return cPhs_ERROR_e; } - J3DAnmTransform* flashAnm = (J3DAnmTransform*)dComIfG_getObjectRes("Dalways", dRes_INDEX_DALWAYS_BCK_IT_TAKARA_FLASH2_e); - if (mFlashAnm.init(flashModelData, flashAnm, true, J3DFrameCtrl::EMode_NONE) == 0) { + if (mFlashAnm.init(flashModelData, (J3DAnmTransform*)dComIfG_getObjectRes("Dalways", dRes_INDEX_DALWAYS_BCK_IT_TAKARA_FLASH2_e), true, J3DFrameCtrl::EMode_NONE) == 0) { return cPhs_ERROR_e; } - J3DAnmTextureSRTKey* flashTexAnm = (J3DAnmTextureSRTKey*)dComIfG_getObjectRes("Dalways", dRes_INDEX_DALWAYS_BTK_IT_TAKARA_FLASH_e); - if (mFlashTexAnm.init(flashModelData, flashTexAnm, true, J3DFrameCtrl::EMode_NONE) == 0) { + if (mFlashTexAnm.init(flashModelData, (J3DAnmTextureSRTKey*)dComIfG_getObjectRes("Dalways", dRes_INDEX_DALWAYS_BTK_IT_TAKARA_FLASH_e), true, J3DFrameCtrl::EMode_NONE) == 0) { return cPhs_ERROR_e; } - J3DAnmTevRegKey* flashRegAnm = (J3DAnmTevRegKey*)dComIfG_getObjectRes("Dalways", dRes_INDEX_DALWAYS_BRK_IT_TAKARA_FLASH_e); - int regInit = mFlashRegAnm.init(flashModelData, flashRegAnm, true, J3DFrameCtrl::EMode_NONE); + int regInit = mFlashRegAnm.init(flashModelData, (J3DAnmTevRegKey*)dComIfG_getObjectRes("Dalways", dRes_INDEX_DALWAYS_BRK_IT_TAKARA_FLASH_e), true, J3DFrameCtrl::EMode_NONE); if (regInit) { return cPhs_COMPLEATE_e; @@ -316,14 +313,10 @@ BOOL daTbox_c::checkEnv() { /* 00000CD8-00000D48 .text checkOpen__8daTbox_cFv */ BOOL daTbox_c::checkOpen() { if (getFuncType() == FUNC_TYPE_EXTRA_SAVE_INFO || getFuncType() == FUNC_TYPE_EXTRA_SAVE_INFO_SPAWN) { - int stageNo = dSv_save_c::STAGE_SEA2; - u8 tBoxNo = getTboxNo(); - - return dComIfGs_isStageTbox(stageNo, tBoxNo); + return dComIfGs_isTbox(dSv_save_c::STAGE_SEA2, getTboxNo()); } else { - u8 tBoxNo = getTboxNo(); - return dComIfGs_isTbox(tBoxNo); + return dComIfGs_isTbox(getTboxNo()); } } @@ -378,7 +371,7 @@ void daTbox_c::surfaceProc() { mDoMtx_stack_c::transS(current.pos.x, current.pos.y + mAppearingYOffset, current.pos.z); mDoMtx_stack_c::YrotM(current.angle.y); - mDoMtx_copy(mDoMtx_stack_c::get(), mMtx); + MTXCopy(mDoMtx_stack_c::get(), mMtx); mpBgWCurrent->Move(); } @@ -604,7 +597,8 @@ void daTbox_c::darkProc() { mAllColRatio = 1.0f; } else if (mOpenTimer > 0x78) { - mAllColRatio = ((mOpenTimer - 0x78) / 30.0f) * 0.6f + 0.4f; + f32 temp = (mOpenTimer - 0x78) / 30.0f; + mAllColRatio = temp * 0.6f + 0.4f; } } @@ -623,7 +617,8 @@ void daTbox_c::volmProc() { mSmokeEmitter = NULL; } else if (mOpenTimer > 0x9C) { - mSmokeEmitter->setGlobalAlpha((0xB5 - mOpenTimer) * 0x0A); + int r3 = 0x0A; + mSmokeEmitter->setGlobalAlpha((0xB5 - mOpenTimer) * r3); } } @@ -766,8 +761,8 @@ s32 daTbox_c::demoProc() { ACT_OPEN_SHORT, }; - s32 actionIdx = dComIfGp_evmng_getMyActIdx(mStaffId, action_table, ARRAY_SIZE(action_table), FALSE, 0); - bool bIsAdvance = dComIfGp_evmng_getIsAddvance(mStaffId); + int actionIdx = dComIfGp_evmng_getMyActIdx(mStaffId, action_table, ARRAY_SIZE(action_table), FALSE, 0); + BOOL bIsAdvance = dComIfGp_evmng_getIsAddvance(mStaffId); if (bIsAdvance) { mHasOpenAnmFinished = false; @@ -860,8 +855,7 @@ void daTbox_c::OpenInit_com() { dComIfGs_onStageTbox(dSv_save_c::STAGE_SEA2, getTboxNo()); } else { - u8 tboxNo = getTboxNo(); - dComIfGs_onTbox(tboxNo); + dComIfGs_onTbox(getTboxNo()); } s32 openSwNo = home.angle.z & 0xFF; @@ -902,9 +896,11 @@ void daTbox_c::OpenInit() { /* 00002444-000024AC .text setCollision__8daTbox_cFv */ void daTbox_c::setCollision() { + f32 radius = 40.0f; + f32 height = 110.0f; mColCyl.SetC(current.pos); - mColCyl.SetR(40.0f); - mColCyl.SetH(110.f); + mColCyl.SetR(radius); + mColCyl.SetH(height); dComIfG_Ccsp()->Set(&mColCyl); } @@ -986,16 +982,14 @@ BOOL daTbox_c::actionOpenWait() { mStaffId = dComIfGp_evmng_getMyStaffId("TREASURE"); demoProc(); } - else { - if (boxCheck()) { - eventInfo.onCondition(dEvtCnd_CANDOOR_e); + else if (boxCheck()) { + eventInfo.onCondition(dEvtCnd_CANDOOR_e); - if (getShapeType() == 0) { - eventInfo.setEventName("DEFAULT_TREASURE_A"); - } - else { - eventInfo.setEventName("DEFAULT_TREASURE"); - } + if (getShapeType() == 0) { + eventInfo.setEventName("DEFAULT_TREASURE_A"); + } + else { + eventInfo.setEventName("DEFAULT_TREASURE"); } } @@ -1185,7 +1179,7 @@ BOOL daTbox_c::execute() { mDoMtx_stack_c::YrotM(home.angle.y); mpChestMdl->setBaseTRMtx(mDoMtx_stack_c::get()); - mDoMtx_copy(mDoMtx_stack_c::get(), mMtx); + MTXCopy(mDoMtx_stack_c::get(), mMtx); if (mpBgWCurrent != NULL) { mpBgWCurrent->Move(); @@ -1213,7 +1207,7 @@ static s32 daTbox_IsDelete(daTbox_c*) { /* 00002FD8-00003070 .text daTbox_Delete__FP8daTbox_c */ static s32 daTbox_Delete(daTbox_c* i_tbox) { i_tbox->deleteProc(); - dComIfG_resDelete(i_tbox->getPhase(), "Dalways"); + dComIfG_resDeleteDemo(i_tbox->getPhase(), "Dalways"); if (l_HIO.mNo >= 0) { mDoHIO_deleteChild(l_HIO.mNo);