diff --git a/configure.py b/configure.py index 6957d2bf0..6f35f04b2 100755 --- a/configure.py +++ b/configure.py @@ -1496,7 +1496,7 @@ config.libs = [ ActorRel(Matching, "d_a_tama"), ActorRel(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d_a_tbox"), ActorRel(Matching, "d_a_tpota"), - ActorRel(Equivalent, "d_a_tsubo"), + ActorRel(Matching, "d_a_tsubo"), ActorRel(Matching, "d_a_warpdm20"), ActorRel(Matching, "d_a_warphr"), ActorRel(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d_a_wbird"), diff --git a/include/d/actor/d_a_tsubo.h b/include/d/actor/d_a_tsubo.h index 31be24070..ba291fa1e 100644 --- a/include/d/actor/d_a_tsubo.h +++ b/include/d/actor/d_a_tsubo.h @@ -162,9 +162,8 @@ namespace daTsubo { const AttrSpine_c& attrSpine() { return M_attrSpine; } const Data_c& data() const { return M_data[mType]; } const SpecBokoData& data_spec_boko(int index) { return M_data_spec_boko[index]; } - BOOL is_switch() const { - int sw = prmZ_get_swSave(); - return fopAcM_isSwitch(const_cast(this), sw); + bool is_switch() const { + return fopAcM_isSwitch(const_cast(this), prmZ_get_swSave()); } bool pos_init() { @@ -186,7 +185,7 @@ namespace daTsubo { return false; } - u8 prmZ_get_swSave() const { return mSwitchNo; } + int prmZ_get_swSave() const { return mPrmZ & 0xFF; } s32 prm_get_cull() const { return daObj::PrmAbstract(this, PRM_CULL_W, PRM_CULL_S); } s32 prm_get_itemNo() const { return daObj::PrmAbstract(this, PRM_ITEMNO_W, PRM_ITEMNO_S); } s32 prm_get_itemSave() const { return daObj::PrmAbstract(this, PRM_ITEMSAVE_W, PRM_ITEMSAVE_S); } @@ -367,7 +366,7 @@ namespace daTsubo { #endif /* 0x674 */ s32 mType; /* 0x678 */ s32 m678; - /* 0x67C */ u16 mSwitchNo; + /* 0x67C */ u16 mPrmZ; /* 0x67E */ u8 m67E; /* 0x67F */ u8 m67F; /* 0x680 */ u8 m680; @@ -376,7 +375,7 @@ namespace daTsubo { /* 0x683 */ u8 m683; /* 0x684 */ u8 m684; /* 0x685 */ bool m685; - /* 0x686 */ u8 m686; + /* 0x686 */ bool m686; /* 0x687 */ u8 m687[0x688 - 0x687]; /* 0x688 */ cSAngle m688; /* 0x68A */ cSAngle m68A; diff --git a/src/d/actor/d_a_tsubo.cpp b/src/d/actor/d_a_tsubo.cpp index 551de40b7..ac8b1c457 100644 --- a/src/d/actor/d_a_tsubo.cpp +++ b/src/d/actor/d_a_tsubo.cpp @@ -40,6 +40,7 @@ dBgS_ObjGndChk_Yogan Act_c::M_bg_lava; #endif fopAc_ac_c* Act_c::M_spec_act[3]; + const char* const Act_c::M_arcname[] = { "Always", "Always", @@ -48,11 +49,7 @@ const char* const Act_c::M_arcname[] = { "Okmono", "Odokuro", "Okioke", -#if VERSION == VERSION_DEMO - "Sitem", -#else - "Kmi00x", -#endif + DEMO_SELECT("Sitem", "Kmi00x"), "Hbox2", "Hseki", "Hseki", @@ -62,6 +59,7 @@ const char* const Act_c::M_arcname[] = { "Ptubo", "Kkiba_00", }; + const dCcD_SrcCyl Act_c::M_cyl_src = { // dCcD_SrcGObjInf { @@ -112,7 +110,7 @@ const Act_c::Data_c Act_c::M_data[] = { 4.0f, 0.2f, 0.02f, - 0.039999999f, + 0.04f, 0.015f, 30.0f, 0xF, @@ -154,7 +152,7 @@ const Act_c::Data_c Act_c::M_data[] = { 0x4C0, 0.5f, 0.75f, - 0.34999999f, + 0.35f, 0.6f, }, { @@ -177,7 +175,7 @@ const Act_c::Data_c Act_c::M_data[] = { 5.0f, 0.2f, 0.02f, - 0.039999999f, + 0.04f, 0.015f, 30.0f, 0xF, @@ -244,7 +242,7 @@ const Act_c::Data_c Act_c::M_data[] = { 5.0f, 0.2f, 0.02f, - 0.039999999f, + 0.04f, 0.015f, 30.0f, 0xF, @@ -311,7 +309,7 @@ const Act_c::Data_c Act_c::M_data[] = { 5.0f, 0.2f, 0.02f, - 0.039999999f, + 0.04f, 0.015f, 30.0f, 0xF, @@ -443,7 +441,7 @@ const Act_c::Data_c Act_c::M_data[] = { 4.0f, 0.2f, 0.02f, - 0.039999999f, + 0.04f, 0.015f, 30.0f, 0xF, @@ -485,7 +483,7 @@ const Act_c::Data_c Act_c::M_data[] = { 0x4C0, 0.5f, 0.75f, - 0.34999999f, + 0.35f, 0.56f, }, { @@ -508,7 +506,7 @@ const Act_c::Data_c Act_c::M_data[] = { 4.0f, 0.2f, 0.02f, - 0.039999999f, + 0.04f, 0.015f, 30.0f, 0xF, @@ -551,7 +549,7 @@ const Act_c::Data_c Act_c::M_data[] = { 0.85f, 0.75f, 0.4f, - 0.51999998f, + 0.52f, }, { -5.0f, @@ -573,7 +571,7 @@ const Act_c::Data_c Act_c::M_data[] = { 4.0f, 0.2f, 0.02f, - 0.039999999f, + 0.04f, 0.015f, 30.0f, 0xF, @@ -587,11 +585,7 @@ const Act_c::Data_c Act_c::M_data[] = { 0x7D, 0x5, (DataFlag_e)(DATA_FLAG_2_e | DATA_FLAG_10_e | DATA_FLAG_20_e), -#if VERSION == VERSION_DEMO - SITEM_BDL_KMI_00, -#else - KMI00X_BDL_KMI_00X, -#endif + DEMO_SELECT(SITEM_BDL_KMI_00, KMI00X_BDL_KMI_00X), 0x32, 0x32, 0x64, @@ -616,11 +610,7 @@ const Act_c::Data_c Act_c::M_data[] = { {0x00, 0x00, 0x00, 0x00}, 8000.0f, {0x00, 0x00, 0x00, 0x00}, -#if VERSION == VERSION_DEMO - 0x4000, -#else - 0x860, -#endif + DEMO_SELECT(0x4000, 0x860), 0.85f, 0.75f, 0.5f, @@ -646,7 +636,7 @@ const Act_c::Data_c Act_c::M_data[] = { 7.5f, 0.2f, 0.02f, - 0.039999999f, + 0.04f, 0.015f, 30.0f, 0xF, @@ -685,12 +675,8 @@ const Act_c::Data_c Act_c::M_data[] = { {0x00, 0x00, 0x00, 0x00}, 8000.0f, {0x00, 0x00, 0x00, 0x00}, -#if VERSION == VERSION_DEMO - 0x4000, -#else - 0x4C0, -#endif - 0.69999999f, + DEMO_SELECT(0x4000, 0x4C0), + 0.7f, 0.75f, 0.4f, 0.8f, @@ -715,7 +701,7 @@ const Act_c::Data_c Act_c::M_data[] = { 4.0f, 0.2f, 0.02f, - 0.039999999f, + 0.04f, 0.015f, 30.0f, 0xF, @@ -780,7 +766,7 @@ const Act_c::Data_c Act_c::M_data[] = { 4.0f, 0.2f, 0.02f, - 0.039999999f, + 0.04f, 0.015f, 30.0f, 0xF, @@ -845,7 +831,7 @@ const Act_c::Data_c Act_c::M_data[] = { 4.0f, 0.2f, 0.02f, - 0.039999999f, + 0.04f, 0.015f, 30.0f, 0xF, @@ -910,7 +896,7 @@ const Act_c::Data_c Act_c::M_data[] = { 4.0f, 0.2f, 0.02f, - 0.039999999f, + 0.04f, 0.015f, 30.0f, 0xF, @@ -975,7 +961,7 @@ const Act_c::Data_c Act_c::M_data[] = { 4.0f, 0.2f, 0.02f, - 0.039999999f, + 0.04f, 0.015f, 30.0f, 0xF, @@ -1014,11 +1000,7 @@ const Act_c::Data_c Act_c::M_data[] = { {0x00, 0x00, 0x00, 0x00}, 8000.0f, {0x00, 0x00, 0x00, 0x00}, -#if VERSION == VERSION_DEMO - 0x1240, -#else - 0x4C0, -#endif + DEMO_SELECT(0x1240, 0x4C0), 0.85f, 0.75f, 0.5f, @@ -1044,7 +1026,7 @@ const Act_c::Data_c Act_c::M_data[] = { 5.0f, 0.2f, 0.02f, - 0.039999999f, + 0.04f, 0.015f, 30.0f, 0xF, @@ -1085,11 +1067,7 @@ const Act_c::Data_c Act_c::M_data[] = { {0x00, 0x00, 0x00, 0x00}, 8000.0f, {0x00, 0x00, 0x00, 0x00}, -#if VERSION == VERSION_DEMO - 0x1240, -#else - 0x4C0, -#endif + DEMO_SELECT(0x1240, 0x4C0), 0.85f, 0.75f, 0.5f, @@ -1115,7 +1093,7 @@ const Act_c::Data_c Act_c::M_data[] = { 7.5f, 0.2f, 0.02f, - 0.039999999f, + 0.04f, 0.015f, 30.0f, 0xF, @@ -1154,12 +1132,8 @@ const Act_c::Data_c Act_c::M_data[] = { {0x00, 0x00, 0x00, 0x00}, 8000.0f, {0x00, 0x00, 0x00, 0x00}, -#if VERSION == VERSION_DEMO - 0x1240, -#else - 0x4C0, -#endif - 0.69999999f, + DEMO_SELECT(0x1240, 0x4C0), + 0.7f, 0.75f, 0.4f, 0.8f, @@ -1188,8 +1162,8 @@ const Act_c::SpecBokoData Act_c::M_data_spec_boko[] = { const Act_c::AttrSpine_c Act_c::M_attrSpine = { 0.55f, 0.55f, - 0.69999999f, - 0.69999999f, + 0.7f, + 0.7f, 0.2f, 0.2f, 0x50, @@ -1208,7 +1182,7 @@ void Act_c::prmZ_init() { if (m67E != 0) { return; } - mSwitchNo = home.angle.z; + mPrmZ = home.angle.z; m67E = 1; home.angle.z = 0; current.angle.z = 0; @@ -1231,11 +1205,7 @@ bool Act_c::create_heap() { mpModel = mDoExt_J3DModel__create(modelData, 0x80000, modelFlag); bool ret = false; if (mType == 7) { -#if VERSION == VERSION_DEMO - J3DAnmTevRegKey* brk_data = static_cast(dComIfG_getObjectRes(M_arcname[mType], SITEM_BRK_KMI_00)); -#else - J3DAnmTevRegKey* brk_data = static_cast(dComIfG_getObjectRes(M_arcname[mType], KMI00X_BRK_KMI_00X)); -#endif + J3DAnmTevRegKey* brk_data = static_cast(dComIfG_getObjectRes(M_arcname[mType], DEMO_SELECT(SITEM_BRK_KMI_00, KMI00X_BRK_KMI_00X))); JUT_ASSERT(DEMO_SELECT(1885, 1887), brk_data != NULL); mpBrk = new mDoExt_brkAnm(); @@ -1388,8 +1358,8 @@ cPhs_State Act_c::_create() { m682 = 1; m683 = 0; m684 = 0; - m685 = 0; - m686 = 0; + m685 = false; + m686 = false; m811 = 0; if (mType == 2) { @@ -1939,28 +1909,28 @@ void Act_c::mode_carry_init() { } prm_off_stick(); - m685 = 0; - m686 = 0; + m685 = false; + m686 = false; m678 = 4; } /* 00002EF8-0000310C .text mode_carry__Q27daTsubo5Act_cFv */ void Act_c::mode_carry() { - daPy_py_c* player = daPy_getPlayerActorClass(); - u8 tmp = m685; + daPy_py_c* player = (daPy_py_c*)daPy_getPlayerActorClass(); + const bool tmp = m685; - if (tmp == 0) { + if (!m685) { if (prm_get_spec() == 6) { - m685 = 1; - m686 = 1; + m685 = true; + m686 = true; } else if (player->getGrabActorID() == fopAcM_GetID(this)) { if (player->getGrabUpStart()) { - m685 = 1; - m686 = 1; + m685 = true; + m686 = true; } } else { - m685 = 1; - m686 = 0; + m685 = true; + m686 = false; } } @@ -1970,7 +1940,7 @@ void Act_c::mode_carry() { shape_angle.z = 0; } - bool bVar2 = player->getGrabUpEnd() || player->getRightFootOnGround(); + const bool bVar2 = player->getGrabUpEnd() || player->getRightFootOnGround(); if (bVar2 && mType == 2) { eff_drop_water(); fopAcM_seStart(this, JA_SE_LK_CONVEY_WPOT, 0); @@ -2931,7 +2901,7 @@ void Act_c::set_mtx() { fVar1 = 0.0f; } - if (m678 == 4 && m685 != 0) { + if (m678 == 4 && m685) { mDoMtx_stack_c::transS(current.pos.x, current.pos.y + m6EC + fVar1, current.pos.z); mDoMtx_stack_c::concat(mPoseMtx); } else { @@ -3327,12 +3297,10 @@ void Act_c::calc_drop_param(float* outArg1, float* outArg2, float* outArg3) cons if (fVar3 >= 0.0f) { fVar0 = 0.0f; + } else if (fVar3 <= -data().mAcchRoofHeight) { + fVar0 = 0.5f; } else { - if (fVar3 <= -data().mAcchRoofHeight) { - fVar0 = 0.5f; - } else { - fVar0 = -fVar3 * (0.5f / data().mAcchRoofHeight); - } + fVar0 = -fVar3 * (0.5f / data().mAcchRoofHeight); } f32 fVar6 = 1.0f - fVar0; @@ -3432,7 +3400,7 @@ void Act_c::se_fall_water() { for (s32 i = 0; i < ARRAY_SSIZE(polyInfoArr); i++) { if ( #if VERSION > VERSION_DEMO - polyInfoArr[i] != NULL && + polyInfoArr[i] != NULL && #endif polyInfoArr[i]->GetBgIndex() >= 0 && polyInfoArr[i]->GetBgIndex() < 0x100) { @@ -3523,7 +3491,7 @@ bool Act_c::_execute() { bool bVar4; if (prm_get_spec() == 5) { - bVar4 = is_switch() == FALSE; + bVar4 = is_switch() == false; } else { bVar4 = false; } @@ -3567,7 +3535,7 @@ bool Act_c::_execute() { spec_clr_actor(); - fopAcM_SetModel(this, m678 == 4 && m686 != 0 ? mpModel : NULL); + fopAcM_SetModel(this, m678 == 4 && m686 ? mpModel : NULL); if (bVar6) { fopAcM_delete(this);