From 17cf09cc0937c5ce1453250867d9999264b9698a Mon Sep 17 00:00:00 2001 From: LagoLunatic Date: Thu, 18 Jan 2024 00:26:06 -0500 Subject: [PATCH] clean up some inlines --- .../JSystem/J3DGraphAnimator/J3DAnimation.h | 1 - .../JSystem/J3DGraphAnimator/J3DMaterialAnm.h | 10 ++--- include/JSystem/JUtility/JUTGamePad.h | 2 +- include/f_op/f_op_actor_mng.h | 44 +++++++++++++++---- include/f_pc/f_pc_manager.h | 4 ++ src/d/actor/d_a_agb.cpp | 4 +- src/d/actor/d_a_am.cpp | 4 +- src/d/actor/d_a_am2.cpp | 4 +- src/d/actor/d_a_bk.cpp | 4 +- src/d/actor/d_a_ghostship.cpp | 2 +- src/d/actor/d_a_item.cpp | 4 +- src/d/actor/d_a_npc_btsw2.cpp | 22 +++++----- src/d/actor/d_a_player_sword.inc | 4 +- src/d/actor/d_a_rd.cpp | 4 +- src/f_op/f_op_actor_mng.cpp | 12 ++--- 15 files changed, 77 insertions(+), 48 deletions(-) diff --git a/include/JSystem/J3DGraphAnimator/J3DAnimation.h b/include/JSystem/J3DGraphAnimator/J3DAnimation.h index f8746cc04..21ec3200d 100644 --- a/include/JSystem/J3DGraphAnimator/J3DAnimation.h +++ b/include/JSystem/J3DGraphAnimator/J3DAnimation.h @@ -698,7 +698,6 @@ public: virtual ~J3DAnmVtxColor(); virtual void getColor(u8, u16, GXColor*) const {} - inline J3DAnmVtxColorIndexData* getAnmVtxColorIndexData(u8 idx, u16 frame) { return &mAnmVtxColorIndexData[idx][frame]; } protected: /* 0x10 */ u16 mAnmTableNum[2]; diff --git a/include/JSystem/J3DGraphAnimator/J3DMaterialAnm.h b/include/JSystem/J3DGraphAnimator/J3DMaterialAnm.h index d4541799c..797c40609 100644 --- a/include/JSystem/J3DGraphAnimator/J3DMaterialAnm.h +++ b/include/JSystem/J3DGraphAnimator/J3DMaterialAnm.h @@ -155,11 +155,11 @@ public: J3DMaterialAnm() { initialize(); } void initialize(); - inline void setMatColorAnm(int i, J3DMatColorAnm* pAnm) { mMatColorAnm[i] = pAnm; } - inline void setTexMtxAnm(int i, J3DTexMtxAnm* pAnm) { mTexMtxAnm[i] = pAnm; } - inline void setTexNoAnm(int i, J3DTexNoAnm* pAnm) { mTexNoAnm[i] = pAnm; } - inline void setTevColorAnm(int i, J3DTevColorAnm* pAnm) { mTevColorAnm[i] = pAnm; } - inline void setTevKColorAnm(int i, J3DTevKColorAnm* pAnm) { mTevKColorAnm[i] = pAnm; } + void setMatColorAnm(int i, J3DMatColorAnm* pAnm) { mMatColorAnm[i] = pAnm; } + void setTexMtxAnm(int i, J3DTexMtxAnm* pAnm) { mTexMtxAnm[i] = pAnm; } + void setTexNoAnm(int i, J3DTexNoAnm* pAnm) { mTexNoAnm[i] = pAnm; } + void setTevColorAnm(int i, J3DTevColorAnm* pAnm) { mTevColorAnm[i] = pAnm; } + void setTevKColorAnm(int i, J3DTevKColorAnm* pAnm) { mTevKColorAnm[i] = pAnm; } virtual ~J3DMaterialAnm() {} virtual void calc(J3DMaterial*) const; diff --git a/include/JSystem/JUtility/JUTGamePad.h b/include/JSystem/JUtility/JUTGamePad.h index f3ba6c390..bf0844e0e 100644 --- a/include/JSystem/JUtility/JUTGamePad.h +++ b/include/JSystem/JUtility/JUTGamePad.h @@ -122,7 +122,7 @@ public: return isPushingReset; } - inline void stopMotorWave() { mRumble.stopPatternedRumbleAtThePeriod(); } + void stopMotorWave() { mRumble.stopPatternedRumbleAtThePeriod(); } void stopMotor() { mRumble.stopMotor(mPortNum); } void stopMotorHard() { mRumble.stopMotorHard(mPortNum); } diff --git a/include/f_op/f_op_actor_mng.h b/include/f_op/f_op_actor_mng.h index 1d7b535ed..a17c91801 100644 --- a/include/f_op/f_op_actor_mng.h +++ b/include/f_op/f_op_actor_mng.h @@ -129,10 +129,22 @@ inline s16 fopAcM_GetProfName(void* pActor) { return fpcM_GetProfName(pActor); } +inline actor_process_profile_definition* fopAcM_GetProfile(void* pActor) { + return (actor_process_profile_definition*)fpcM_GetProfile(pActor); +} + +inline void fopAcM_SetPriority(void* pActor, int priority) { + fpcM_SetPriority(pActor, priority); +} + inline u8 fopAcM_GetGroup(fopAc_ac_c* p_actor) { return p_actor->mGroup; } +inline void fopAcM_SetGroup(fopAc_ac_c* pActor, u8 group) { + pActor->mGroup = group; +} + inline void fopAcM_OnStatus(fopAc_ac_c* pActor, u32 flag) { pActor->mStatus |= flag; } @@ -154,28 +166,32 @@ inline fopAc_ac_c* fopAcM_Search(fopAcIt_JudgeFunc func, void* param) { return (fopAc_ac_c*)fopAcIt_Judge(func, param); } -inline cXyz& fopAcM_GetPosition_p(fopAc_ac_c* pActor) { - return pActor->current.pos; +inline cXyz* fopAcM_GetPosition_p(fopAc_ac_c* pActor) { + return &pActor->current.pos; } inline cXyz& fopAcM_GetPosition(fopAc_ac_c* pActor) { return pActor->current.pos; } -inline cXyz& fopAcM_GetOldPosition_p(fopAc_ac_c* pActor) { - return pActor->old.pos; +inline cXyz* fopAcM_GetOldPosition_p(fopAc_ac_c* pActor) { + return &pActor->old.pos; } -inline cXyz& fopAcM_GetSpeed_p(fopAc_ac_c* pActor) { +inline cXyz* fopAcM_GetSpeed_p(fopAc_ac_c* pActor) { + return &pActor->speed; +} + +inline cXyz& fopAcM_GetSpeed(fopAc_ac_c* pActor) { return pActor->speed; } -inline csXyz& fopAcM_GetAngle_p(fopAc_ac_c* pActor) { - return pActor->current.angle; +inline csXyz* fopAcM_GetAngle_p(fopAc_ac_c* pActor) { + return &pActor->current.angle; } -inline csXyz& fopAcM_GetShapeAngle_p(fopAc_ac_c* pActor) { - return pActor->shape_angle; +inline csXyz* fopAcM_GetShapeAngle_p(fopAc_ac_c* pActor) { + return &pActor->shape_angle; } inline bool fopAcM_CheckCondition(fopAc_ac_c* p_actor, u32 flag) { @@ -278,6 +294,10 @@ inline f32 fopAcM_getCullSizeFar(fopAc_ac_c* i_actor) { return i_actor->mCullSizeFar; } +inline void fopAcM_SetCullSize(fopAc_ac_c* i_actor, int i_culltype) { + i_actor->mCullType = i_culltype; +} + inline int fopAcM_GetCullSize(fopAc_ac_c* i_actor) { return i_actor->mCullType; } @@ -589,4 +609,10 @@ inline void fopAcM_offDraw(fopAc_ac_c* actor) { fopDwTg_DrawQTo(&actor->mDwTg); } +inline void fopAcM_getCullSizeBoxMax(fopAc_ac_c*) {} +inline void fopAcM_getCullSizeBoxMin(fopAc_ac_c*) {} +inline void fopAcM_monsSeStart(fopAc_ac_c*, unsigned long, Vec*, unsigned long) {} +inline void fopAcM_getNameString(fopAc_ac_c*, char*) {} +inline void fopAcM_orderOtherEvent(fopAc_ac_c*, char*, unsigned short) {} + #endif diff --git a/include/f_pc/f_pc_manager.h b/include/f_pc/f_pc_manager.h index 559829225..97876450d 100644 --- a/include/f_pc/f_pc_manager.h +++ b/include/f_pc/f_pc_manager.h @@ -46,6 +46,10 @@ inline s32 fpcM_ChangeLayerID(void* proc, int layerID) { return fpcPi_Change(&((base_process_class*)proc)->mPi, layerID, fpcPi_CURRENT_e, fpcPi_CURRENT_e); } +inline void fpcM_SetPriority(void* proc, int priority) { + fpcPi_Change(&((base_process_class*)proc)->mPi, fpcLy_CURRENT_e, priority, fpcPi_CURRENT_e); +} + inline s32 fpcM_IsJustType(int type1, int type2) { return fpcBs_Is_JustOfType(type1, type2); } diff --git a/src/d/actor/d_a_agb.cpp b/src/d/actor/d_a_agb.cpp index a28961005..9bb53a1e2 100644 --- a/src/d/actor/d_a_agb.cpp +++ b/src/d/actor/d_a_agb.cpp @@ -1568,11 +1568,11 @@ static int daAgb_Create(fopAc_ac_c* i_this) { return cPhs_ERROR_e; } - a_this->mCrrPos.Set(&fopAcM_GetPosition_p(a_this), &fopAcM_GetOldPosition_p(a_this), (void*)NULL, NULL); + a_this->mCrrPos.Set(fopAcM_GetPosition_p(a_this), fopAcM_GetOldPosition_p(a_this), (void*)NULL, NULL); a_this->mCrrPos.SetWall(171.0f, 50.0f); a_this->mCrrPos.SetGndUpY(170.0f); a_this->mCrrPos.ClrNoRoof(); - a_this->mAcch.Set(&fopAcM_GetPosition_p(a_this), &fopAcM_GetOldPosition_p(a_this), a_this, 1, &a_this->mAcchCir); + a_this->mAcch.Set(fopAcM_GetPosition_p(a_this), fopAcM_GetOldPosition_p(a_this), a_this, 1, &a_this->mAcchCir); a_this->mAcch.OnLineCheck(); a_this->mAcch.SetGrndNone(); a_this->mAcchCir.SetWall(171.0f, 40.0f); diff --git a/src/d/actor/d_a_am.cpp b/src/d/actor/d_a_am.cpp index 3a9cb9777..95fda2183 100644 --- a/src/d/actor/d_a_am.cpp +++ b/src/d/actor/d_a_am.cpp @@ -1241,8 +1241,8 @@ static s32 daAM_Create(fopAc_ac_c* i_actor) { i_this->mAttentionInfo.mFlags = 0; i_this->mAcch.Set( - &fopAcM_GetPosition_p(i_this), &fopAcM_GetOldPosition_p(i_this), - i_this, 1, &i_this->mAcchCir, &fopAcM_GetSpeed_p(i_this) + fopAcM_GetPosition_p(i_this), fopAcM_GetOldPosition_p(i_this), + i_this, 1, &i_this->mAcchCir, fopAcM_GetSpeed_p(i_this) ); i_this->mStts.Init(254, 1, i_this); diff --git a/src/d/actor/d_a_am2.cpp b/src/d/actor/d_a_am2.cpp index e244406ca..20055d3f2 100644 --- a/src/d/actor/d_a_am2.cpp +++ b/src/d/actor/d_a_am2.cpp @@ -1347,8 +1347,8 @@ static s32 daAM2_Create(fopAc_ac_c* i_actor) { i_this->mAttentionInfo.mFlags = 0; i_this->mAcch.Set( - &fopAcM_GetPosition_p(i_this), &fopAcM_GetOldPosition_p(i_this), - i_this, 1, &i_this->mAcchCir, &fopAcM_GetSpeed_p(i_this) + fopAcM_GetPosition_p(i_this), fopAcM_GetOldPosition_p(i_this), + i_this, 1, &i_this->mAcchCir, fopAcM_GetSpeed_p(i_this) ); i_this->mStts.Init(254, 1, i_this); diff --git a/src/d/actor/d_a_bk.cpp b/src/d/actor/d_a_bk.cpp index ee9a648f6..ab5c2a487 100644 --- a/src/d/actor/d_a_bk.cpp +++ b/src/d/actor/d_a_bk.cpp @@ -809,9 +809,9 @@ static s32 daBk_Create(fopAc_ac_c* i_actor) { } i_this->mDamageReaction.mAcch.Set( - &fopAcM_GetPosition_p(i_this), &fopAcM_GetOldPosition_p(i_this), + fopAcM_GetPosition_p(i_this), fopAcM_GetOldPosition_p(i_this), i_this, 1, &i_this->mDamageReaction.mAcchCir, - &fopAcM_GetSpeed_p(i_this) + fopAcM_GetSpeed_p(i_this) ); i_this->mDamageReaction.mAcchCir.SetWall(40.0f, 40.0f); i_this->mDamageReaction.mAcch.ClrRoofNone(); diff --git a/src/d/actor/d_a_ghostship.cpp b/src/d/actor/d_a_ghostship.cpp index 045b55438..cc35a9a5f 100644 --- a/src/d/actor/d_a_ghostship.cpp +++ b/src/d/actor/d_a_ghostship.cpp @@ -217,7 +217,7 @@ void daGhostship_c::createInit() { } mCir.SetWall(30.0f, 30.0f); - mAcch.Set(&fopAcM_GetPosition_p(this), &fopAcM_GetOldPosition_p(this), this, 1, &mCir, &fopAcM_GetSpeed_p(this)); + mAcch.Set(fopAcM_GetPosition_p(this), fopAcM_GetOldPosition_p(this), this, 1, &mCir, fopAcM_GetSpeed_p(this)); mAcch.SetWallNone(); mAcch.SetRoofNone(); dLib_waveRot(¤t.pos, 0.0f, &mWave); diff --git a/src/d/actor/d_a_item.cpp b/src/d/actor/d_a_item.cpp index a912c4b76..a340aa9ca 100644 --- a/src/d/actor/d_a_item.cpp +++ b/src/d/actor/d_a_item.cpp @@ -134,7 +134,7 @@ void itemGetCallBack(fopAc_ac_c* item_actor, dCcD_GObjInf*, fopAc_ac_c* collided /* 800F5044-800F53EC .text CreateInit__8daItem_cFv */ void daItem_c::CreateInit() { mAcchCir.SetWall(30.0f, 30.0f); - mAcch.Set(¤t.pos, &old.pos, this, 1, &mAcchCir, &fopAcM_GetSpeed_p(this)); + mAcch.Set(¤t.pos, &old.pos, this, 1, &mAcchCir, fopAcM_GetSpeed_p(this)); mAcch.m_flags &= ~0x400; mAcch.m_flags &= ~0x8; fopAcM_SetMtx(this, mpModel->getBaseTRMtx()); @@ -157,7 +157,7 @@ void daItem_c::CreateInit() { mDisappearTimer = getData()->mDuration; field_0x65a = getData()->field_0x18; - field_0x650 = fopAcM_GetSpeed_p(this).y; + field_0x650 = fopAcM_GetSpeed(this).y; mItemStatus = 0; mType = daItem_prm::getType(this); diff --git a/src/d/actor/d_a_npc_btsw2.cpp b/src/d/actor/d_a_npc_btsw2.cpp index c540d49e3..3be5a8f0c 100644 --- a/src/d/actor/d_a_npc_btsw2.cpp +++ b/src/d/actor/d_a_npc_btsw2.cpp @@ -145,17 +145,17 @@ daNpc_Btsw2_HIO_c::daNpc_Btsw2_HIO_c() { const char daNpc_Btsw2_c::m_arc_name[] = "Btsw"; static const int l_bck_ix_tbl[] = { - BTSW_INDEX_BCK_BN_WAIT01, - BTSW_INDEX_BCK_BN_WAIT02, - BTSW_INDEX_BCK_BN_TALK01, - BTSW_INDEX_BCK_BN_TALK02, - BTSW_INDEX_BCK_BN_ONEGAI, - BTSW_INDEX_BCK_BN_SUGOI, - BTSW_INDEX_BCK_BN_SUGOI, - BTSW_INDEX_BCK_BN_WALK, - BTSW_INDEX_BCK_BN_KASIGE, - BTSW_INDEX_BCK_BN_SIWAKE01, - BTSW_INDEX_BCK_BN_SIWAKE02, + BTSW_INDEX_BCK_BN_WAIT01, + BTSW_INDEX_BCK_BN_WAIT02, + BTSW_INDEX_BCK_BN_TALK01, + BTSW_INDEX_BCK_BN_TALK02, + BTSW_INDEX_BCK_BN_ONEGAI, + BTSW_INDEX_BCK_BN_SUGOI, + BTSW_INDEX_BCK_BN_SUGOI, + BTSW_INDEX_BCK_BN_WALK, + BTSW_INDEX_BCK_BN_KASIGE, + BTSW_INDEX_BCK_BN_SIWAKE01, + BTSW_INDEX_BCK_BN_SIWAKE02, }; static const int l_btp_ix_tbl[] = { diff --git a/src/d/actor/d_a_player_sword.inc b/src/d/actor/d_a_player_sword.inc index 4b61dd1ff..df7f39d8a 100644 --- a/src/d/actor/d_a_player_sword.inc +++ b/src/d/actor/d_a_player_sword.inc @@ -27,7 +27,7 @@ void daPy_lk_c::setSwordModel(BOOL r28) { /* 0x0E */ u16 tipStabBrk; }; static const sword_model_tbl_s sword_model_tbl[] = { - { + { LINK_BDL_SWA, LINK_BDL_YHSLS00, LKANM_BTK_YHSLS00, @@ -37,7 +37,7 @@ void daPy_lk_c::setSwordModel(BOOL r28) { LKANM_BTK_CUTFH, LKANM_BRK_CUTFH }, - { + { LINK_BDL_SWMS, LINK_BDL_YMSLI00, LKANM_BTK_YMSLI00, diff --git a/src/d/actor/d_a_rd.cpp b/src/d/actor/d_a_rd.cpp index 5ba205c27..a47a2d95e 100644 --- a/src/d/actor/d_a_rd.cpp +++ b/src/d/actor/d_a_rd.cpp @@ -839,7 +839,7 @@ void daRd_c::modeDeath() { fopAcM_onActor(this); // Do not consider the ReDead to be a living enemy while its death animation is playing out. - mGroup = fopAc_ENV_e; + fopAcM_SetGroup(this, fopAc_ENV_e); if (cLib_calcTimer(&mTimer1) == 0) { fopAcM_createDisappear(this, ¤t.pos, 5); @@ -1773,7 +1773,7 @@ void daRd_c::createInit() { mCyl.Set(m_cyl_src); mCyl.SetStts(&mStts); mAcchCir.SetWall(30.0f, 30.0f); - mAcch.Set(&fopAcM_GetPosition_p(this), &fopAcM_GetOldPosition_p(this), this, 1, &mAcchCir, &fopAcM_GetSpeed_p(this)); + mAcch.Set(fopAcM_GetPosition_p(this), fopAcM_GetOldPosition_p(this), this, 1, &mAcchCir, fopAcM_GetSpeed_p(this)); mAcch.SetRoofNone(); J3DModelData* modelData = mpMorf->getModel()->getModelData(); mJntCtrl.setHeadJntNum(0x0A); // ree_kubi_1 diff --git a/src/f_op/f_op_actor_mng.cpp b/src/f_op/f_op_actor_mng.cpp index 0284cd54b..1cd94c354 100644 --- a/src/f_op/f_op_actor_mng.cpp +++ b/src/f_op/f_op_actor_mng.cpp @@ -490,16 +490,16 @@ f32 fopAcM_searchActorDistance2(fopAc_ac_c* i_this, fopAc_ac_c* i_other) { /* 800253C0-80025470 .text fopAcM_searchActorDistanceXZ__FP10fopAc_ac_cP10fopAc_ac_c */ f32 fopAcM_searchActorDistanceXZ(fopAc_ac_c* i_this, fopAc_ac_c* i_other) { - cXyz& this_pos = fopAcM_GetPosition_p(i_this); - cXyz& other_pos = fopAcM_GetPosition_p(i_other); - return (other_pos - this_pos).absXZ(); + cXyz* this_pos = fopAcM_GetPosition_p(i_this); + cXyz* other_pos = fopAcM_GetPosition_p(i_other); + return (*other_pos - *this_pos).absXZ(); } /* 80025470-800254BC .text fopAcM_searchActorDistanceXZ2__FP10fopAc_ac_cP10fopAc_ac_c */ f32 fopAcM_searchActorDistanceXZ2(fopAc_ac_c* i_this, fopAc_ac_c* i_other) { - cXyz& this_pos = fopAcM_GetPosition_p(i_this); - cXyz& other_pos = fopAcM_GetPosition_p(i_other); - return (other_pos - this_pos).abs2XZ(); + cXyz* this_pos = fopAcM_GetPosition_p(i_this); + cXyz* other_pos = fopAcM_GetPosition_p(i_other); + return (*other_pos - *this_pos).abs2XZ(); } /* 800254BC-800255B4 .text fopAcM_rollPlayerCrash__FP10fopAc_ac_cfUl */