From ca6bebcb4b14fa7b9c3bb1ba5a15f592c8dde92e Mon Sep 17 00:00:00 2001 From: LagoLunatic Date: Sat, 11 Jan 2025 17:20:45 -0500 Subject: [PATCH] Add more actor mode enums --- include/c/c_dylink.h | 3 ++- include/d/actor/d_a_agb.h | 9 ++++++++- include/d/actor/d_a_bita.h | 5 +++++ include/d/actor/d_a_dai_item.h | 6 ++++++ include/d/actor/d_a_ghostship.h | 6 ++++++ include/d/actor/d_a_item.h | 7 ++++++- src/d/actor/d_a_agb.cpp | 18 +++++++++--------- src/d/actor/d_a_auction.cpp | 2 +- src/d/actor/d_a_bita.cpp | 12 ++++++------ src/d/actor/d_a_dai_item.cpp | 8 ++++---- src/d/actor/d_a_ghostship.cpp | 4 ++-- src/d/actor/d_a_item.cpp | 10 +++++----- src/d/actor/d_a_lbridge.cpp | 2 +- src/d/actor/d_a_warpfout.cpp | 2 +- src/d/d_s_name.cpp | 2 +- 15 files changed, 63 insertions(+), 33 deletions(-) diff --git a/include/c/c_dylink.h b/include/c/c_dylink.h index 6b8d68cff..9b7473de4 100644 --- a/include/c/c_dylink.h +++ b/include/c/c_dylink.h @@ -1,7 +1,8 @@ #ifndef C_C_DYLINK_H #define C_C_DYLINK_H -#include "f_op/f_op_scene_mng.h" +#include "dolphin/types.h" +#include "SSystem/SComponent/c_phase.h" struct cDylPhs { static int phase_01(void*); diff --git a/include/d/actor/d_a_agb.h b/include/d/actor/d_a_agb.h index 22fad7702..fb5ae1fc9 100644 --- a/include/d/actor/d_a_agb.h +++ b/include/d/actor/d_a_agb.h @@ -4,7 +4,7 @@ #include "d/d_bg_s.h" #include "d/d_bg_s_acch.h" #include "d/d_particle.h" -#include "f_op/f_op_actor_mng.h" +#include "f_op/f_op_actor.h" #include "global.h" #include "m_Do/m_Do_ext.h" #include "m_Do/m_Do_hostIO.h" @@ -64,6 +64,13 @@ public: /* 0xB */ UpAct_UNKB, }; + enum Mode { + MODE_MOVE = 0x0, + MODE_LOOK_ATTENTION = 0x1, + MODE_LOAD = 0x2, + MODE_DELETE = 0x3, + }; + void NameConv(); int uploadInitCheck(); int uploadPortCheckWait(); diff --git a/include/d/actor/d_a_bita.h b/include/d/actor/d_a_bita.h index 00b5eb348..5f9c1d97a 100644 --- a/include/d/actor/d_a_bita.h +++ b/include/d/actor/d_a_bita.h @@ -11,6 +11,11 @@ class dBgW; class bita_class : public fopAc_ac_c { public: + enum Mode { + MODE_NORMAL = 0x0, + MODE_DEAD = 0x1, + }; + /* 0x290 */ request_of_phase_process_class mPhs; /* 0x298 */ J3DModel* mpModel; /* 0x29C */ J3DModel* mpModelEf; diff --git a/include/d/actor/d_a_dai_item.h b/include/d/actor/d_a_dai_item.h index 7bd6b54c7..b4441adf7 100644 --- a/include/d/actor/d_a_dai_item.h +++ b/include/d/actor/d_a_dai_item.h @@ -13,6 +13,12 @@ class J3DNode; class daStandItem_c : public fopAc_ac_c { public: + enum Mode { + MODE_CARRY = 0x0, + MODE_WAIT = 0x1, + MODE_DROP = 0x2, + }; + int getItemNo() const { return mItemNo; } bool _delete(); diff --git a/include/d/actor/d_a_ghostship.h b/include/d/actor/d_a_ghostship.h index 8cc1c9059..14822b44a 100644 --- a/include/d/actor/d_a_ghostship.h +++ b/include/d/actor/d_a_ghostship.h @@ -11,6 +11,12 @@ class daGhostship_c : public fopAc_ac_c { public: + enum Mode { + MODE_WAIT = 0x0, + MODE_REALIZE = 0x1, + MODE_PATH_MOVE = 0x2, + }; + bool checkInShip() { return mbCanEnterShip; } void getAlpha() {} void setMtx() {} diff --git a/include/d/actor/d_a_item.h b/include/d/actor/d_a_item.h index 292b41d4c..df2ba274c 100644 --- a/include/d/actor/d_a_item.h +++ b/include/d/actor/d_a_item.h @@ -34,6 +34,11 @@ public: FLAG_HOOK = 0x40, }; + enum Mode { + MODE_WAIT = 0x0, + MODE_WATER = 0x2, + }; + float getYOffset(); void set_mtx(); void set_mtx_base(J3DModel*, cXyz, csXyz); @@ -139,4 +144,4 @@ namespace daItem_prm { inline u32 getSwitchNo2(daItem_c* item) { return (fopAcM_GetParam(item) & 0x00FF0000) >> 0x10; } }; -#endif /* D_A_ITEM_H */ \ No newline at end of file +#endif /* D_A_ITEM_H */ diff --git a/src/d/actor/d_a_agb.cpp b/src/d/actor/d_a_agb.cpp index 5bd2628cf..616fc7968 100644 --- a/src/d/actor/d_a_agb.cpp +++ b/src/d/actor/d_a_agb.cpp @@ -590,7 +590,7 @@ void daAgb_c::modeLoad() { } else { mUploadAction = UpAct_UNK0; eventInfo.onCondition(dEvtCnd_CANTALK_e); - mMode = 0; + mMode = MODE_MOVE; } } @@ -606,7 +606,7 @@ void daAgb_c::modeLookAttention() { if (dComIfGp_evmng_endCheck("DEFAULT_AGB_LOOK_ATTENTION")) { dComIfGp_event_reset(); - mMode = 0; + mMode = MODE_MOVE; se_flag = false; field_0x65c = 1; @@ -1347,7 +1347,7 @@ void daAgb_c::modeMove() { if (eventInfo.checkCommandTalk()) { mUploadAction = UpAct_UNK0; - mMode = 2; + mMode = MODE_LOAD; return; } @@ -1407,7 +1407,7 @@ void daAgb_c::modeMove() { dComIfGp_checkPlayerStatus0(0, daPyStts0_SHIP_RIDE_e) ) ) { - mMode = 1; + mMode = MODE_LOOK_ATTENTION; offActive(); eyePos = current.pos; @@ -1502,7 +1502,7 @@ void daAgb_c::modeMove() { CursorMove(this, stage_type); } - if (mMode == 0) { + if (mMode == MODE_MOVE) { eventInfo.onCondition(dEvtCnd_CANTALK_e); } } @@ -1614,7 +1614,7 @@ static int daAgb_Execute(daAgb_c* i_this) { } } - if (i_this->isHold() && !var_r27 && i_this->mMode != 1) { + if (i_this->isHold() && !var_r27 && i_this->mMode != daAgb_c::MODE_LOOK_ATTENTION) { if (i_this->field_0x675) { if (i_this->field_0x676) { i_this->shape_angle.z += 0x1000; @@ -1633,7 +1633,7 @@ static int daAgb_Execute(daAgb_c* i_this) { mDoMtx_stack_c::ZrotM(i_this->shape_angle.z); i_this->mpModel->setBaseTRMtx(mDoMtx_stack_c::get()); - if (i_this->mMode == 1) { + if (i_this->mMode == daAgb_c::MODE_LOOK_ATTENTION) { i_this->mBrk.setFrame(19.0f); } else if (i_this->field_0x65c != 0 && (i_this->field_0x66b == 4 || i_this->field_0x66b == 13 || @@ -1665,8 +1665,8 @@ static int daAgb_Draw(daAgb_c* i_this) { if (i_this->field_0x66f && !daAgb_c::mFlags.field_0xa_7 && (!dComIfGp_event_runCheck() || dComIfGp_evmng_startCheck("DEFAULT_AGB_LOOK_ATTENTION") || - i_this->mMode == 2) && - (i_this->field_0x65c == 0 || i_this->mMode == 1 || i_this->field_0x66b == 0x10 || + i_this->mMode == daAgb_c::MODE_LOAD) && + (i_this->field_0x65c == 0 || i_this->mMode == daAgb_c::MODE_LOOK_ATTENTION || i_this->field_0x66b == 0x10 || i_this->field_0x66b == 3 || i_this->field_0x66b == 12 || i_this->field_0x66b == 4 || i_this->field_0x66b == 13 || (i_this->field_0x66b == 14 && i_this->field_0x65c > 120))) { diff --git a/src/d/actor/d_a_auction.cpp b/src/d/actor/d_a_auction.cpp index 91ed7f8bf..6ef597d90 100644 --- a/src/d/actor/d_a_auction.cpp +++ b/src/d/actor/d_a_auction.cpp @@ -1145,7 +1145,7 @@ void daAuction_c::eventMainMsgBikonC() { m7A8.y += getPiconDispOfs(m827); dComIfGp_particle_set(0x8153, &m7A8, NULL, NULL, 0xFF, NULL, fopAcM_GetRoomNo(this)); - mTimer = 0x1E; + mTimer = 30; if (m827 == 0) { mDoAud_seStart(JA_SE_AUC_BID_GAUGE_MAX); diff --git a/src/d/actor/d_a_bita.cpp b/src/d/actor/d_a_bita.cpp index 7c0305a89..d3c4c3d52 100644 --- a/src/d/actor/d_a_bita.cpp +++ b/src/d/actor/d_a_bita.cpp @@ -34,7 +34,7 @@ static void* b_a_sub(void* search, void* user) { /* 000000C4-0000018C .text daBita_Draw__FP10bita_class */ static BOOL daBita_Draw(bita_class* i_this) { dKy_getEnvlight().settingTevStruct(TEV_TYPE_BG0, &i_this->current.pos, &i_this->tevStr); - if (i_this->mMode == 1 && i_this->mSub == 1) { + if (i_this->mMode == bita_class::MODE_DEAD && i_this->mSub == 1) { dKy_getEnvlight().setLightTevColorType(i_this->mpModelEf, &i_this->tevStr); i_this->mpBrkAnm->entry(i_this->mpModelEf->getModelData()); mDoExt_modelUpdateDL(i_this->mpModelEf); @@ -56,7 +56,7 @@ static void mode_normal(bita_class* i_this) { } } else { if (i_this->mCyl.ChkTgHit() && i_this->mCyl.GetTgHitObj()->GetAtType() == AT_TYPE_FIRE) { - i_this->mMode = 1; + i_this->mMode = bita_class::MODE_DEAD; i_this->mSub = 0; } } @@ -101,7 +101,7 @@ static void base_mtx_set(bita_class* i_this) { MtxTrans(i_this->current.pos.x, i_this->current.pos.y, i_this->current.pos.z, false); cMtx_YrotM(*calc_mtx, i_this->shape_angle.y); cMtx_XrotM(*calc_mtx, i_this->shape_angle.x); - if (i_this->mMode == 1 && i_this->mSub >= 1) { + if (i_this->mMode == bita_class::MODE_DEAD && i_this->mSub >= 1) { i_this->mpModelEf->setBaseTRMtx(*calc_mtx); if (i_this->mTimer < 60) i_this->mpBrkAnm->play(); @@ -120,10 +120,10 @@ static BOOL daBita_Execute(bita_class* i_this) { fopAcM_OffStatus(i_this, fopAcStts_UNK4000_e); switch (i_this->mMode) { - case 0: + case bita_class::MODE_NORMAL: mode_normal(i_this); break; - case 1: + case bita_class::MODE_DEAD: mode_dead(i_this); break; } @@ -132,7 +132,7 @@ static BOOL daBita_Execute(bita_class* i_this) { cMtx_copy(*calc_mtx, i_this->mMtx); i_this->mpBgW->Move(); - if (btd != NULL && i_this->mMode == 0) { + if (btd != NULL && i_this->mMode == bita_class::MODE_NORMAL) { cMtx_YrotS(*calc_mtx, i_this->shape_angle.y); cMtx_XrotM(*calc_mtx, i_this->shape_angle.x); cXyz offs(0.0f, -80.0f, 160.0f); diff --git a/src/d/actor/d_a_dai_item.cpp b/src/d/actor/d_a_dai_item.cpp index 3bb6a9ee5..3c2a47e5b 100644 --- a/src/d/actor/d_a_dai_item.cpp +++ b/src/d/actor/d_a_dai_item.cpp @@ -460,7 +460,7 @@ static const ActionFunc item_action_tbl[] = { /* 800E44A4-800E4518 .text itemProc__13daStandItem_cFv */ void daStandItem_c::itemProc() { - if (mMode == 1 && item_action_tbl[mItemType] != NULL) + if (mMode == MODE_WAIT && item_action_tbl[mItemType] != NULL) (this->*(item_action_tbl[mItemType]))(); } @@ -718,7 +718,7 @@ void daStandItem_c::mode_carry_init() { speed = cXyz::Zero; attention_info.flags &= ~fopAc_Attn_ACTION_CARRY_e; mCyl.OffCoSetBit(); - mMode = 0; + mMode = MODE_CARRY; } /* 800E51D8-800E5204 .text mode_carry__13daStandItem_cFv */ @@ -732,7 +732,7 @@ void daStandItem_c::mode_wait_init() { fopAcM_SetSpeedF(this, 0.0f); fopAcM_SetSpeed(this, 0.0f, 0.0f, 0.0f); mCyl.OnCoSetBit(); - mMode = 1; + mMode = MODE_WAIT; } /* 800E5230-800E5234 .text mode_wait__13daStandItem_cFv */ @@ -741,7 +741,7 @@ void daStandItem_c::mode_wait() { /* 800E5234-800E5240 .text mode_drop_init__13daStandItem_cFv */ void daStandItem_c::mode_drop_init() { - mMode = 2; + mMode = MODE_DROP; } /* 800E5240-800E52D0 .text mode_drop__13daStandItem_cFv */ diff --git a/src/d/actor/d_a_ghostship.cpp b/src/d/actor/d_a_ghostship.cpp index 001665471..6240f9843 100644 --- a/src/d/actor/d_a_ghostship.cpp +++ b/src/d/actor/d_a_ghostship.cpp @@ -90,7 +90,7 @@ void daGhostship_c::pathMove() { /* 000004CC-000004D8 .text modeWaitInit__13daGhostship_cFv */ void daGhostship_c::modeWaitInit() { - mMode = 0; + mMode = MODE_WAIT; } /* 000004D8-000004DC .text modeWait__13daGhostship_cFv */ @@ -128,7 +128,7 @@ BOOL daGhostship_c::_pathMove(cXyz* curPos, cXyz* p_curPntPos, cXyz* p_nextPntPo /* 00000770-0000077C .text modePathMoveInit__13daGhostship_cFv */ void daGhostship_c::modePathMoveInit() { - mMode = 2; + mMode = MODE_PATH_MOVE; } /* 0000077C-000007D0 .text modePathMove__13daGhostship_cFv */ diff --git a/src/d/actor/d_a_item.cpp b/src/d/actor/d_a_item.cpp index 9ae45a89e..545efb803 100644 --- a/src/d/actor/d_a_item.cpp +++ b/src/d/actor/d_a_item.cpp @@ -1200,14 +1200,14 @@ BOOL daItem_c::timeCount() { /* 800F7F0C-800F7F50 .text mode_wait_init__8daItem_cFv */ void daItem_c::mode_wait_init() { - mMode = 0; + mMode = MODE_WAIT; gravity = getData()->mGravity; mPtclRippleCb.end(); } /* 800F7F50-800F80CC .text mode_water_init__8daItem_cFv */ void daItem_c::mode_water_init() { - mMode = 2; + mMode = MODE_WATER; if (daSea_ChkArea(current.pos.x, current.pos.z)) { f32 seaH = daSea_calcWave(current.pos.x, current.pos.z); @@ -1358,7 +1358,7 @@ BOOL daItem_c::initAction() { gravity = getData()->mGravity; clrFlag(FLAG_UNK04); - mMode = 0; + mMode = MODE_WAIT; return TRUE; } @@ -1399,7 +1399,7 @@ BOOL daItem_c::initAction() { case 0xA: gravity = getData()->mGravity; scale.setall(0.0f); - mMode = 0; + mMode = MODE_WAIT; break; case 0xB: current.angle.y = cM_rndF((f32)0xFFFF); @@ -1427,7 +1427,7 @@ BOOL daItem_c::initAction() { fopAcM_SetSpeedF(this, speedF); scale.setall(0.0f); - mMode = 0; + mMode = MODE_WAIT; setFlag(FLAG_UNK04); diff --git a/src/d/actor/d_a_lbridge.cpp b/src/d/actor/d_a_lbridge.cpp index 165018ac8..9beffc65c 100644 --- a/src/d/actor/d_a_lbridge.cpp +++ b/src/d/actor/d_a_lbridge.cpp @@ -240,7 +240,7 @@ void daLbridge_c::appear_bridge() { mpEmitter->playDrawParticle(); } - mTimer = 0x1F; + mTimer = 31; unk31C = 1; } diff --git a/src/d/actor/d_a_warpfout.cpp b/src/d/actor/d_a_warpfout.cpp index f285a5dab..73fbfe8cd 100644 --- a/src/d/actor/d_a_warpfout.cpp +++ b/src/d/actor/d_a_warpfout.cpp @@ -86,7 +86,7 @@ void daWarpfout_c::initWarp1(int) { /* 000002A8-00000344 .text actWarp1__12daWarpfout_cFi */ BOOL daWarpfout_c::actWarp1(int) { - if (mTimer == 0x4) { + if (mTimer == 4) { cXyz effectPos = dComIfGp_getLinkPlayer()->current.pos; effectPos.y += 40.0f; diff --git a/src/d/d_s_name.cpp b/src/d/d_s_name.cpp index 14deed751..131d72344 100644 --- a/src/d/d_s_name.cpp +++ b/src/d/d_s_name.cpp @@ -496,7 +496,7 @@ void dScnName_c::NoteOpen() { field_0x558--; return; } - mDoAud_seStart(2201, NULL, 0, 0); + mDoAud_seStart(JA_SE_MSEL_CLOTH_ON, NULL, 0, 0); mMainProc = 2; field_0x55d = 1; cloth.cloth_c->init();