From 309158e274a0613594ffabddec48765cbd4f9c83 Mon Sep 17 00:00:00 2001 From: LagoLunatic Date: Thu, 10 Apr 2025 19:30:51 -0400 Subject: [PATCH] J3DModel inlines cleanup, procBottleSwing_init match, etc --- include/JSystem/J3DGraphAnimator/J3DModel.h | 13 +- .../JSystem/J3DGraphAnimator/J3DSkinDeform.h | 2 +- include/JSystem/J3DGraphBase/J3DPacket.h | 2 +- include/JSystem/J3DGraphBase/J3DTransform.h | 30 +- include/d/actor/d_a_npc_people.h | 14 +- include/d/actor/d_a_obj_movebox.h | 4 +- include/d/actor/d_a_obj_smplbg.h | 21 +- include/d/actor/d_a_obj_swheavy.h | 4 +- include/d/actor/d_a_obj_swpush.h | 8 +- include/d/actor/d_a_player_main.h | 6 +- include/d/d_com_inf_game.h | 20 +- include/d/d_item.h | 2 +- include/d/d_item_data.h | 8 +- include/d/d_snap.h | 2 +- include/f_op/f_op_actor.h | 48 +-- src/JSystem/J3DGraphAnimator/J3DCluster.cpp | 22 +- src/JSystem/J3DGraphAnimator/J3DModel.cpp | 6 +- src/JSystem/J3DGraphBase/J3DPacket.cpp | 4 - src/JSystem/J3DGraphBase/J3DShapeMtx.cpp | 8 +- src/d/actor/d_a_arrow.cpp | 2 +- src/d/actor/d_a_auction.cpp | 6 + src/d/actor/d_a_bomb2.cpp | 2 +- src/d/actor/d_a_bomb3.inc | 3 +- src/d/actor/d_a_fganon.cpp | 6 +- src/d/actor/d_a_ikari.cpp | 2 +- src/d/actor/d_a_kytag05.cpp | 2 +- src/d/actor/d_a_npc_bs1.cpp | 2 +- src/d/actor/d_a_npc_ji1.cpp | 2 +- src/d/actor/d_a_npc_nz.cpp | 20 +- src/d/actor/d_a_npc_people.cpp | 304 +++++++++--------- src/d/actor/d_a_obj_ebomzo.cpp | 2 +- src/d/actor/d_a_obj_figure.cpp | 12 +- src/d/actor/d_a_obj_monument.cpp | 2 +- src/d/actor/d_a_obj_movebox.cpp | 4 +- src/d/actor/d_a_obj_paper.cpp | 2 +- src/d/actor/d_a_obj_smplbg.cpp | 48 +-- src/d/actor/d_a_obj_swheavy.cpp | 2 +- src/d/actor/d_a_obj_swpush.cpp | 2 +- src/d/actor/d_a_obj_toripost.cpp | 2 +- src/d/actor/d_a_player_bottle.inc | 89 +++-- src/d/actor/d_a_player_dproc.inc | 25 +- src/d/actor/d_a_player_main.cpp | 6 +- src/d/actor/d_a_player_rope.inc | 4 - src/d/actor/d_a_player_sword.inc | 1 - src/d/actor/d_a_player_tact.inc | 12 +- src/d/actor/d_a_sail.cpp | 2 +- src/d/actor/d_a_ship.cpp | 4 +- src/d/d_com_inf_game.cpp | 2 +- src/d/d_npc.cpp | 4 +- src/d/d_particle.cpp | 4 +- src/d/d_wood.cpp | 3 - 51 files changed, 402 insertions(+), 405 deletions(-) diff --git a/include/JSystem/J3DGraphAnimator/J3DModel.h b/include/JSystem/J3DGraphAnimator/J3DModel.h index f298312f6..b82e5fc34 100644 --- a/include/JSystem/J3DGraphAnimator/J3DModel.h +++ b/include/JSystem/J3DGraphAnimator/J3DModel.h @@ -91,6 +91,7 @@ public: virtual ~J3DModel(); J3DModelData* getModelData() { return mModelData; } + void setModelData(J3DModelData* modelData) { mModelData = modelData; } void onFlag(u32 flag) { mFlags |= flag; } void offFlag(u32 flag) { mFlags &= ~flag; } @@ -116,7 +117,7 @@ public: u8 getScaleFlag(int idx) const { return mpScaleFlagArr[idx]; } void setScaleFlag(int idx, u8 param_1) { mpScaleFlagArr[idx] = param_1; } u8 getEnvScaleFlag(int idx) const { return mpEvlpScaleFlagArr[idx]; } - J3DVertexBuffer* getVertexBuffer() { return (J3DVertexBuffer*)&mVertexBuffer; } + J3DVertexBuffer* getVertexBuffer() { return &mVertexBuffer; } void* getCurrentVtxPos() { return mVertexBuffer.getCurrentVtxPos(); } void setCurrentVtxPos(void* v) { mVertexBuffer.setCurrentVtxPos(v); } void* getCurrentVtxNrm() { return mVertexBuffer.getCurrentVtxNrm(); } @@ -129,19 +130,15 @@ public: Mtx& getDrawMtx(int idx) { return getDrawMtxPtr()[idx]; } Mtx33* getNrmMtxPtr() { return mpNrmMtxBuf[1][mCurrentViewNo]; } Mtx33& getNrmMtx(int idx) { return getNrmMtxPtr()[idx]; } + void setNrmMtx(int idx, Mtx m) { J3DPSMtx33CopyFrom34(m, getNrmMtxPtr()[idx]); } Mtx33* getBumpMtxPtr(int idx) { return mpBumpMtxArr[1][idx][mCurrentViewNo]; } + Vec* getBaseScale() { return &mBaseScale; } // Unused in TWW void setBaseScale(const Vec& scale) { mBaseScale = scale; } void setUserArea(u32 area) { mUserArea = area; } u32 getUserArea() const { return mUserArea; } void setVisibilityManager(J3DVisibilityManager* manager) { mpVisibilityManager = manager; } - // TODO - void setModelData(J3DModelData*) {} - void setNrmMtx(int, Mtx) {} - - // Appears in TP debug maps but not TWW debug maps. - Vec* getBaseScale() { return &mBaseScale; } - +private: /* 0x000 */ /* vtable */ /* 0x004 */ J3DModelData* mModelData; /* 0x008 */ u32 mFlags; diff --git a/include/JSystem/J3DGraphAnimator/J3DSkinDeform.h b/include/JSystem/J3DGraphAnimator/J3DSkinDeform.h index 6e6d8083e..46bea165a 100644 --- a/include/JSystem/J3DGraphAnimator/J3DSkinDeform.h +++ b/include/JSystem/J3DGraphAnimator/J3DSkinDeform.h @@ -93,7 +93,7 @@ public: void normalize(f32*); void normalizeWeight(int, f32*); - void checkFlag(u32) {} + bool checkFlag(u32 i_flag) { return mFlags & i_flag; } private: friend class J3DClusterLoader; diff --git a/include/JSystem/J3DGraphBase/J3DPacket.h b/include/JSystem/J3DGraphBase/J3DPacket.h index e53d28272..d934eefde 100644 --- a/include/JSystem/J3DGraphBase/J3DPacket.h +++ b/include/JSystem/J3DGraphBase/J3DPacket.h @@ -114,7 +114,7 @@ public: virtual bool isSame(J3DMatPacket*) const; virtual int entry(J3DDrawBuffer*); - virtual void draw(); + virtual void draw() {} virtual ~J3DPacket() {} public: diff --git a/include/JSystem/J3DGraphBase/J3DTransform.h b/include/JSystem/J3DGraphBase/J3DTransform.h index 8e3fb4bf6..0c7829796 100644 --- a/include/JSystem/J3DGraphBase/J3DTransform.h +++ b/include/JSystem/J3DGraphBase/J3DTransform.h @@ -49,38 +49,34 @@ inline void J3DPSMulMtxVec(register MtxP mtx, register Vec* vec, register Vec* d register f32 fr9; register f32 fr8; register f32 fr6; - register f32 fra6; register f32 fr5; - register f32 fra5; - register f32 fra4; register f32 fr4; register f32 fr3; register f32 fr2; - register f32 fra2; - register f32 fr01; - register f32 fr00; + register f32 fr1; + register f32 fr0; #ifdef __MWERKS__ asm { - psq_l fr00, 0(vec), 0, 0 + psq_l fr0, 0(vec), 0, 0 psq_l fr2, 0(mtx), 0, 0 - psq_l fr01, 8(vec), 1, 0 - ps_mul fr4, fr2, fr00 + psq_l fr1, 8(vec), 1, 0 + ps_mul fr4, fr2, fr0 psq_l fr3, 8(mtx), 0, 0 - ps_madd fr5, fr3, fr01, fr4 + ps_madd fr5, fr3, fr1, fr4 psq_l fr8, 16(mtx), 0, 0 ps_sum0 fr6, fr5, fr6, fr5 psq_l fr9, 24(mtx), 0, 0 - ps_mul fr10, fr8, fr00 + ps_mul fr10, fr8, fr0 psq_st fr6, 0(dst), 1, 0 - ps_madd fr11, fr9, fr01, fr10 - psq_l fra2, 32(mtx), 0, 0 + ps_madd fr11, fr9, fr1, fr10 + psq_l fr2, 32(mtx), 0, 0 ps_sum0 fr12, fr11, fr12, fr11 psq_l fr3, 40(mtx), 0, 0 - ps_mul fra4, fra2, fr00 + ps_mul fr4, fr2, fr0 psq_st fr12, 4(dst), 1, 0 - ps_madd fra5, fr3, fr01, fra4 - ps_sum0 fra6, fra5, fra6, fra5 - psq_st fra6, 8(dst), 1, 0 + ps_madd fr5, fr3, fr1, fr4 + ps_sum0 fr6, fr5, fr6, fr5 + psq_st fr6, 8(dst), 1, 0 } #endif } diff --git a/include/d/actor/d_a_npc_people.h b/include/d/actor/d_a_npc_people.h index 3c886aef9..303d0a6c0 100644 --- a/include/d/actor/d_a_npc_people.h +++ b/include/d/actor/d_a_npc_people.h @@ -75,12 +75,12 @@ public: u8 getNpcNo() { return mNpcType; } request_of_phase_process_class* getPhaseP() { return &mPhs; } - void setAnmFlag(u8) {} - void setEtcFlag(u32 flags) { m758 |= flags; } + void setEtcFlag(u32 flags) { mEtcFlag |= flags; } + void setResFlag(u8 flag) { mResFlag = flag; } + void setAnmFlag(u8 flags) { mAnmFlag |= flags; } + void setTalk(u8) {} void setNoTalk(u8) {} void setOrderEventNum(u8) {} - void setResFlag(u8 flag) { m790 = flag; } - void setTalk(u8) {} daNpcPeople_c(); cPhs_State _create(); @@ -225,7 +225,7 @@ public: /* 0x74C */ f32 m74C; /* 0x750 */ f32 m750; /* 0x754 */ u8 m754[0x758 - 0x754]; - /* 0x758 */ u32 m758; + /* 0x758 */ u32 mEtcFlag; /* 0x75C */ int m75C; /* 0x760 */ int m760; /* 0x764 */ bool m764; @@ -252,12 +252,12 @@ public: /* 0x78D */ u8 m78D; /* 0x78E */ u8 m78E; /* 0x78F */ u8 m78F; - /* 0x790 */ u8 m790; + /* 0x790 */ u8 mResFlag; /* 0x791 */ u8 mNpcType; /* 0x792 */ u8 m792; /* 0x793 */ u8 m793; /* 0x794 */ u8 m794; - /* 0x795 */ u8 m795; + /* 0x795 */ u8 mAnmFlag; /* 0x796 */ s8 m796; /* 0x797 */ s8 m797; /* 0x798 */ u8 m798; diff --git a/include/d/actor/d_a_obj_movebox.h b/include/d/actor/d_a_obj_movebox.h index d97b79170..cd6b5337b 100644 --- a/include/d/actor/d_a_obj_movebox.h +++ b/include/d/actor/d_a_obj_movebox.h @@ -270,9 +270,9 @@ namespace daObjMovebox { /* 0x6B8 */ fpc_ProcID mChildPID; /* 0x6BC */ BOOL mbRollCrash; - static const char* const M_arcname[13]; + static const char* const M_arcname[]; static const dCcD_SrcCyl M_cyl_src; - static const Attr_c M_attr[13]; + static const Attr_c M_attr[]; }; STATIC_ASSERT(sizeof(Act_c) == 0x6C0); diff --git a/include/d/actor/d_a_obj_smplbg.h b/include/d/actor/d_a_obj_smplbg.h index 28f63a21a..f2ea7257f 100644 --- a/include/d/actor/d_a_obj_smplbg.h +++ b/include/d/actor/d_a_obj_smplbg.h @@ -3,7 +3,6 @@ #include "d/d_bg_s_movebg_actor.h" #include "d/d_a_obj.h" -#include "d/d_bg_w.h" namespace daObjSmplbg { class Act_c : public dBgS_MoveBgActor { @@ -18,20 +17,20 @@ namespace daObjSmplbg { struct Attr_c { /* 0x00 */ u32 mHeapSize; /* 0x04 */ const char* mResName; - /* 0x08 */ short mBDLFileIndex; - /* 0x0A */ short mDZBFileIndex; + /* 0x08 */ s16 mBDLFileIndex; + /* 0x0A */ s16 mDZBFileIndex; /* 0x0C */ MoveBGActor_SetFunc mMoveBGProc; /* 0x10 */ u32 mFlags; - /* 0x14 */ short mCullMinX; - /* 0x16 */ short mCullMinY; - /* 0x18 */ short mCullMinZ; - /* 0x1A */ short mCullMaxX; - /* 0x1C */ short mCullMaxY; - /* 0x1E */ short mCullMaxZ; - /* 0x20 */ float mEyeOffset; + /* 0x14 */ s16 mCullMinX; + /* 0x16 */ s16 mCullMinY; + /* 0x18 */ s16 mCullMinZ; + /* 0x1A */ s16 mCullMaxX; + /* 0x1C */ s16 mCullMaxY; + /* 0x1E */ s16 mCullMaxZ; + /* 0x20 */ f32 mEyeOffset; }; - static const Attr_c M_attr[1]; + static const Attr_c M_attr[]; inline const Attr_c& attr() const { return M_attr[mType]; } void isStop() {} diff --git a/include/d/actor/d_a_obj_swheavy.h b/include/d/actor/d_a_obj_swheavy.h index 682fb2f75..e1ec0aaa0 100644 --- a/include/d/actor/d_a_obj_swheavy.h +++ b/include/d/actor/d_a_obj_swheavy.h @@ -63,8 +63,8 @@ namespace daObjSwheavy { bool _execute(); bool _draw(); - static const char M_arcname[6]; - static const Attr_c M_attr[4]; + static const char M_arcname[]; + static const Attr_c M_attr[]; public: /* 0x290 */ request_of_phase_process_class mPhs; diff --git a/include/d/actor/d_a_obj_swpush.h b/include/d/actor/d_a_obj_swpush.h index 26fbbbf3d..c1eba2683 100644 --- a/include/d/actor/d_a_obj_swpush.h +++ b/include/d/actor/d_a_obj_swpush.h @@ -126,10 +126,10 @@ namespace daObjSwpush { BOOL Mthd_Execute(); BOOL Mthd_Draw(); - static const char M_arcname_kbota[9]; - static const char M_arcname_hhbot[6]; - static const Attr_c M_attr[4]; - static const u8 M_op_vtx[4]; + static const char M_arcname_kbota[]; + static const char M_arcname_hhbot[]; + static const Attr_c M_attr[]; + static const u8 M_op_vtx[]; public: /* 0x290 */ request_of_phase_process_class mKbotaPhs; diff --git a/include/d/actor/d_a_player_main.h b/include/d/actor/d_a_player_main.h index 13f3bc214..1ca4f7ddb 100644 --- a/include/d/actor/d_a_player_main.h +++ b/include/d/actor/d_a_player_main.h @@ -1759,7 +1759,7 @@ public: void getShadowID() const {} void npcStartRestartRoom() {} void setDaiokutaEnd() {} - void setWhirlId(fpc_ProcID) {} + void setWhirlId(fpc_ProcID id) { mWhirlId = id; } void decrementBombCnt() { if (mActivePlayerBombs != 0) { mActivePlayerBombs--; @@ -2173,9 +2173,9 @@ public: /* 0x3620 */ u32 m3620; /* 0x3624 */ u32 m3624; /* 0x3628 */ fpc_ProcID m3628; - /* 0x362C */ fpc_ProcID mTactZevPartnerPID; + /* 0x362C */ fpc_ProcID mTactZevPartnerId; /* 0x3630 */ fpc_ProcID m3630; - /* 0x3634 */ int m3634; + /* 0x3634 */ fpc_ProcID mWhirlId; /* 0x3638 */ fpc_ProcID mMsgId; /* 0x363C */ J3DFrameCtrl* mpSeAnmFrameCtrl; /* 0x3640 */ s16 m3640; diff --git a/include/d/d_com_inf_game.h b/include/d/d_com_inf_game.h index 5a98d8a77..8b94f168d 100644 --- a/include/d/d_com_inf_game.h +++ b/include/d/d_com_inf_game.h @@ -586,6 +586,8 @@ public: u8 getNowAnimeID() { return mMesgAnimeTagInfo; } void clearNowAnimeID() { mMesgAnimeTagInfo = 0xFF; } u8 getMesgStatus() { return mMesgStatus; } + u8 checkMesgBgm() { return mMesgBgm;; } + void setMesgBgm(u8 param_0) { mMesgBgm = param_0;; } u8 getButtonMode() { return mButtonMode; } void setButtonMode(u8 mode) { mButtonMode = mode; } @@ -743,7 +745,7 @@ public: #endif /* 0x4965 */ u8 field_0x4965; /* 0x4966 */ char mInputPassword[0x11]; - /* 0x4977 */ u8 field_0x4977; + /* 0x4977 */ u8 mMesgBgm; /* 0x4978 */ u8 field_0x4978; /* 0x4979 */ u8 m2dShow; /* 0x497A */ u8 field_0x497a; @@ -2624,6 +2626,22 @@ inline u8 dComIfGp_getMesgStatus() { return g_dComIfG_gameInfo.play.getMesgStatus(); } +inline u8 dComIfGp_checkMesgBgm() { + return g_dComIfG_gameInfo.play.checkMesgBgm(); +} + +inline void dComIfGp_setMesgBgmOff() { + g_dComIfG_gameInfo.play.setMesgBgm(0); +} + +inline void dComIfGp_setMesgBgmOn() { + g_dComIfG_gameInfo.play.setMesgBgm(1); +} + +inline void dComIfGp_setMesgBgmOn2() { + g_dComIfG_gameInfo.play.setMesgBgm(2); +} + inline JKRAramBlock* dComIfGp_getPictureBoxData(int i) { return g_dComIfG_gameInfo.play.getPictureBoxData(i); } diff --git a/include/d/d_item.h b/include/d/d_item.h index bb0fe3e78..380a3b49a 100644 --- a/include/d/d_item.h +++ b/include/d/d_item.h @@ -396,4 +396,4 @@ u8 check_itemno(int); u8 getEmonoItemFromLifeBallTable(u16); u8 getItemFromLifeBallTableWithoutEmono(u16); -#endif /* D_ITEM_H */ \ No newline at end of file +#endif /* D_ITEM_H */ diff --git a/include/d/d_item_data.h b/include/d/d_item_data.h index 464ab5df6..0a477a432 100644 --- a/include/d/d_item_data.h +++ b/include/d/d_item_data.h @@ -27,9 +27,9 @@ enum ItemTable { /* 0x14 */ noentry20, // Unused /* 0x15 */ dItem_SMALL_KEY_e, /* 0x16 */ dItem_RECOVER_FAIRY_e, - /* 0x17 */ noentry23, // Unused - /* 0x18 */ noentry24, // Unused - /* 0x19 */ noentry25, // Unused + /* 0x17 */ dItem_HEART_PIECE_2_e, // Not an item, used only for its msg no + /* 0x18 */ dItem_HEART_PIECE_3_e, // Not an item, used only for its msg no + /* 0x19 */ dItem_HEART_PIECE_4_e, // Not an item, used only for its msg no /* 0x1A */ dItem_SUB_DUN_RUPEE_e, // Used in VERSION_JPN only /* 0x1B */ noentry27, // Unused /* 0x1C */ noentry28, // Unused @@ -262,6 +262,8 @@ enum ItemTable { /* 0xFF */ dItem_NONE_e, }; +#define MSG_NO_FOR_ITEM(item_no) item_no + 101 + struct dItem_data_item_resource { /* 0x00 */ char* mArcname; /* 0x04 */ char* mTexture; // Filename in /files/res/Msg/itemicon.arc of its inventory icon. diff --git a/include/d/d_snap.h b/include/d/d_snap.h index 9b0e71913..1a44d128b 100644 --- a/include/d/d_snap.h +++ b/include/d/d_snap.h @@ -199,7 +199,7 @@ enum { /* 0xBF */ DSNAP_TYPE_UNKBF, /* 0xC0 */ DSNAP_TYPE_UNKC0, /* 0xC1 */ DSNAP_TYPE_UNKC1, - /* 0xC2 */ DSNAP_TYPE_UNKC2, + /* 0xC2 */ DSNAP_TYPE_FGANON, /* 0xC3 */ DSNAP_TYPE_UNKC3, /* 0xC4 */ DSNAP_TYPE_UNKC4, /* 0xC5 */ DSNAP_TYPE_UNKC5, diff --git a/include/f_op/f_op_actor.h b/include/f_op/f_op_actor.h index 24d65112f..6a76f7353 100644 --- a/include/f_op/f_op_actor.h +++ b/include/f_op/f_op_actor.h @@ -89,30 +89,30 @@ enum fopAc_AttentionFlag_e { }; enum fopAc_Cull_e { - fopAc_CULLBOX_0_e, - fopAc_CULLBOX_1_e, - fopAc_CULLBOX_2_e, - fopAc_CULLBOX_3_e, - fopAc_CULLBOX_4_e, - fopAc_CULLBOX_5_e, - fopAc_CULLBOX_6_e, - fopAc_CULLBOX_7_e, - fopAc_CULLBOX_8_e, - fopAc_CULLBOX_9_e, - fopAc_CULLBOX_10_e, - fopAc_CULLBOX_11_e, - fopAc_CULLBOX_12_e, - fopAc_CULLBOX_13_e, - fopAc_CULLBOX_CUSTOM_e, - fopAc_CULLSPHERE_0_e, - fopAc_CULLSPHERE_1_e, - fopAc_CULLSPHERE_2_e, - fopAc_CULLSPHERE_3_e, - fopAc_CULLSPHERE_4_e, - fopAc_CULLSPHERE_5_e, - fopAc_CULLSPHERE_6_e, - fopAc_CULLSPHERE_7_e, - fopAc_CULLSPHERE_CUSTOM_e, + /* 0x00 */ fopAc_CULLBOX_0_e, + /* 0x01 */ fopAc_CULLBOX_1_e, + /* 0x02 */ fopAc_CULLBOX_2_e, + /* 0x03 */ fopAc_CULLBOX_3_e, + /* 0x04 */ fopAc_CULLBOX_4_e, + /* 0x05 */ fopAc_CULLBOX_5_e, + /* 0x06 */ fopAc_CULLBOX_6_e, + /* 0x07 */ fopAc_CULLBOX_7_e, + /* 0x08 */ fopAc_CULLBOX_8_e, + /* 0x09 */ fopAc_CULLBOX_9_e, + /* 0x0A */ fopAc_CULLBOX_10_e, + /* 0x0B */ fopAc_CULLBOX_11_e, + /* 0x0C */ fopAc_CULLBOX_12_e, + /* 0x0D */ fopAc_CULLBOX_13_e, + /* 0x0E */ fopAc_CULLBOX_CUSTOM_e, + /* 0x0F */ fopAc_CULLSPHERE_0_e, + /* 0x10 */ fopAc_CULLSPHERE_1_e, + /* 0x11 */ fopAc_CULLSPHERE_2_e, + /* 0x12 */ fopAc_CULLSPHERE_3_e, + /* 0x13 */ fopAc_CULLSPHERE_4_e, + /* 0x14 */ fopAc_CULLSPHERE_5_e, + /* 0x15 */ fopAc_CULLSPHERE_6_e, + /* 0x16 */ fopAc_CULLSPHERE_7_e, + /* 0x17 */ fopAc_CULLSPHERE_CUSTOM_e, }; struct actor_process_profile_definition { diff --git a/src/JSystem/J3DGraphAnimator/J3DCluster.cpp b/src/JSystem/J3DGraphAnimator/J3DCluster.cpp index f8b334791..e1b0289b2 100644 --- a/src/JSystem/J3DGraphAnimator/J3DCluster.cpp +++ b/src/JSystem/J3DGraphAnimator/J3DCluster.cpp @@ -71,7 +71,7 @@ void J3DDeformer::deform(J3DVertexBuffer* vtx, u16 idx) { /* 802F3A08-802F3FA8 .text deform__11J3DDeformerFP15J3DVertexBufferUsPf */ void J3DDeformer::deform(J3DVertexBuffer* vtx, u16 idx, f32* weightList) { /* Nonmatching */ - if (!!(mFlags & 2) && vtx->getVertexData()->getVtxPosType() == GX_F32) { + if (checkFlag(2) && vtx->getVertexData()->getVtxPosType() == GX_F32) { J3DCluster* cluster = mDeformData->getClusterPointer(idx); s32 posNum = cluster->mPosNum; s32 keyNum = cluster->mKeyNum; @@ -105,7 +105,7 @@ void J3DDeformer::deform(J3DVertexBuffer* vtx, u16 idx, f32* weightList) { } } - if (!!(mFlags & 1) && cluster->mFlags != 0 && vtx->getVertexData()->getVtxNrmType() == GX_F32) { + if (checkFlag(1) && cluster->mFlags != 0 && vtx->getVertexData()->getVtxNrmType() == GX_F32) { f32* vtxNrmDst = (f32*)vtx->getVtxNrmArrayPointer(0); f32* vtxNrmSrc = mDeformData->getVtxNrm(); f32* nrmBuf = field_0x0c; @@ -226,7 +226,7 @@ J3DSkinDeform::J3DSkinDeform() { /* 802F40F0-802F44E8 .text initMtxIndexArray__13J3DSkinDeformFP12J3DModelData */ int J3DSkinDeform::initMtxIndexArray(J3DModelData* modelData) { - /* Nonmatching - regalloc */ + /* Nonmatching - operand swap */ if (mPosUseMtx != NULL && mNrmUseMtx != NULL) return J3DErrType_Success; @@ -438,10 +438,10 @@ void J3DSkinDeform::calcNrmMtx(J3DModel* model) { #endif /* 802F4850-802F4974 .text deformVtxPos_F32__13J3DSkinDeformCFP8J3DModel */ void J3DSkinDeform::deformVtxPos_F32(J3DModel* model) const { - /* Nonmatching */ + /* Nonmatching - J3DPSMulMtxVec regalloc */ Mtx* mtxArr[2]; - mtxArr[0] = model->mpNodeMtx; - mtxArr[1] = model->mpWeightEnvMtx; + mtxArr[0] = (Mtx*)model->getAnmMtx(0); + mtxArr[1] = (Mtx*)model->getWeightAnmMtx(0); model->getVertexBuffer()->swapTransformedVtxPos(); s32 vtxNum = model->getModelData()->getVtxNum(); @@ -462,10 +462,10 @@ void J3DSkinDeform::deformVtxPos_F32(J3DModel* model) const { /* 802F4974-802F4AB4 .text deformVtxPos_S16__13J3DSkinDeformCFP8J3DModel */ void J3DSkinDeform::deformVtxPos_S16(J3DModel* model) const { - /* Nonmatching */ + /* Nonmatching - J3DPSMulMtxVec regalloc */ Mtx* mtxArr[2]; - mtxArr[0] = model->mpNodeMtx; - mtxArr[1] = model->mpWeightEnvMtx; + mtxArr[0] = (Mtx*)model->getAnmMtx(0); + mtxArr[1] = (Mtx*)model->getWeightAnmMtx(0); J3DGQRSetup7(model->getModelData()->getVertexData().getVtxPosFrac(), 7, model->getModelData()->getVertexData().getVtxPosFrac(), 7); model->getVertexBuffer()->swapTransformedVtxPos(); @@ -485,7 +485,7 @@ void J3DSkinDeform::deformVtxPos_S16(J3DModel* model) const { /* 802F4AB4-802F4BB8 .text deformVtxNrm_F32__13J3DSkinDeformCFP8J3DModel */ void J3DSkinDeform::deformVtxNrm_F32(J3DModel* model) const { - /* Nonmatching */ + /* Nonmatching - J3DPSMulMtxVec regalloc */ model->getVertexBuffer()->swapTransformedVtxNrm(); s32 vtxNum = model->getModelData()->getNrmNum(); @@ -502,7 +502,7 @@ void J3DSkinDeform::deformVtxNrm_F32(J3DModel* model) const { /* 802F4BB8-802F4CD8 .text deformVtxNrm_S16__13J3DSkinDeformCFP8J3DModel */ void J3DSkinDeform::deformVtxNrm_S16(J3DModel* model) const { - /* Nonmatching */ + /* Nonmatching - J3DPSMulMtxVec regalloc */ J3DGQRSetup7(model->getModelData()->getVertexData().getVtxNrmFrac(), 7, model->getModelData()->getVertexData().getVtxNrmFrac(), 7); model->getVertexBuffer()->swapTransformedVtxNrm(); diff --git a/src/JSystem/J3DGraphAnimator/J3DModel.cpp b/src/JSystem/J3DGraphAnimator/J3DModel.cpp index 06cf9cf8e..a04c223f5 100644 --- a/src/JSystem/J3DGraphAnimator/J3DModel.cpp +++ b/src/JSystem/J3DGraphAnimator/J3DModel.cpp @@ -675,14 +675,12 @@ void J3DModel::calcNrmMtx() { for (u16 i = 0; i < getModelData()->getDrawMtxNum(); i++) { if (getModelData()->getDrawMtxFlag(i) == 0) { if (getScaleFlag(getModelData()->getDrawMtxIndex(i)) == 1) { - Mtx& drawMtx = getDrawMtx(i); - J3DPSMtx33CopyFrom34(drawMtx, getNrmMtx(i)); + setNrmMtx(i, getDrawMtx(i)); } else J3DPSCalcInverseTranspose(getDrawMtx(i), getNrmMtx(i)); } else { if (getEnvScaleFlag(getModelData()->getDrawMtxIndex(i)) == 1) { - Mtx& drawMtx = getDrawMtx(i); - J3DPSMtx33CopyFrom34(drawMtx, getNrmMtx(i)); + setNrmMtx(i, getDrawMtx(i)); } else J3DPSCalcInverseTranspose(getDrawMtx(i), getNrmMtx(i)); } diff --git a/src/JSystem/J3DGraphBase/J3DPacket.cpp b/src/JSystem/J3DGraphBase/J3DPacket.cpp index 9db6d3173..2a12432de 100644 --- a/src/JSystem/J3DGraphBase/J3DPacket.cpp +++ b/src/JSystem/J3DGraphBase/J3DPacket.cpp @@ -375,7 +375,3 @@ bool J3DMatPacket::isSame(J3DMatPacket* pOther) const { } return isSame; } - -/* 802DB978-802DB97C .text draw__9J3DPacketFv */ -void J3DPacket::draw() { -} diff --git a/src/JSystem/J3DGraphBase/J3DShapeMtx.cpp b/src/JSystem/J3DGraphBase/J3DShapeMtx.cpp index a15c01be3..2cc29a0f4 100644 --- a/src/JSystem/J3DGraphBase/J3DShapeMtx.cpp +++ b/src/JSystem/J3DGraphBase/J3DShapeMtx.cpp @@ -141,8 +141,8 @@ Mtx * J3DShapeMtxConcatView::sMtxPtrTbl[2]; /* 802DBFBC-802DC08C .text load__21J3DShapeMtxConcatViewCFv */ void J3DShapeMtxConcatView::load() const { - sMtxPtrTbl[0] = j3dSys.getModel()->mpNodeMtx; - sMtxPtrTbl[1] = j3dSys.getModel()->mpWeightEnvMtx; + sMtxPtrTbl[0] = (Mtx*)j3dSys.getModel()->getAnmMtx(0); + sMtxPtrTbl[1] = (Mtx*)j3dSys.getModel()->getWeightAnmMtx(0); MtxLoadConcatView f = sMtxLoadPipeline[sCurrentPipeline]; j3dSys.setModelDrawMtx(sMtxPtrTbl[j3dSys.getModel()->getModelData()->getDrawMtxFlag(mUseMtxIndex)]); @@ -234,8 +234,8 @@ void J3DShapeMtxMultiImm::load() const { /* 802DC428-802DC524 .text load__26J3DShapeMtxMultiConcatViewCFv */ void J3DShapeMtxMultiConcatView::load() const { - sMtxPtrTbl[0] = j3dSys.getModel()->mpNodeMtx; - sMtxPtrTbl[1] = j3dSys.getModel()->mpWeightEnvMtx; + sMtxPtrTbl[0] = (Mtx*)j3dSys.getModel()->getAnmMtx(0); + sMtxPtrTbl[1] = (Mtx*)j3dSys.getModel()->getWeightAnmMtx(0); MtxLoadConcatView f = sMtxLoadPipeline[sCurrentPipeline]; diff --git a/src/d/actor/d_a_arrow.cpp b/src/d/actor/d_a_arrow.cpp index 4ba85018b..2fffdddc8 100644 --- a/src/d/actor/d_a_arrow.cpp +++ b/src/d/actor/d_a_arrow.cpp @@ -587,7 +587,7 @@ void daArrow_c::setStopActorMatrix() { static cXyz offset_arrow_pos(0.0f, 0.0f, -50.0f); - mDoMtx_stack_c::copy(hitModel->mpNodeMtx[mHitJointIndex]); + mDoMtx_stack_c::copy(hitModel->getAnmMtx(mHitJointIndex)); csXyz hitJointRot; mDoMtx_MtxToRot(mDoMtx_stack_c::get(), &hitJointRot); diff --git a/src/d/actor/d_a_auction.cpp b/src/d/actor/d_a_auction.cpp index cb4f9551a..de39d4dab 100644 --- a/src/d/actor/d_a_auction.cpp +++ b/src/d/actor/d_a_auction.cpp @@ -569,8 +569,14 @@ void daAuction_c::privateCut() { evtRes = eventGetItem(); break; case ACT_GET_ITEM_MES: +#if BUGFIX + evtRes = eventMesSet(); +#elif __MWERKS__ // @bug They probably meant to call this function evtRes = eventMesSet; +#else + evtRes = &daAuction_c::eventMesSet; +#endif break; case ACT_CAMERA_OFF_NPC: evtRes = eventCameraOffNpc(); diff --git a/src/d/actor/d_a_bomb2.cpp b/src/d/actor/d_a_bomb2.cpp index d9c6bd20d..4d19653d0 100644 --- a/src/d/actor/d_a_bomb2.cpp +++ b/src/d/actor/d_a_bomb2.cpp @@ -1288,7 +1288,7 @@ namespace daBomb2 { 1.04f, 1.02f, 1.01f, - 1.0f + 1.0f, }; if(fopAcM_GetModel(this) == 0) { diff --git a/src/d/actor/d_a_bomb3.inc b/src/d/actor/d_a_bomb3.inc index 1598beceb..97c22afd6 100644 --- a/src/d/actor/d_a_bomb3.inc +++ b/src/d/actor/d_a_bomb3.inc @@ -39,7 +39,6 @@ namespace { ATTR_STATE_300 = ATTR_STATE_200 | ATTR_STATE_100 }; - //game has this with global visibility somehow const AttrSt_e L_attrState[] = { ATTR_STATE_A1, ATTR_STATE_1C, @@ -50,7 +49,7 @@ namespace { ATTR_STATE_200, ATTR_STATE_2, ATTR_STATE_21, - ATTR_STATE_0 + ATTR_STATE_0, }; bool chk_attrState(const daBomb_c* i_this, AttrSt_e mask) { diff --git a/src/d/actor/d_a_fganon.cpp b/src/d/actor/d_a_fganon.cpp index 57c6bfe92..6a5e47138 100644 --- a/src/d/actor/d_a_fganon.cpp +++ b/src/d/actor/d_a_fganon.cpp @@ -79,7 +79,7 @@ void tama_draw(fganon_class* i_this) { /* 00000338-00000420 .text daFganon_Draw__FP12fganon_class */ /* Renders all part's of Phantom Ganon's model including his body, sword, and energy ball */ static BOOL daFganon_Draw(fganon_class* i_this) { - dSnap_RegistFig(DSNAP_TYPE_UNKC2, i_this, 1.0f, 1.0f, 1.0f); + dSnap_RegistFig(DSNAP_TYPE_FGANON, i_this, 1.0f, 1.0f, 1.0f); J3DModel* pModel = i_this->mpMorf->getModel(); g_env_light.setLightTevColorType(pModel, &i_this->tevStr); i_this->mpBrkAnm1->entry(pModel->getModelData()); @@ -2501,12 +2501,12 @@ static BOOL daFganon_Execute(fganon_class* i_this) { i_this->m686 = 0; mant_class* cape = (mant_class*)fopAcM_SearchByID(i_this->mCapeID); if (cape != NULL) { - mDoMtx_copy(i_this->mpMorf->mpModel->mpNodeMtx[REG0_S(5) + 20], *calc_mtx); + mDoMtx_copy(i_this->mpMorf->getModel()->getAnmMtx(REG0_S(5) + 20), *calc_mtx); local_70.x = REG0_F(0) + 35.0f; local_70.y = REG0_F(1); local_70.z = REG0_F(2) + -30.0f; MtxPosition(&local_70, &cape->m1BE0); - mDoMtx_copy(i_this->mpMorf->mpModel->mpNodeMtx[REG0_S(6) + 11], *calc_mtx); + mDoMtx_copy(i_this->mpMorf->getModel()->getAnmMtx(REG0_S(6) + 11), *calc_mtx); local_70.x = REG0_F(3) + 35.0f; local_70.y = REG0_F(4); local_70.z = REG0_F(5) + 30.0f; diff --git a/src/d/actor/d_a_ikari.cpp b/src/d/actor/d_a_ikari.cpp index 22b4d515e..63aa63890 100644 --- a/src/d/actor/d_a_ikari.cpp +++ b/src/d/actor/d_a_ikari.cpp @@ -130,7 +130,7 @@ cPhs_State daIkari_c::_create() { f32 mScaleX = scale.x; - fopAcM_SetMtx(this, &mpModel->mBaseTransformMtx[0]); + fopAcM_SetMtx(this, mpModel->getBaseTRMtx()); fopAcM_setCullSizeBox(this, -160.0f * mScaleX, -2500.0f * mScaleX, -600.0f * mScaleX, 160.0f * mScaleX, 100.0f * mScaleX, 600.0f * mScaleX); diff --git a/src/d/actor/d_a_kytag05.cpp b/src/d/actor/d_a_kytag05.cpp index fd9d00490..15bead473 100644 --- a/src/d/actor/d_a_kytag05.cpp +++ b/src/d/actor/d_a_kytag05.cpp @@ -30,7 +30,7 @@ static BOOL daKytag05_Execute(kytag05_class* a_this) { 10, 10, 0, - 90 + 90, }; static const s16 fuu_timer[] = { 150, diff --git a/src/d/actor/d_a_npc_bs1.cpp b/src/d/actor/d_a_npc_bs1.cpp index 2a70914df..9f39c7cdc 100644 --- a/src/d/actor/d_a_npc_bs1.cpp +++ b/src/d/actor/d_a_npc_bs1.cpp @@ -1445,7 +1445,7 @@ void daNpc_Bs1_c::createShopList() { static __shop_items_set_data* Item_set_dataBs2[] = { &shopItems_setData_emptybottle, &shopItems_setData_kakera_heart, - &shopItems_setData_map + &shopItems_setData_map, }; csXyz angle(csXyz::Zero); diff --git a/src/d/actor/d_a_npc_ji1.cpp b/src/d/actor/d_a_npc_ji1.cpp index 548906bb6..09940ab58 100644 --- a/src/d/actor/d_a_npc_ji1.cpp +++ b/src/d/actor/d_a_npc_ji1.cpp @@ -1315,7 +1315,7 @@ s32 daNpc_Ji1_c::getEventActionNo(int staffIdx) { "03_dummy", "04_dummy", "05_dummy", - "06_dummy" + "06_dummy", }; return dComIfGp_evmng_getMyActIdx(staffIdx, ActionNames, ARRAY_SIZE(ActionNames), FALSE, 0); diff --git a/src/d/actor/d_a_npc_nz.cpp b/src/d/actor/d_a_npc_nz.cpp index be1bde6bb..f198a912a 100644 --- a/src/d/actor/d_a_npc_nz.cpp +++ b/src/d/actor/d_a_npc_nz.cpp @@ -577,39 +577,39 @@ u16 daNpc_Nz_c::next_msgStatus(u32* pMsgNo) { static const u32 shop_next_msg_tbl[4][2] = { { 0x33FB, - 0x33FC + 0x33FC, }, { 0x33FD, - 0x33FE + 0x33FE, }, { 0x33FF, - 0x3400 + 0x3400, }, { 0x3401, - 0x3402 - } + 0x3402, + }, }; const u8 itemArr1[4][2] = { { dItem_BIRD_BAIT_5_e, - dItem_HYOI_PEAR_e + dItem_HYOI_PEAR_e, }, { dItem_RED_POTION_e, - dItem_BLUE_POTION_e + dItem_BLUE_POTION_e, }, { dItem_BOMB_10_e, - dItem_BOMB_30_e + dItem_BOMB_30_e, }, { dItem_ARROW_10_e, - dItem_ARROW_30_e - } + dItem_ARROW_30_e, + }, }; int temp = 1; diff --git a/src/d/actor/d_a_npc_people.cpp b/src/d/actor/d_a_npc_people.cpp index 02e549d6d..6b5b330d6 100644 --- a/src/d/actor/d_a_npc_people.cpp +++ b/src/d/actor/d_a_npc_people.cpp @@ -72,7 +72,7 @@ static int l_bck_ix_tbl_uo1[] = { 0x14, 0x04, 0x04, - 0x04 + 0x04, }; static int l_bck_ix_tbl_uo2[] = { @@ -81,7 +81,7 @@ static int l_bck_ix_tbl_uo2[] = { 0x14, 0x00, 0x01, - 0x01 + 0x01, }; static int l_bck_ix_tbl_uo3[] = { @@ -90,7 +90,7 @@ static int l_bck_ix_tbl_uo3[] = { 0x14, 0x12, 0x13, - 0x13 + 0x13, }; static int l_bck_ix_tbl_ub1[] = { @@ -99,7 +99,7 @@ static int l_bck_ix_tbl_ub1[] = { 0x0E, 0x0F, 0x10, - 0x10 + 0x10, }; static int l_bck_ix_tbl_ub2[] = { @@ -108,7 +108,7 @@ static int l_bck_ix_tbl_ub2[] = { 0x0E, 0x0F, 0x10, - 0x10 + 0x10, }; static int l_bck_ix_tbl_ub3[] = { @@ -117,7 +117,7 @@ static int l_bck_ix_tbl_ub3[] = { 0x0E, 0x0F, 0x10, - 0x11 + 0x11, }; static int l_bck_ix_tbl_ub4[] = { @@ -126,7 +126,7 @@ static int l_bck_ix_tbl_ub4[] = { 0x0E, 0x0F, 0x10, - 0x12 + 0x12, }; static int l_bck_ix_tbl_uw1[] = { @@ -135,7 +135,7 @@ static int l_bck_ix_tbl_uw1[] = { 0x06, 0x0B, 0x0C, - 0x0C + 0x0C, }; static int l_bck_ix_tbl_uw2[] = { @@ -144,7 +144,7 @@ static int l_bck_ix_tbl_uw2[] = { 0x07, 0x0D, 0x0F, - 0x0E + 0x0E, }; static int l_bck_ix_tbl_um1[] = { @@ -153,7 +153,7 @@ static int l_bck_ix_tbl_um1[] = { 0x06, 0x0E, 0x0D, - 0x17 + 0x17, }; static int l_bck_ix_tbl_um2[] = { @@ -162,7 +162,7 @@ static int l_bck_ix_tbl_um2[] = { 0x06, 0x0E, 0x0D, - 0x17 + 0x17, }; static int l_bck_ix_tbl_um3[] = { @@ -171,7 +171,7 @@ static int l_bck_ix_tbl_um3[] = { 0x06, 0x14, 0x12, - 0x10 + 0x10, }; static int l_bck_ix_tbl_um3_n[] = { @@ -180,7 +180,7 @@ static int l_bck_ix_tbl_um3_n[] = { 0x06, 0x14, 0x12, - 0x10 + 0x10, }; static int l_bck_ix_tbl_sa1_n[] = { @@ -189,7 +189,7 @@ static int l_bck_ix_tbl_sa1_n[] = { 0x08, 0x0A, 0x17, - 0x16 + 0x16, }; static int l_bck_ix_tbl_sa2[] = { @@ -198,7 +198,7 @@ static int l_bck_ix_tbl_sa2[] = { 0x18, 0x0A, 0x17, - 0x16 + 0x16, }; static int l_bck_ix_tbl_sa3[] = { @@ -207,7 +207,7 @@ static int l_bck_ix_tbl_sa3[] = { 0x08, 0x0A, 0x17, - 0x16 + 0x16, }; static int l_bck_ix_tbl_sa3_n[] = { @@ -216,7 +216,7 @@ static int l_bck_ix_tbl_sa3_n[] = { 0x08, 0x24, 0x17, - 0x16 + 0x16, }; static int l_bck_ix_tbl_sa4[] = { @@ -225,7 +225,7 @@ static int l_bck_ix_tbl_sa4[] = { 0x18, 0x0A, 0x17, - 0x16 + 0x16, }; static int l_bck_ix_tbl_sa4_n[] = { @@ -234,7 +234,7 @@ static int l_bck_ix_tbl_sa4_n[] = { 0x18, 0x0A, 0x17, - 0x16 + 0x16, }; static int l_bck_ix_tbl_sa5[] = { @@ -243,7 +243,7 @@ static int l_bck_ix_tbl_sa5[] = { 0x08, 0x0A, 0x17, - 0x16 + 0x16, }; static int l_bck_ix_tbl_sa5_n[] = { @@ -252,7 +252,7 @@ static int l_bck_ix_tbl_sa5_n[] = { 0x08, 0x23, 0x17, - 0x16 + 0x16, }; static int l_bck_ix_tbl_ug1[] = { @@ -261,7 +261,7 @@ static int l_bck_ix_tbl_ug1[] = { 0x13, 0x11, 0x0E, - 0x0F + 0x0F, }; static int l_bck_ix_tbl_ug2[] = { @@ -270,7 +270,7 @@ static int l_bck_ix_tbl_ug2[] = { 0x13, 0x11, 0x0E, - 0x0F + 0x0F, }; static int* l_bck_ix_tbl[][2] = { @@ -358,7 +358,7 @@ static int l_head_bck_ix_sa[] = { 0x06, 0x09, 0x06, - 0x06 + 0x06, }; static int l_head_bck_ix_sa_n[] = { @@ -367,7 +367,7 @@ static int l_head_bck_ix_sa_n[] = { 0x06, 0x09, 0x06, - 0x06 + 0x06, }; static int l_head_bck_ix_ug[] = { @@ -376,7 +376,7 @@ static int l_head_bck_ix_ug[] = { 0x0D, 0x0B, 0x08, - 0x09 + 0x09, }; static int* l_head_bck_ix_tbl[][2] = { @@ -1123,7 +1123,7 @@ static daNpcPeople_c__l_npc_dat l_npc_dat_uo1 = { 1, 0, 0, - 0 + 0, }; static daNpcPeople_c__l_npc_dat l_npc_dat_uo2 = { @@ -1165,7 +1165,7 @@ static daNpcPeople_c__l_npc_dat l_npc_dat_uo2 = { 1, 0, 0, - 0 + 0, }; static daNpcPeople_c__l_npc_dat l_npc_dat_uo3 = { @@ -1207,7 +1207,7 @@ static daNpcPeople_c__l_npc_dat l_npc_dat_uo3 = { 1, 0, 0, - 0 + 0, }; static daNpcPeople_c__l_npc_dat l_npc_dat_ub1 = { @@ -1249,7 +1249,7 @@ static daNpcPeople_c__l_npc_dat l_npc_dat_ub1 = { 0, 0, 0, - 0 + 0, }; static daNpcPeople_c__l_npc_dat l_npc_dat_ub2 = { @@ -1291,7 +1291,7 @@ static daNpcPeople_c__l_npc_dat l_npc_dat_ub2 = { 0, 0, 0, - 0 + 0, }; static daNpcPeople_c__l_npc_dat l_npc_dat_ub3 = { @@ -1333,7 +1333,7 @@ static daNpcPeople_c__l_npc_dat l_npc_dat_ub3 = { 1, 0, 0, - 0 + 0, }; static daNpcPeople_c__l_npc_dat l_npc_dat_ub4 = { @@ -1375,7 +1375,7 @@ static daNpcPeople_c__l_npc_dat l_npc_dat_ub4 = { 1, 0, 0, - 0 + 0, }; static daNpcPeople_c__l_npc_dat l_npc_dat_uw1 = { @@ -1417,7 +1417,7 @@ static daNpcPeople_c__l_npc_dat l_npc_dat_uw1 = { 1, 0, 0, - 0 + 0, }; static daNpcPeople_c__l_npc_dat l_npc_dat_uw2 = { @@ -1459,7 +1459,7 @@ static daNpcPeople_c__l_npc_dat l_npc_dat_uw2 = { 1, 0, 0, - 0 + 0, }; static daNpcPeople_c__l_npc_dat l_npc_dat_um1 = { @@ -1501,7 +1501,7 @@ static daNpcPeople_c__l_npc_dat l_npc_dat_um1 = { 1, 0, 0, - 0 + 0, }; static daNpcPeople_c__l_npc_dat l_npc_dat_um2 = { @@ -1543,7 +1543,7 @@ static daNpcPeople_c__l_npc_dat l_npc_dat_um2 = { 1, 0, 0, - 0 + 0, }; static daNpcPeople_c__l_npc_dat l_npc_dat_um3 = { @@ -1585,7 +1585,7 @@ static daNpcPeople_c__l_npc_dat l_npc_dat_um3 = { 0, 0, 0, - 0 + 0, }; static daNpcPeople_c__l_npc_dat l_npc_dat_um1_n = { @@ -1627,7 +1627,7 @@ static daNpcPeople_c__l_npc_dat l_npc_dat_um1_n = { 1, 0, 0, - 0 + 0, }; static daNpcPeople_c__l_npc_dat l_npc_dat_um3_n = { @@ -1669,7 +1669,7 @@ static daNpcPeople_c__l_npc_dat l_npc_dat_um3_n = { 0, 0, 0, - 0 + 0, }; static daNpcPeople_c__l_npc_dat l_npc_dat_sa1 = { @@ -1711,7 +1711,7 @@ static daNpcPeople_c__l_npc_dat l_npc_dat_sa1 = { 1, 0, 0, - 0 + 0, }; static daNpcPeople_c__l_npc_dat l_npc_dat_sa2 = { @@ -1753,7 +1753,7 @@ static daNpcPeople_c__l_npc_dat l_npc_dat_sa2 = { 1, 0, 0, - 0 + 0, }; static daNpcPeople_c__l_npc_dat l_npc_dat_sa3 = { @@ -1795,7 +1795,7 @@ static daNpcPeople_c__l_npc_dat l_npc_dat_sa3 = { 1, 0, 0, - 0 + 0, }; static daNpcPeople_c__l_npc_dat l_npc_dat_sa4 = { @@ -1837,7 +1837,7 @@ static daNpcPeople_c__l_npc_dat l_npc_dat_sa4 = { 1, 0, 0, - 0 + 0, }; static daNpcPeople_c__l_npc_dat l_npc_dat_sa5 = { @@ -1879,7 +1879,7 @@ static daNpcPeople_c__l_npc_dat l_npc_dat_sa5 = { 1, 0, 0, - 0 + 0, }; static daNpcPeople_c__l_npc_dat l_npc_dat_sa1_n = { @@ -1921,7 +1921,7 @@ static daNpcPeople_c__l_npc_dat l_npc_dat_sa1_n = { 1, 0, 0, - 0 + 0, }; static daNpcPeople_c__l_npc_dat l_npc_dat_sa3_n = { @@ -1963,7 +1963,7 @@ static daNpcPeople_c__l_npc_dat l_npc_dat_sa3_n = { 1, 0, 0, - 0 + 0, }; static daNpcPeople_c__l_npc_dat l_npc_dat_sa4_n = { @@ -2005,7 +2005,7 @@ static daNpcPeople_c__l_npc_dat l_npc_dat_sa4_n = { 1, 0, 0, - 0 + 0, }; static daNpcPeople_c__l_npc_dat l_npc_dat_sa5_n = { @@ -2047,7 +2047,7 @@ static daNpcPeople_c__l_npc_dat l_npc_dat_sa5_n = { 1, 0, 0, - 0 + 0, }; static daNpcPeople_c__l_npc_dat l_npc_dat_ug1 = { @@ -2089,7 +2089,7 @@ static daNpcPeople_c__l_npc_dat l_npc_dat_ug1 = { 1, 0, 0, - 0 + 0, }; static daNpcPeople_c__l_npc_dat l_npc_dat_ug2 = { @@ -2131,7 +2131,7 @@ static daNpcPeople_c__l_npc_dat l_npc_dat_ug2 = { 1, 0, 0, - 0 + 0, }; static daNpcPeople_c__l_npc_dat* l_npc_dat[][2] = { @@ -4057,7 +4057,7 @@ static const u8 l_photo_no[] = { /* 00000078-00000274 .text __ct__13daNpcPeople_cFv */ daNpcPeople_c::daNpcPeople_c() { mNpcType = getPrmNpcNo(); - m790 = 0; + mResFlag = 0; m78F = 0; m740 = 0.0f; m76E = 0; @@ -4070,7 +4070,7 @@ daNpcPeople_c::daNpcPeople_c() { m793 = 0; m760 = 0; m794 = 0; - m758 = 0; + mEtcFlag = 0; m7A1 = 0; mbIsNight = dKy_daynight_check() & 0x1; // this is weird but it generates the clrlwi mpNpcDat = l_npc_dat[mNpcType][mbIsNight]; @@ -4187,7 +4187,7 @@ cPhs_State daNpcPeople_c::_create() { static cPhs__Handler l_method[] = { (cPhs__Handler)phase_1, (cPhs__Handler)phase_2, - NULL + NULL, }; return dComLbG_PhaseHandler(&mPhs2, l_method, this); @@ -4344,7 +4344,7 @@ cPhs_State daNpcPeople_c::createInit() { m766[1] = dComIfGp_evmng_getEventIdx("UM3_GET_ITEM"); if(mbIsNight) { - m758 |= 0x40000000; + mEtcFlag |= 0x40000000; } break; @@ -4370,7 +4370,7 @@ cPhs_State daNpcPeople_c::createInit() { } case 0xF: if(mbIsNight) { - m758 |= 0x40000000; + mEtcFlag |= 0x40000000; } break; @@ -4379,7 +4379,7 @@ cPhs_State daNpcPeople_c::createInit() { if(getPrmArg0() == 0) { temp = 0x50; m76E = 1; - m758 = 0x1000; + mEtcFlag = 0x1000; } m766[0] = dComIfGp_evmng_getEventIdx("UG1_TALK"); @@ -4467,7 +4467,7 @@ bool daNpcPeople_c::_draw() { /* Nonmatching - regalloc */ J3DModel* pModel1 = mpMorf->getModel(); - J3DModel* pModel2 = m6D4; + J3DModel* pModel2; if(m6D4) { pModel2 = m6D4; } @@ -4504,7 +4504,7 @@ bool daNpcPeople_c::_draw() { mBtpAnm.remove(modelData); } - if(m6D8 && (m758 & 0x40000001)) { + if(m6D8 && (mEtcFlag & 0x40000001)) { g_env_light.setLightTevColorType(m6D8, &tevStr); m6D8->setBaseTRMtx(pModel1->getAnmMtx(m7A3)); mDoExt_modelUpdateDL(m6D8); @@ -4614,8 +4614,8 @@ bool daNpcPeople_c::_execute() { if(!mbIsNight) { switch(mNpcType) { case 0x3: - if(m795 & 0x3) { - m795 &= ~0x3; + if(mAnmFlag & 0x3) { + mAnmFlag &= ~0x3; u8 rand = getRand(8); if(rand == m794) { rand = 0; @@ -4627,8 +4627,8 @@ bool daNpcPeople_c::_execute() { break; case 0x4: - if(m795 & 0x3) { - m795 &= ~0x3; + if(mAnmFlag & 0x3) { + mAnmFlag &= ~0x3; u8 rand = getRand(8); if(rand == m794) { rand = 0; @@ -4640,8 +4640,8 @@ bool daNpcPeople_c::_execute() { break; case 0xB: - if(!dComIfGs_checkGetItem(dItem_COLLECT_MAP_15_e) && (m795 & 0x3)) { - m795 &= ~0x3; + if(!dComIfGs_checkGetItem(dItem_COLLECT_MAP_15_e) && (mAnmFlag & 0x3)) { + mAnmFlag &= ~0x3; u8 rand = getRand(8); if(rand == m794) { rand = 0; @@ -4657,8 +4657,8 @@ bool daNpcPeople_c::_execute() { else { switch(mNpcType) { case 0xE: - if(m795 & 0x3) { - m795 &= ~0x3; + if(mAnmFlag & 0x3) { + mAnmFlag &= ~0x3; u8 rand; if(m794 == 3) { rand = 0; @@ -4680,8 +4680,8 @@ bool daNpcPeople_c::_execute() { break; case 0x10: - if(m795 & 0x3) { - m795 &= ~0x3; + if(mAnmFlag & 0x3) { + mAnmFlag &= ~0x3; u8 rand; if(m794 == 3) { rand = 0; @@ -4774,16 +4774,16 @@ bool daNpcPeople_c::executeCommon() { executeSetMode(4); return true; } - if((m758 & 0x10) && !(m758 & 0x20)) { + if((mEtcFlag & 0x10) && !(mEtcFlag & 0x20)) { executeSetMode(9); return true; } - if((m758 & 0x4000) && m78F != 0xD) { + if((mEtcFlag & 0x4000) && m78F != 0xD) { executeSetMode(0xD); return true; } - if(m758 & 0x20000) { - m758 &= ~0x20000; + if(mEtcFlag & 0x20000) { + mEtcFlag &= ~0x20000; executeSetMode(0xB); return true; } @@ -4839,7 +4839,7 @@ void daNpcPeople_c::executeWait() { } else { m748 = mpNpcDat->field_0x28; - m758 &= ~0x80000700; + mEtcFlag &= ~0x80000700; } if(m789) { @@ -4848,19 +4848,19 @@ void daNpcPeople_c::executeWait() { } else if(dComIfGp_checkPlayerStatus0(0, daPyStts0_TELESCOPE_LOOK_e)) { dComIfGp_setScopeType(1); - if(dKy_moon_look_chk() && !(m758 & 0x100)) { + if(dKy_moon_look_chk() && !(mEtcFlag & 0x100)) { dComIfGs_onEventBit(0x2308); - m758 |= 0x100; + mEtcFlag |= 0x100; m7A7 = 0; m78D = 0xB; } - else if(dKy_orion_look_chk() && !(m758 & 0x200)) { - m758 |= 0x200; + else if(dKy_orion_look_chk() && !(mEtcFlag & 0x200)) { + mEtcFlag |= 0x200; m7A7 = 1; m78D = 0xB; } - else if(dKy_hokuto_look_chk() && !(m758 & 0x400)) { - m758 |= 0x400; + else if(dKy_hokuto_look_chk() && !(mEtcFlag & 0x400)) { + mEtcFlag |= 0x400; m7A7 = 2; m78D = 0xB; } @@ -4874,7 +4874,7 @@ void daNpcPeople_c::executeWait() { break; case 0x11: case 0x12: - if((m758 & 0x1000) && m76E != 0) { + if((mEtcFlag & 0x1000) && m76E != 0) { m76E--; if(m76E == 0) { executeSetMode(0xB); @@ -4906,10 +4906,10 @@ void daNpcPeople_c::executeTalk() { executeCommon(); if(!dComIfGp_event_chkTalkXY() || dComIfGp_evmng_ChkPresentEnd()) { - m758 &= ~0x200000; + mEtcFlag &= ~0x200000; if(talk2(1, this) == fopMsgStts_BOX_CLOSED_e) { m788 = 0; - m758 &= ~0x1; + mEtcFlag &= ~0x1; executeSetMode(0); if(m77E & 0x1) { @@ -4947,8 +4947,8 @@ void daNpcPeople_c::executeTalk() { } } - if(m758 & 0x100000) { - m758 &= ~0x100000; + if(mEtcFlag & 0x100000) { + mEtcFlag &= ~0x100000; dComIfGp_startItemTimer(); } } @@ -4957,7 +4957,7 @@ void daNpcPeople_c::executeTalk() { /* 00002718-000027D8 .text executeWalkInit__13daNpcPeople_cFv */ s32 daNpcPeople_c::executeWalkInit() { - m758 &= ~0x00400008; + mEtcFlag &= ~0x00400008; setAnmTbl(l_npc_anm_walk, 1); m76E = mpNpcDat->field_0x54 + cM_rndF(mpNpcDat->field_0x56 - mpNpcDat->field_0x54); @@ -5002,12 +5002,12 @@ void daNpcPeople_c::executeWalk() { } } else if(mNpcType != 2 || !mPathRun.mbGoingForwards) { - m758 |= 4; + mEtcFlag |= 4; mPathRun.mbGoingForwards ^= 1; executeSetMode(0); } else { - m758 &= ~0x4; + mEtcFlag &= ~0x4; executeSetMode(6); } } @@ -5019,7 +5019,7 @@ s32 daNpcPeople_c::executeTurnInit() { cXyz point = mPathRun.getPoint(mPathRun.mCurrPointIndex); s16 angle; dNpc_calc_DisXZ_AngY(current.pos, point, NULL, &angle); - if(angle == current.angle.y && (m758 & 8) == 0) { + if(angle == current.angle.y && (mEtcFlag & 8) == 0) { setAnmTbl(l_npc_anm_walk, 1); m76E = mpNpcDat->field_0x54 + cM_rndF(mpNpcDat->field_0x56 - mpNpcDat->field_0x54); @@ -5033,7 +5033,7 @@ s32 daNpcPeople_c::executeTurnInit() { void daNpcPeople_c::executeTurn() { if(!executeCommon()) { s16 temp; - if(m758 & 0x400008) { + if(mEtcFlag & 0x400008) { temp = m77A; } else { @@ -5046,10 +5046,10 @@ void daNpcPeople_c::executeTurn() { m799 = 2; m_jnt.setTrn(); if(current.angle.y == temp) { - if(m758 & 0x400000) { + if(mEtcFlag & 0x400000) { executeSetMode(2); } - else if(m758 & 8) { + else if(mEtcFlag & 8) { executeSetMode(7); } else { @@ -5133,7 +5133,7 @@ s32 daNpcPeople_c::executeKyoroInit() { m79D = 0; m79E = 0; - m758 &= ~0x00000008; + mEtcFlag &= ~0x00000008; setAnmTbl(l_npc_anm_kyoro, 1); return 6; @@ -5142,8 +5142,8 @@ s32 daNpcPeople_c::executeKyoroInit() { /* 00002F80-0000301C .text executeKyoro__13daNpcPeople_cFv */ void daNpcPeople_c::executeKyoro() { if(executeCommon() == false) { - if(m795 & 1) { - m758 |= 8; + if(mAnmFlag & 1) { + mEtcFlag |= 8; if(m78A || m789) { m79D = 1; m79E = 1; @@ -5165,7 +5165,7 @@ s32 daNpcPeople_c::executeLetterInit() { m79D = 0; m79E = 0; setAnmTbl(l_npc_anm_letter, 1); - m758 &= ~0x00400000; + mEtcFlag &= ~0x00400000; return 7; } @@ -5175,16 +5175,16 @@ void daNpcPeople_c::executeLetter() { if(!executeCommon()) { int frame = mpMorf->getFrame(); if(frame < 0x23 || frame > 0x45) { - m758 &= ~0x1; + mEtcFlag &= ~0x1; } else { - m758 |= 1; + mEtcFlag |= 1; m7A6 = 1; } - if(m795 & 1) { - m758 |= 0x400002; - m758 &= ~0x8; + if(mAnmFlag & 1) { + mEtcFlag |= 0x400002; + mEtcFlag &= ~0x8; m79D = 1; m79E = 1; mPathRun.mbGoingForwards ^= 0x1; @@ -5193,7 +5193,7 @@ void daNpcPeople_c::executeLetter() { } } else { - m758 |= 1; + mEtcFlag |= 1; m79D = 1; m79E = 1; } @@ -5249,7 +5249,7 @@ s32 daNpcPeople_c::executeLook2Init() { m79D = 0; m79E = 0; setAnmTbl(l_npc_anm_wait, 1); - m758 |= 0x20; + mEtcFlag |= 0x20; return 9; } @@ -5257,7 +5257,7 @@ s32 daNpcPeople_c::executeLook2Init() { /* 00003314-00003408 .text executeLook2__13daNpcPeople_cFv */ void daNpcPeople_c::executeLook2() { if(!executeCommon()) { - if(m758 & 0x10) { + if(mEtcFlag & 0x10) { fopAc_ac_c* pActor = fopAcM_searchFromName(l_npc_staff_id[10], 0, 0); if(pActor) { mLookAtPos = pActor->eyePos; @@ -5269,7 +5269,7 @@ void daNpcPeople_c::executeLook2() { m748 = mpNpcDat->field_0x28; m79D = 1; m79E = 1; - m758 &= ~0x20; + mEtcFlag &= ~0x20; executeSetMode(0); } @@ -5280,10 +5280,10 @@ void daNpcPeople_c::executeLook2() { m748 = mpNpcDat->field_0x28; m79D = 1; m79E = 1; - m758 &= ~0x20; + mEtcFlag &= ~0x20; } - m758 &= ~0x10; + mEtcFlag &= ~0x10; } /* 00003408-00003438 .text executeUgWalkInit__13daNpcPeople_cFv */ @@ -5304,28 +5304,28 @@ void daNpcPeople_c::executeUgWalk() { f32 temp2 = diff.abs(); if(temp < 30.0f) { - if(m758 & 0x10000) { - m758 &= ~0x10000; + if(mEtcFlag & 0x10000) { + mEtcFlag &= ~0x10000; m71C = getDirDistToPos(getRand(0x10000), cM_rndF(180.0f)) + home.pos; } else { - if((mNpcType != 0x12 && (getRand(100) < 0x19 && !(m758 & 0x8000))) || (m758 & 0x2000)) { - m758 &= ~0x2000; + if((mNpcType != 0x12 && (getRand(100) < 0x19 && !(mEtcFlag & 0x8000))) || (mEtcFlag & 0x2000)) { + mEtcFlag &= ~0x2000; executeSetMode(0xC); } else if(getRand(100) < 0x19) { executeSetMode(0xE); } else { - m758 &= ~0x8000; + mEtcFlag &= ~0x8000; executeSetMode(0); } } } else { if(temp2 < 180.0f) { - if(m758 & 0x10000) { - m758 &= ~0x10000; + if(mEtcFlag & 0x10000) { + mEtcFlag &= ~0x10000; m71C = getDirDistToPos(getRand(0x10000), cM_rndF(180.0f)) + home.pos; } @@ -5335,7 +5335,7 @@ void daNpcPeople_c::executeUgWalk() { u8 type = pActor->getNpcNo(); if((mNpcType == 0x11 && type == 0x12) || (mNpcType == 0x12 && type == 0x11)) { pActor->setEtcFlag(0x60000); - m758 |= 0x42000; + mEtcFlag |= 0x42000; executeSetMode(0xB); } } @@ -5361,7 +5361,7 @@ void daNpcPeople_c::executeUgWalk() { } m71C = getDirDistToPos(angle1, 50.0f) + current.pos; - m758 |= 0x10000; + mEtcFlag |= 0x10000; } } } @@ -5391,8 +5391,8 @@ void daNpcPeople_c::executeUgWalk() { s32 daNpcPeople_c::executeUgTurnInit() { s16 angle; - if(m758 & 0x40000) { - m758 &= ~0x40000; + if(mEtcFlag & 0x40000) { + mEtcFlag &= ~0x40000; fopAc_ac_c* pActor; if(mNpcType == 0x11) { @@ -5470,7 +5470,7 @@ void daNpcPeople_c::executeUgLook() { s32 daNpcPeople_c::executeUgLook2Init() { m76E = 0x78; setAnmTbl(l_npc_anm_wait, 1); - m758 &= ~0x00004000; + mEtcFlag &= ~0x00004000; return 0xD; } @@ -5491,7 +5491,7 @@ void daNpcPeople_c::executeUgLook2() { } } - m758 &= ~0x10; + mEtcFlag &= ~0x10; } /* 00003EE4-00003F38 .text executeUgSitInit__13daNpcPeople_cFv */ @@ -5499,7 +5499,7 @@ s32 daNpcPeople_c::executeUgSitInit() { setAnmTbl(l_npc_anm_sit_ug, 1); m79D = 0; m79E = 0; - m758 |= 0x00080000; + mEtcFlag |= 0x00080000; return 0xE; } @@ -5507,10 +5507,10 @@ s32 daNpcPeople_c::executeUgSitInit() { /* 00003F38-00003FC0 .text executeUgSit__13daNpcPeople_cFv */ void daNpcPeople_c::executeUgSit() { if(!executeCommon()) { - if(m795 & 1) { + if(mAnmFlag & 1) { m79D = 1; m79E = 1; - m758 &= ~0x00080000; + mEtcFlag &= ~0x00080000; setAnmTbl(l_npc_anm_wait, 1); executeSetMode(0xB); } @@ -5583,7 +5583,7 @@ void daNpcPeople_c::eventOrder() { m79F = mpNpcDat->field_0x5C; m778 = mpNpcDat->field_0x36; m788 = 0; - m795 |= 2; + mAnmFlag |= 2; dComIfGp_event_reset(); if(mNpcType == 8) { m77A = home.angle.y; @@ -5636,7 +5636,7 @@ void daNpcPeople_c::eventMove() { } } else { - m758 &= ~0x00200000; + mEtcFlag &= ~0x00200000; privateCut(); } } @@ -5780,12 +5780,12 @@ void daNpcPeople_c::eventMesSetInit(int staffIdx) { break; case 0x358C: if(mCurrMsgNo != 0x358D) { - m758 |= 0x800; + mEtcFlag |= 0x800; } break; case 0x3594: - m758 |= 0x800; + mEtcFlag |= 0x800; dComIfGs_onTmpBit(0x208); if(!dComIfGs_checkGetItem(NORMAL_SAIL)) { @@ -5804,14 +5804,14 @@ void daNpcPeople_c::eventMesSetInit(int staffIdx) { setMessage(0x3598); } else { - m758 &= ~0x800; + mEtcFlag &= ~0x800; dComIfGs_onEventBit(0x2B04); setMessage(0x3599); } break; case 0x359A: - m758 |= 0x800; + mEtcFlag |= 0x800; default: setMessage(*pMsgNo); } @@ -6016,7 +6016,7 @@ bool daNpcPeople_c::eventUb2Talk() { } } - m758 |= 0x200000; + mEtcFlag |= 0x200000; return 0; } @@ -6025,15 +6025,15 @@ bool daNpcPeople_c::eventUb2Talk() { bool daNpcPeople_c::eventUbSetAnm() { switch(mNpcType) { case 0x3: - if(m795 & 3) { - m795 &= ~0x3; + if(mAnmFlag & 3) { + mAnmFlag &= ~0x3; setAnmTbl(l_npc_anm_ub1_tbl[getRand(8)], 1); } break; case 0x4: - if(m795 & 3) { - m795 &= ~0x3; + if(mAnmFlag & 3) { + mAnmFlag &= ~0x3; setAnmTbl(l_npc_anm_ub2_tbl[getRand(8)], 1); } @@ -6172,8 +6172,8 @@ u16 daNpcPeople_c::talk2(int param_1, fopAc_ac_c* param_2) { break; case fopMsgStts_BOX_CLOSED_e: - if(m758 & 0x800) { - m758 &= ~0x800; + if(mEtcFlag & 0x800) { + mEtcFlag &= ~0x800; initUgSearchArea(); dComIfGp_event_reset(); } @@ -6202,7 +6202,7 @@ u16 daNpcPeople_c::talk2(int param_1, fopAc_ac_c* param_2) { } } - if(!(m758 & 0x200000)) { + if(!(mEtcFlag & 0x200000)) { setAnmFromMsgTag(); } @@ -6446,7 +6446,7 @@ u16 daNpcPeople_c::next_msgStatus(u32* pMsgNo) { dComIfGp_resetItemTimer(0xE10); } - m758 |= 0x100000; + mEtcFlag |= 0x100000; } else { m734 = l_msg_sa5_no; @@ -6464,7 +6464,7 @@ u16 daNpcPeople_c::next_msgStatus(u32* pMsgNo) { m734 = l_msg_xy_sa5_yes; dComIfGp_setItemBeastNumCount(0x0, -3); dComIfGp_resetItemTimer(0xE10); - m758 |= 0x100000; + mEtcFlag |= 0x100000; } } else { @@ -6693,7 +6693,7 @@ u32 daNpcPeople_c::getMsg() { break; case 2: - if(m793 == 3 || (m758 & 0x8)) { + if(m793 == 3 || (mEtcFlag & 0x8)) { m734 = l_msg_uo3_kyoro; } else if(m793 == 4) { @@ -6703,10 +6703,10 @@ u32 daNpcPeople_c::getMsg() { dComIfGs_onEventBit(0x1E08); m734 = l_msg_uo3_1st_talk; } - else if(!(m758 & 0x2)) { + else if(!(mEtcFlag & 0x2)) { m734 = l_msg_uo3_befor_letter; } - else if((m758 & 0x4)) { + else if((mEtcFlag & 0x4)) { m734 = l_msg_uo3_retry_letter; } else { @@ -6739,7 +6739,7 @@ u32 daNpcPeople_c::getMsg() { break; case 6: - if(m758 & 0x40) { + if(mEtcFlag & 0x40) { m734 = l_msg_ub4_photo_house; } else if(!dComIfGs_isEventBit(0x1D10)) { @@ -7000,8 +7000,8 @@ u32 daNpcPeople_c::getMsg() { msgNo = 0x3299; } else if(!mbIsNight) { - if(m758 & 0x80) { - m758 &= ~0x80; + if(mEtcFlag & 0x80) { + mEtcFlag &= ~0x80; if(!dComIfGs_isEventBit(0x2680)) { m734 = l_msg_sa5__next_day; } @@ -7617,7 +7617,7 @@ void daNpcPeople_c::playAnm() { if(m796 == 0) { m728 += 1; if(setAnmTbl(m728, 1)) { - m795 |= 1; + mAnmFlag |= 1; } } else { @@ -7689,7 +7689,7 @@ bool daNpcPeople_c::setAnmTbl(sPeopleAnmDat* param_1, int param_2) { } } - m795 &= ~0x1; + mAnmFlag &= ~0x1; if(param_1->field_0x00 == 0xFF && param_2 != 0) { m728 = NULL; return true; @@ -7761,7 +7761,7 @@ s16 daNpcPeople_c::XyCheckCB(int i_itemBtn) { break; case 0x6: - if(!(m758 & 0x40) && isPhoto(itemNo)) { + if(!(mEtcFlag & 0x40) && isPhoto(itemNo)) { return true; } @@ -7979,8 +7979,8 @@ BOOL daNpcPeople_c::chkEndEvent() { break; case 0x10: if(dComIfGp_evmng_endCheck(m766[0]) || dComIfGp_evmng_endCheck(m766[1])) { - if(m758 & 0x100000) { - m758 &= ~0x100000; + if(mEtcFlag & 0x100000) { + mEtcFlag &= ~0x100000; dComIfGp_startItemTimer(); } @@ -8120,7 +8120,7 @@ BOOL daNpcPeople_c::checkPig() { if(temp < 400.0f && std::abs(current.pos.y - pPig->current.pos.y) <= 10.0f) { pPig->taura_pos_set(current.pos); m78D = 2; - m758 |= 0x80; + mEtcFlag |= 0x80; dComIfGs_setTmpReg(0xFC03, i); u8 reg = dComIfGs_getTmpReg(0xFD07); reg |= 1 << i; @@ -8172,7 +8172,7 @@ void daNpcPeople_c::initUgSearchArea() { pActor->m788 = 0; pActor->m78C = 1; pActor->m78D = 0; - pActor->m795 |= 2; + pActor->setAnmFlag(2); pActor->m79D = 1; pActor->m79E = 1; pActor->m748 = mpNpcDat->field_0x28; diff --git a/src/d/actor/d_a_obj_ebomzo.cpp b/src/d/actor/d_a_obj_ebomzo.cpp index 6f8d10acd..d68a9d709 100644 --- a/src/d/actor/d_a_obj_ebomzo.cpp +++ b/src/d/actor/d_a_obj_ebomzo.cpp @@ -115,7 +115,7 @@ void daObjEbomzo::Act_c::set_mtx() { /* 0000062C-00000668 .text init_mtx__Q211daObjEbomzo5Act_cFv */ void daObjEbomzo::Act_c::init_mtx() { - mpModel->mBaseScale = scale; + mpModel->setBaseScale(scale); set_mtx(); } diff --git a/src/d/actor/d_a_obj_figure.cpp b/src/d/actor/d_a_obj_figure.cpp index 73c05add7..b7f956e28 100644 --- a/src/d/actor/d_a_obj_figure.cpp +++ b/src/d/actor/d_a_obj_figure.cpp @@ -4,6 +4,8 @@ // #include "d/actor/d_a_obj_figure.h" +#include "d/res/res_figure.h" +#include "d/res/res_figure2.h" #include "f_op/f_op_actor_mng.h" #include "d/d_com_inf_game.h" #include "d/d_com_lib_game.h" @@ -947,7 +949,7 @@ BOOL daObjFigure_c::createHeap() { } if(mFigureNo == 0x3D) { - J3DAnmTevRegKey* pBrkData = static_cast(dComIfG_getObjectIDRes(arcname, 7)); + J3DAnmTevRegKey* pBrkData = static_cast(dComIfG_getObjectIDRes(arcname, FIGURE2_BDL_VF_047)); if(pBrkData == NULL) { return false; } @@ -962,11 +964,11 @@ BOOL daObjFigure_c::createHeap() { } } if(mFigureNo == 0x40) { - J3DModelData* p1 = (J3DModelData*)dComIfG_getObjectIDRes(arcname, 4); + J3DModelData* p1 = (J3DModelData*)dComIfG_getObjectIDRes(arcname, FIGURE2_BDL_VF_044); mpMorf = new mDoExt_McaMorf( p1, NULL, NULL, - (J3DAnmTransformKey*)dComIfG_getObjectIDRes(arcname, 0), + (J3DAnmTransformKey*)dComIfG_getObjectIDRes(arcname, FIGURE2_BCK_VF_064L), J3DFrameCtrl::EMode_LOOP, 1.0f, 0, -1, 1, NULL, 0x80000, @@ -987,7 +989,7 @@ BOOL daObjFigure_c::createHeap() { } } - J3DModelData* pPedestalData = static_cast(dComIfG_getObjectIDRes("Figure", 1)); + J3DModelData* pPedestalData = static_cast(dComIfG_getObjectIDRes("Figure", FIGURE_BDL_VF_BS)); if(pPedestalData == NULL) { return false; } @@ -997,7 +999,7 @@ BOOL daObjFigure_c::createHeap() { return false; } - mpPedestalBtp = static_cast(dComIfG_getObjectIDRes("Figure", 2)); + mpPedestalBtp = static_cast(dComIfG_getObjectIDRes("Figure", FIGURE_BTP_VF_BS)); if(mpPedestalBtp == NULL) { return false; } diff --git a/src/d/actor/d_a_obj_monument.cpp b/src/d/actor/d_a_obj_monument.cpp index 4be1cd3f2..8a44064b9 100644 --- a/src/d/actor/d_a_obj_monument.cpp +++ b/src/d/actor/d_a_obj_monument.cpp @@ -15,7 +15,7 @@ namespace daObjMonument { namespace { - static Attr_c L_attr[2] = { + static Attr_c L_attr[] = { { ESEKH_BDL_ESEKH, ESEKH_DZB_ESEKH }, { ESEKH_BDL_ESEKH2, ESEKH_DZB_ESEKH2 }, }; diff --git a/src/d/actor/d_a_obj_movebox.cpp b/src/d/actor/d_a_obj_movebox.cpp index dcefdf6d1..2fe3d996d 100644 --- a/src/d/actor/d_a_obj_movebox.cpp +++ b/src/d/actor/d_a_obj_movebox.cpp @@ -339,7 +339,7 @@ namespace daObjMovebox { }, }; - const Attr_c Act_c::M_attr[13] = { + const Attr_c Act_c::M_attr[] = { // TYPE_BREAKABLE_WOODEN_CRATE // Arcname: Kkiba_00 { @@ -1123,7 +1123,7 @@ namespace daObjMovebox { /* 00001674-000016B8 .text init_mtx__Q212daObjMovebox5Act_cFv */ void Act_c::init_mtx() { if (mpModel) { - mpModel->mBaseScale = scale; + mpModel->setBaseScale(scale); } set_mtx(); } diff --git a/src/d/actor/d_a_obj_paper.cpp b/src/d/actor/d_a_obj_paper.cpp index bb5fe8cce..ab59c6c9f 100644 --- a/src/d/actor/d_a_obj_paper.cpp +++ b/src/d/actor/d_a_obj_paper.cpp @@ -39,7 +39,7 @@ namespace daObjPaper { /* 0x16 */ s16 mColCylinderHeight; }; - static const Attr_c L_attr[3] = { + static const Attr_c L_attr[] = { { /* mResName */ "Opaper", /* mHeapSize */ 0x04C0, diff --git a/src/d/actor/d_a_obj_smplbg.cpp b/src/d/actor/d_a_obj_smplbg.cpp index 09714c4ad..53eee52bf 100644 --- a/src/d/actor/d_a_obj_smplbg.cpp +++ b/src/d/actor/d_a_obj_smplbg.cpp @@ -7,23 +7,25 @@ #include "d/d_procname.h" #include "d/d_com_inf_game.h" #include "d/res/res_qtkhd.h" -const daObjSmplbg::Act_c::Attr_c daObjSmplbg::Act_c::M_attr[1] = { - /* mHeapSize */ 0x000015E0, - /* mResName */ "Qtkhd", + +const daObjSmplbg::Act_c::Attr_c daObjSmplbg::Act_c::M_attr[] = { + /* mHeapSize */ 0x15E0, + /* mResName */ "Qtkhd", /* mBDLFileIndex */ QTKHD_BDL_QTKHD, /* mDZBFileIndex */ QTKHD_DZB_QTKHD, - /* mMoveBGProc */ dBgS_MoveBGProc_TypicalRotY, - /* mFlags */ 13, - /* mCullMinX */ 0, - /* mCullMinY */ 2250, - /* mCullMinZ */ 0, - /* mCullMaxX */ 750, - /* mCullMaxY */ 0, - /* mCullMaxZ */ 0, - /* mEyeOffset */ 1687.0f + /* mMoveBGProc */ dBgS_MoveBGProc_TypicalRotY, + /* mFlags */ 1 | 4 | 8, + /* mCullMinX */ 0, + /* mCullMinY */ 2250, + /* mCullMinZ */ 0, + /* mCullMaxX */ 750, + /* mCullMaxY */ 0, + /* mCullMaxZ */ 0, + /* mEyeOffset */ 1687.0f }; Mtx daObjSmplbg::Act_c::M_tmp_mtx; + /* 00000078-00000144 .text CreateHeap__Q211daObjSmplbg5Act_cFv */ BOOL daObjSmplbg::Act_c::CreateHeap() { J3DModelData* model_data = (J3DModelData*)dComIfG_getObjectRes(attr().mResName, attr().mBDLFileIndex); @@ -39,15 +41,14 @@ BOOL daObjSmplbg::Act_c::Create() { init_mtx(); eyePos.y += attr().mEyeOffset; - if(((attr().mFlags) & 8) != 0){ + if(cLib_checkBit(attr().mFlags, 8)){ fopAcM_OffStatus(this, fopAcStts_NOCULLEXEC_e); } - if(((attr().mFlags) & 4) != 0){ - cullType = 23; + if(cLib_checkBit(attr().mFlags, 4)){ + fopAcM_SetCullSize(this, fopAc_CULLSPHERE_CUSTOM_e); fopAcM_setCullSizeSphere(this, attr().mCullMinX, attr().mCullMinY, attr().mCullMinZ, attr().mCullMaxX); - } else{ - cullType = 14; + fopAcM_SetCullSize(this, fopAc_CULLBOX_CUSTOM_e); fopAcM_setCullSizeBox(this, attr().mCullMinX, attr().mCullMinY, attr().mCullMinZ, attr().mCullMaxX, attr().mCullMaxY, attr().mCullMaxZ); } return TRUE; @@ -55,8 +56,8 @@ BOOL daObjSmplbg::Act_c::Create() { /* 0000032C-00000474 .text Mthd_Create__Q211daObjSmplbg5Act_cFv */ cPhs_State daObjSmplbg::Act_c::Mthd_Create() { - fopAcM_SetupActor(this, Act_c); + mType = prm_get_type(); if(mType >= 1){ mType = 0; @@ -76,7 +77,7 @@ BOOL daObjSmplbg::Act_c::Delete() { /* 0000047C-000004D8 .text Mthd_Delete__Q211daObjSmplbg5Act_cFv */ BOOL daObjSmplbg::Act_c::Mthd_Delete() { - s32 result = MoveBGDelete(); + BOOL result = MoveBGDelete(); dComIfG_resDelete(&mPhs, attr().mResName); return result; } @@ -91,7 +92,7 @@ void daObjSmplbg::Act_c::set_mtx() { /* 00000558-00000594 .text init_mtx__Q211daObjSmplbg5Act_cFv */ void daObjSmplbg::Act_c::init_mtx() { - mpModel->mBaseScale = scale; + mpModel->setBaseScale(scale); set_mtx(); } @@ -119,12 +120,11 @@ BOOL daObjSmplbg::Act_c::Execute(Mtx** matrix) { /* 000006CC-00000764 .text Draw__Q211daObjSmplbg5Act_cFv */ BOOL daObjSmplbg::Act_c::Draw() { int tevType; - if (((attr().mFlags) & 1) != 0) { + if (cLib_checkBit(attr().mFlags, 1)) { tevType = TEV_TYPE_BG0; - } else if (((attr().mFlags) & 2) != 0) { + } else if (cLib_checkBit(attr().mFlags, 2)) { tevType = TEV_TYPE_BG1; - } - else { + } else { tevType = TEV_TYPE_ACTOR; } g_env_light.settingTevStruct(tevType, ¤t.pos, &tevStr); diff --git a/src/d/actor/d_a_obj_swheavy.cpp b/src/d/actor/d_a_obj_swheavy.cpp index 023b4508a..cde664a97 100644 --- a/src/d/actor/d_a_obj_swheavy.cpp +++ b/src/d/actor/d_a_obj_swheavy.cpp @@ -12,7 +12,7 @@ #include "weak_data_1811.h" // IWYU pragma: keep const char daObjSwheavy::Act_c::M_arcname[] = "Hhbot"; -const daObjSwheavy::Attr_c daObjSwheavy::Act_c::M_attr[4] = { +const daObjSwheavy::Attr_c daObjSwheavy::Act_c::M_attr[] = { { /* m00 */ {}, /* mFlags */ 0, diff --git a/src/d/actor/d_a_obj_swpush.cpp b/src/d/actor/d_a_obj_swpush.cpp index 2f9a3017d..169ac86ce 100644 --- a/src/d/actor/d_a_obj_swpush.cpp +++ b/src/d/actor/d_a_obj_swpush.cpp @@ -17,7 +17,7 @@ const char daObjSwpush::Act_c::M_arcname_kbota[] = "Kbota_00"; const char daObjSwpush::Act_c::M_arcname_hhbot[] = "Hhbot"; -const daObjSwpush::Attr_c daObjSwpush::Act_c::M_attr[4] = { +const daObjSwpush::Attr_c daObjSwpush::Act_c::M_attr[] = { { /* mHeapSize */ 0xAE0, /* mFlags */ static_cast(FLAG_STAY_PRESSED | FLAG_OBEY_SAVE), diff --git a/src/d/actor/d_a_obj_toripost.cpp b/src/d/actor/d_a_obj_toripost.cpp index e5417cfef..b23ac01e5 100644 --- a/src/d/actor/d_a_obj_toripost.cpp +++ b/src/d/actor/d_a_obj_toripost.cpp @@ -335,7 +335,7 @@ int daObjTpost_c::getMsgXY() { col.r = REG12_S(0) + 0x80; col.g = REG12_S(1) + 0x80; col.b = REG12_S(2) + 0x80; - mDoMtx_stack_c::copy(mMorf->getModel()->mpNodeMtx[2]); + mDoMtx_stack_c::copy(mMorf->getModel()->getAnmMtx(2)); mDoMtx_stack_c::multVec(&pos, &pos); dComIfGp_particle_set(dPa_name::ID_COMMON_0057, &pos, &shape_angle, &scale, 0xFF, NULL, -1, &col); diff --git a/src/d/actor/d_a_player_bottle.inc b/src/d/actor/d_a_player_bottle.inc index a9cd9ee87..968161aae 100644 --- a/src/d/actor/d_a_player_bottle.inc +++ b/src/d/actor/d_a_player_bottle.inc @@ -10,15 +10,15 @@ * based on the original names of the functions it contains. */ - #include "d/actor/d_a_player_main.h" - #include "d/actor/d_a_player_HIO.h" - #include "d/d_camera.h" - #include "d/d_procname.h" - #include "JSystem/J3DGraphLoader/J3DAnmLoader.h" +#include "d/actor/d_a_player_main.h" +#include "d/actor/d_a_player_HIO.h" +#include "d/d_camera.h" +#include "d/d_procname.h" +#include "JSystem/J3DGraphLoader/J3DAnmLoader.h" /* 80151E40-80151E60 .text changeBottleDrinkFace__9daPy_lk_cFi */ int daPy_lk_c::changeBottleDrinkFace(int param_0) { - if ((param_0 == dItem_SOUP_BOTTLE_e) || (param_0 == dItem_HALF_SOUP_BOTTLE_e)) { + if (param_0 == dItem_SOUP_BOTTLE_e || param_0 == dItem_HALF_SOUP_BOTTLE_e) { return true; } return false; @@ -35,10 +35,9 @@ void daPy_lk_c::setBottleModel(u16 param_0) { mpEquipItemBtk->setFrame(0.0f); mpEquipItemBtk->searchUpdateMaterialID(tmp_modelData); tmp_modelData->entryTexMtxAnimator(mpEquipItemBtk); - if ((param_0 == dItem_RED_POTION_e) || (param_0 == dItem_GREEN_POTION_e) || - (param_0 == dItem_BLUE_POTION_e) || (param_0 == dItem_HALF_SOUP_BOTTLE_e) || - (param_0 == dItem_SOUP_BOTTLE_e) || (param_0 == dItem_WATER_BOTTLE_e) || - (param_0 == dItem_FOREST_WATER_e)) + if (param_0 == dItem_RED_POTION_e || param_0 == dItem_GREEN_POTION_e || param_0 == dItem_BLUE_POTION_e || + param_0 == dItem_HALF_SOUP_BOTTLE_e || param_0 == dItem_SOUP_BOTTLE_e || param_0 == dItem_WATER_BOTTLE_e || + param_0 == dItem_FOREST_WATER_e) { u16 bdl; if (param_0 == dItem_HALF_SOUP_BOTTLE_e) { @@ -56,7 +55,7 @@ void daPy_lk_c::setBottleModel(u16 param_0) { mpEquipItemBrk->setFrame(1.0f); } else if (param_0 == dItem_BLUE_POTION_e) { mpEquipItemBrk->setFrame(2.0f); - } else if ((param_0 == dItem_SOUP_BOTTLE_e) || (param_0 == dItem_HALF_SOUP_BOTTLE_e)) { + } else if (param_0 == dItem_SOUP_BOTTLE_e || param_0 == dItem_HALF_SOUP_BOTTLE_e) { mpEquipItemBrk->setFrame(4.0f); } else { mpEquipItemBrk->setFrame(3.0f); @@ -74,16 +73,14 @@ void daPy_lk_c::setBottleModel(u16 param_0) { tmp_modelData->entryTevRegAnimator(mpEquipItemBrk); m3600 = 0.0f; } - if ((param_0 != dItem_EMPTY_BOTTLE_e) && (mCurProc != daPyProc_BOTTLE_DRINK_e)) { + if (param_0 != dItem_EMPTY_BOTTLE_e && mCurProc != daPyProc_BOTTLE_DRINK_e) { tmp_modelData = initModel(&mpBottleCapModel, LINK_BDL_BOTTLECAP, 0x13000022); m355E = 1; } mDoExt_setCurrentHeap(oldHeap); if (param_0 == dItem_FOREST_WATER_e) { - m32F0.makeEmitter(dPa_name::ID_COMMON_020D, mpEquipItemModel->getBaseTRMtx(), ¤t.pos, - NULL); + m32F0.makeEmitter(dPa_name::ID_COMMON_020D, mpEquipItemModel->getBaseTRMtx(), ¤t.pos, NULL); } - return; } /* 80152128-801521A0 .text makeFairy__9daPy_lk_cFP4cXyzUl */ @@ -125,7 +122,6 @@ BOOL daPy_lk_c::procBottleDrink_init(u16 param_0) { /* 80152300-80152624 .text procBottleDrink__9daPy_lk_cFv */ BOOL daPy_lk_c::procBottleDrink() { - /* Nonmatching - sdata2 */ static const GXColor red = {0xC8, 0x00, 0x00, 0xFF}; static const GXColor green = {0x00, 0xFA, 0x00, 0xFF}; static const GXColor blue = {0x00, 0x32, 0x96, 0xFF}; @@ -145,7 +141,7 @@ BOOL daPy_lk_c::procBottleDrink() { if (mEquipItem != dItem_RED_POTION_e) { dComIfGp_setItemMagicCount(dComIfGs_getMaxMagic()); } - if ((mEquipItem == dItem_SOUP_BOTTLE_e) || (mEquipItem == dItem_HALF_SOUP_BOTTLE_e)) { + if (mEquipItem == dItem_SOUP_BOTTLE_e || mEquipItem == dItem_HALF_SOUP_BOTTLE_e) { onNoResetFlg1(daPyFlg1_UNK8000); } resetCurse(); @@ -155,11 +151,16 @@ BOOL daPy_lk_c::procBottleDrink() { } } } else if (uVar1 == LKANM_BCK_BINDRINKING) { - if ((dComIfGp_getItemNowLife() == dComIfGs_getLife()) && - (dComIfGs_getMagic() == g_dComIfG_gameInfo.play.field_0x48da)) + if (dComIfGp_getItemNowLife() == dComIfGs_getLife() && + dComIfGs_getMagic() == g_dComIfG_gameInfo.play.field_0x48da) { - setSingleMoveAnime(ANM_BINDRINKAFTER, 1.0f, daPy_HIO_bottle_c0::m.field_0x68, - daPy_HIO_bottle_c0::m.field_0xE, daPy_HIO_bottle_c0::m.field_0x6C); + setSingleMoveAnime( + ANM_BINDRINKAFTER, + 1.0f, + daPy_HIO_bottle_c0::m.field_0x68, + daPy_HIO_bottle_c0::m.field_0xE, + daPy_HIO_bottle_c0::m.field_0x6C + ); if (changeBottleDrinkFace(mEquipItem)) { setTextureAnime(0x87, 0); } @@ -171,7 +172,7 @@ BOOL daPy_lk_c::procBottleDrink() { dComIfGs_setEquipBottleItemEmpty(mReadyItemBtn); } const GXColor* p_Var3; - if ((mEquipItem != dItem_SOUP_BOTTLE_e) && (mEquipItem != dItem_HALF_SOUP_BOTTLE_e)) { + if (mEquipItem != dItem_SOUP_BOTTLE_e && mEquipItem != dItem_HALF_SOUP_BOTTLE_e) { if (mEquipItem == dItem_RED_POTION_e) { p_Var3 = &red; } else if (mEquipItem == dItem_GREEN_POTION_e) { @@ -179,8 +180,9 @@ BOOL daPy_lk_c::procBottleDrink() { } else { p_Var3 = &blue; } - m33A8.makeEmitterColor(dPa_name::ID_COMMON_0057, mpCLModel->getAnmMtx(0x12), - ¤t.pos, &shape_angle, p_Var3, NULL); + m33A8.makeEmitterColor( + dPa_name::ID_COMMON_0057, mpCLModel->getAnmMtx(0x12), ¤t.pos, &shape_angle, p_Var3, NULL + ); } } else { if (frameCtrl.checkPass(10.0f)) { @@ -252,22 +254,18 @@ BOOL daPy_lk_c::procBottleOpen() { /* 80152ED0-80153064 .text procBottleSwing_init__9daPy_lk_cFi */ BOOL daPy_lk_c::procBottleSwing_init(int param_0) { - /* Nonmatching - missing "lwz" instruction */ - BOOL bVar1; - int iVar2; - fopAc_ac_c* iVar3; - - iVar2 = checkShipRideUseItem(1); + int iVar2 = checkShipRideUseItem(1); commonProcInit(daPyProc_BOTTLE_SWING_e); - if ((int)param_0 != 0) { + if (param_0 != 0) { deleteEquipItem(FALSE); setBottleModel(dItem_EMPTY_BOTTLE_e); } current.angle.y = shape_angle.y; mVelocity = 0.0f; - iVar3 = dComIfGp_att_getCatghTarget(); - if (iVar3 != 0) { - if (iVar3->current.pos.y > mpCLModel->getBaseScale()->y) { + fopAc_ac_c* catch_target = dComIfGp_att_getCatghTarget(); + BOOL bVar1; + if (catch_target != 0) { + if (catch_target->current.pos.y > mpCLModel->getAnmMtx(0)[1][3]) { bVar1 = false; } else { bVar1 = true; @@ -277,6 +275,7 @@ BOOL daPy_lk_c::procBottleSwing_init(int param_0) { } else { bVar1 = false; } + if (bVar1) { setSingleMoveAnime( ANM_BINSWINGU, @@ -330,16 +329,15 @@ BOOL daPy_lk_c::procBottleSwing() { } mDemo.setDemoType(5); } else { - if ((((mFrameCtrlUnder[UNDER_MOVE0_e].getFrame() >= 1.0f) && - (mFrameCtrlUnder[UNDER_MOVE0_e].getFrame() <= 4.0f)) && - (getReadyItem() == dItem_EMPTY_BOTTLE_e)) && - ((dComIfGp_att_getCatghTarget() != NULL) || (m35D0 > current.pos.y + 10.0f))) + if (mFrameCtrlUnder[UNDER_MOVE0_e].getFrame() >= 1.0f && + mFrameCtrlUnder[UNDER_MOVE0_e].getFrame() <= 4.0f && getReadyItem() == dItem_EMPTY_BOTTLE_e && + (dComIfGp_att_getCatghTarget() != NULL || m35D0 > current.pos.y + 10.0f)) { fopAcM_orderCatchEvent(this, dComIfGp_att_getCatghTarget()); } } } - if ((mFrameCtrlUnder[UNDER_MOVE0_e].getRate() < 0.01f) || (m34D4 != 0)) { + if ((mFrameCtrlUnder[UNDER_MOVE0_e].getRate() < 0.01f) || m34D4 != 0) { if (m3574 != 0) { if (m34D4 == 0) { offModeFlg(ModeFlg_00000400); @@ -363,7 +361,7 @@ BOOL daPy_lk_c::procBottleSwing() { } } } else if (mFrameCtrlUnder[UNDER_MOVE0_e].getFrame() > m35A0) { - if ((m3570 == 0) && (!dComIfGp_checkPlayerStatus0(0, daPyStts0_SHIP_RIDE_e))) { + if (m3570 == 0 && !dComIfGp_checkPlayerStatus0(0, daPyStts0_SHIP_RIDE_e)) { checkNextMode(1); } } @@ -394,23 +392,20 @@ BOOL daPy_lk_c::procBottleGet_init() { /* 80153438-80153554 .text procBottleGet__9daPy_lk_cFv */ BOOL daPy_lk_c::procBottleGet() { - /* Nonmatching - floats */ J3DFrameCtrl& frameCtrl = mFrameCtrlUnder[UNDER_MOVE0_e]; setShipRidePosUseItem(); - if ((frameCtrl.getRate() < 0.01f) && (checkEndMessage(mEquipItem + 0x65))) { + if (frameCtrl.getRate() < 0.01f && (checkEndMessage(MSG_NO_FOR_ITEM(mEquipItem)))) { dComIfGp_event_reset(); dCam_getBody()->EndEventCamera(fopAcM_GetID(this)); deleteEquipItem(FALSE); endDemoMode(); - } else { - if (frameCtrl.getFrame() >= 9.0f) { - m355E = 1; - } + } else if (frameCtrl.getFrame() >= 9.0f) { + m355E = 1; } if (frameCtrl.checkPass(39.0f)) { mDoAud_seStart(JA_SE_ME_ITEM_GET_S); - g_dComIfG_gameInfo.play.field_0x4977 = 2; + dComIfGp_setMesgBgmOn2(); } return true; } diff --git a/src/d/actor/d_a_player_dproc.inc b/src/d/actor/d_a_player_dproc.inc index ad388043b..68da53e6d 100644 --- a/src/d/actor/d_a_player_dproc.inc +++ b/src/d/actor/d_a_player_dproc.inc @@ -398,23 +398,23 @@ void daPy_lk_c::setGetItemSound(u16 param_1, int param_2) { param_1 == dItem_RED_RUPEE_e || param_1 == dItem_PURPLE_RUPEE_e || param_1 == TINCLE_RUPEE1) { mDoAud_seStart(JA_SE_ME_ITEM_GET_S); - g_dComIfG_gameInfo.play.field_0x4977 = 2; + dComIfGp_setMesgBgmOn2(); } else if ((param_1 == dItem_HEART_CONTAINER_e) || (param_1 == dItem_HEART_PIECE_e && ((dComIfGs_getMaxLife() % 4) == 3))) { mDoAud_subBgmStart(JA_BGM_GET_HEART); - g_dComIfG_gameInfo.play.field_0x4977 = 1; + dComIfGp_setMesgBgmOn(); } else if (param_1 == dItem_HEART_PIECE_e || param_1 == dItem_JOY_PENDANT_e || param_1 == dItem_SMALL_KEY_e || param_1 == dItem_SILVER_RUPEE_e || param_1 == dItem_ORANGE_RUPEE_e) { mDoAud_subBgmStart(JA_BGM_ITEM_GET_S); - g_dComIfG_gameInfo.play.field_0x4977 = 1; + dComIfGp_setMesgBgmOn(); } else if (param_2 != dItem_HEART_e) { mDoAud_seStart(JA_SE_ME_ITEM_GET_S); - g_dComIfG_gameInfo.play.field_0x4977 = 2; + dComIfGp_setMesgBgmOn2(); } else { mDoAud_subBgmStart(JA_BGM_ITEM_GET); - g_dComIfG_gameInfo.play.field_0x4977 = 1; + dComIfGp_setMesgBgmOn(); } } @@ -454,10 +454,10 @@ BOOL daPy_lk_c::setGetDemo() { } u32 itemGetMsgNo; - if (itemNo == dItem_HEART_PIECE_e && dComIfGs_getMaxLife() % 4) { - itemGetMsgNo = 0x7B + dComIfGs_getMaxLife() % 4; + if (itemNo == dItem_HEART_PIECE_e && (dComIfGs_getMaxLife() % 4) != 0) { + itemGetMsgNo = MSG_NO_FOR_ITEM(dItem_HEART_PIECE_2_e + (dComIfGs_getMaxLife() % 4) - 1); } else { - itemGetMsgNo = 0x65 + itemNo; + itemGetMsgNo = MSG_NO_FOR_ITEM(itemNo); } if (mMsgId == fpcM_ERROR_PROCESS_ID_e) { @@ -602,7 +602,7 @@ BOOL daPy_lk_c::dProcGetItem() { if ((m34D4 == 7) && (dComIfGs_getMaxLife() % 4)) { m3624 = (dComIfGs_getMaxLife() % 4) + 0x7b; } else { - m3624 = m34D4 + 0x65; + m3624 = MSG_NO_FOR_ITEM(m34D4); } } if ((m3624 != 0) && (checkEndMessage(m3624))) { @@ -1938,7 +1938,7 @@ BOOL daPy_lk_c::dProcGetDance() { if (m34D0 == 0) { m34D0 = 1; mDoAud_subBgmStart(JA_BGM_GET_SONG); - g_dComIfG_gameInfo.play.field_0x4977 = 1; + dComIfGp_setMesgBgmOn(); } if (m34D6 > 0x4000) { shape_angle.y = @@ -2167,11 +2167,10 @@ BOOL daPy_lk_c::dProcPowerUp() { } else if (mFrameCtrlUnder[UNDER_MOVE0_e].getFrame() >= 11.0f && m34D0 == 0) { m34D0 = 1; mDoAud_subBgmStart(JA_BGM_ITEM_GET); - // mItemLifeCountType? (according to TP) - g_dComIfG_gameInfo.play.field_0x4977 = 1; + dComIfGp_setMesgBgmOn(); } else if (mFrameCtrlUnder[UNDER_MOVE0_e].getRate() < 0.01f) { if (m3624 == 0) { - m3624 = m3570 + 0x65; + m3624 = MSG_NO_FOR_ITEM(m3570); } if (checkEndMessage(m3624)) { dComIfGp_evmng_cutEnd(mStaffIdx); diff --git a/src/d/actor/d_a_player_main.cpp b/src/d/actor/d_a_player_main.cpp index 6da529de1..32f21b3f1 100644 --- a/src/d/actor/d_a_player_main.cpp +++ b/src/d/actor/d_a_player_main.cpp @@ -3774,7 +3774,7 @@ BOOL daPy_lk_c::execute() { dComIfGp_clearPlayerStatus0(0, daPyStts0_BOW_AIM_e); } - m3634 = -1; + mWhirlId = fpcM_ERROR_PROCESS_ID_e; l_debug_keep_pos = current.pos; l_debug_shape_angle = shape_angle; @@ -4323,8 +4323,8 @@ void daPy_lk_c::playerInit() { mActorKeepGrab.clearData(); mActorKeepRope.clearData(); m3628 = fpcM_ERROR_PROCESS_ID_e; - m3634 = fpcM_ERROR_PROCESS_ID_e; - mTactZevPartnerPID = fpcM_ERROR_PROCESS_ID_e; + mWhirlId = fpcM_ERROR_PROCESS_ID_e; + mTactZevPartnerId = fpcM_ERROR_PROCESS_ID_e; m3630 = fpcM_ERROR_PROCESS_ID_e; ResTIMG* blur_img = (ResTIMG*)dComIfG_getObjectRes(l_arcName, LINK_BTI_BLUR); diff --git a/src/d/actor/d_a_player_rope.inc b/src/d/actor/d_a_player_rope.inc index d0d8b3a8b..7e94befdf 100644 --- a/src/d/actor/d_a_player_rope.inc +++ b/src/d/actor/d_a_player_rope.inc @@ -43,7 +43,6 @@ void daPy_lk_c::freeRopeItem() { } } } - return; } /* 80142E0C-80142E98 .text checkRopeRoofHit__9daPy_lk_cFs */ @@ -54,7 +53,6 @@ f32 daPy_lk_c::checkRopeRoofHit(s16 param_0) { current.pos.z - 15.0f * cM_scos(param_0)); mRoofChk.SetPos(local_c); dComIfG_Bgsp()->RoofChk(&mRoofChk); - return; } /* 80142E98-80142FC8 .text changeRopeSwingProc__9daPy_lk_cFv */ @@ -227,7 +225,6 @@ void daPy_lk_c::setBlendRopeMoveAnime(int param_0) { fVar1 = -1.0f; } setMoveAnime(local_48, daPy_HIO_rope_c0::m.field_0x18, 1.0f, ANM_ROPECATCH, dVar4, 7, fVar1); - return; } /* 80143A44-80143C5C .text throwRope__9daPy_lk_cFv */ @@ -332,7 +329,6 @@ BOOL daPy_lk_c::checkNextRopeMode() { } else { procRopeSubject_init(); } - return; } /* 80143EAC-80143F3C .text checkHangRopeActorNull__9daPy_lk_cFv */ diff --git a/src/d/actor/d_a_player_sword.inc b/src/d/actor/d_a_player_sword.inc index 892034b6e..1c1798286 100644 --- a/src/d/actor/d_a_player_sword.inc +++ b/src/d/actor/d_a_player_sword.inc @@ -229,7 +229,6 @@ void daPy_lk_c::setLightSaver() { m355C--; } } - return; } /* 80155490-801554C8 .text checkDemoShieldNoDraw__9daPy_lk_cFv */ diff --git a/src/d/actor/d_a_player_tact.inc b/src/d/actor/d_a_player_tact.inc index b30bdd253..1bab7cae7 100644 --- a/src/d/actor/d_a_player_tact.inc +++ b/src/d/actor/d_a_player_tact.inc @@ -115,11 +115,11 @@ BOOL daPy_lk_c::checkTactLastInput() { } /* 8014D9F8-8014DA78 .text setTactZev__9daPy_lk_cFUiiPc */ -void daPy_lk_c::setTactZev(fpc_ProcID tactZevPartnerPID, int r30, char* r31) { - if (tactZevPartnerPID != fpcM_ERROR_PROCESS_ID_e) { +void daPy_lk_c::setTactZev(fpc_ProcID tactZevPartnerId, int r30, char* r31) { + if (tactZevPartnerId != fpcM_ERROR_PROCESS_ID_e) { mDoAud_seStart(JA_SE_PRE_TAKT); } - mTactZevPartnerPID = tactZevPartnerPID; + mTactZevPartnerId = tactZevPartnerId; m34CC = r30; m3494 = r31; } @@ -596,8 +596,8 @@ BOOL daPy_lk_c::procTactPlay() { m3628 = fpcM_ERROR_PROCESS_ID_e; } - if (mTactZevPartnerPID != fpcM_ERROR_PROCESS_ID_e && m34CC == m3570) { - tactZevPartner = fopAcM_SearchByID(mTactZevPartnerPID); + if (mTactZevPartnerId != fpcM_ERROR_PROCESS_ID_e && m34CC == m3570) { + tactZevPartner = fopAcM_SearchByID(mTactZevPartnerId); } if (m3574 == 0) { @@ -676,7 +676,7 @@ BOOL daPy_lk_c::procTactPlayEnd_init(int r30) { if (r30 == -1) { dCam_getBody()->EndEventCamera(fopAcM_GetID(this)); - fopAcM_orderChangeEvent(this, fopAcM_SearchByID(mTactZevPartnerPID), m3494, 0, -1); + fopAcM_orderChangeEvent(this, fopAcM_SearchByID(mTactZevPartnerId), m3494, 0, -1); mDemo.setDemoType(2); } else if (r30 == 0) { dCam_getBody()->EndEventCamera(fopAcM_GetID(this)); diff --git a/src/d/actor/d_a_sail.cpp b/src/d/actor/d_a_sail.cpp index ebed23a88..aaca939b5 100644 --- a/src/d/actor/d_a_sail.cpp +++ b/src/d/actor/d_a_sail.cpp @@ -503,7 +503,7 @@ static BOOL daSail_Draw(sail_class* i_this) { mDoMtx_ZrotM(*calc_mtx, i_this->current.angle.z); mDoMtx_concat(j3dSys.mViewMtx, *calc_mtx, *i_this->mSailPacket.getStickMtx()); - mDoMtx_copy(*calc_mtx, i_this->mSailPacket.mStickModel->mBaseTransformMtx); + i_this->mSailPacket.mStickModel->setBaseTRMtx(*calc_mtx); MtxTrans(0.0f, 0.0f, 0.0f, 0); mDoMtx_copy(*calc_mtx, i_this->mSailPacket.mTexMtx); diff --git a/src/d/actor/d_a_ship.cpp b/src/d/actor/d_a_ship.cpp index 669d20bcb..46e18b61e 100644 --- a/src/d/actor/d_a_ship.cpp +++ b/src/d/actor/d_a_ship.cpp @@ -1723,9 +1723,7 @@ BOOL daShip_c::procCannon() { short prev0394 = m0394; if (target) { - cannonPos.x = mpCannonModel->mpNodeMtx[2][0][3]; - cannonPos.y = mpCannonModel->mpNodeMtx[2][1][3]; - cannonPos.z = mpCannonModel->mpNodeMtx[2][2][3]; + mDoMtx_multVecZero(mpCannonModel->getAnmMtx(2), &cannonPos); cannonPos = target->eyePos - cannonPos; diff --git a/src/d/d_com_inf_game.cpp b/src/d/d_com_inf_game.cpp index 65a677f9b..89bc30bda 100644 --- a/src/d/d_com_inf_game.cpp +++ b/src/d/d_com_inf_game.cpp @@ -165,7 +165,7 @@ void dComIfG_play_c::itemInit() { strcpy(mInputPassword, "\0"); - field_0x4977 = 0; + mMesgBgm = 0; field_0x4978 = 0; m2dShow = 0; field_0x497a = 0; diff --git a/src/d/d_npc.cpp b/src/d/d_npc.cpp index 074aba545..98086af1f 100644 --- a/src/d/d_npc.cpp +++ b/src/d/d_npc.cpp @@ -599,10 +599,10 @@ bool dNpc_setAnm(mDoExt_McaMorf* pMorf, int loopMode, f32 morf, f32 speed, int a /* 8021BC8C-8021BD2C .text dNpc_setShadowModel__FP8J3DModelP12J3DModelDataP8J3DModel */ void dNpc_setShadowModel(J3DModel* param_1, J3DModelData* param_2, J3DModel* param_3) { for(int i = 0; i < param_2->getWEvlpMtxNum(); i++) { - mDoMtx_copy(param_3->mpWeightEnvMtx[i], param_1->mpWeightEnvMtx[i]); + param_1->setWeightAnmMtx(i, param_3->getWeightAnmMtx(i)); } for(int i = 0; i < param_2->getJointNum(); i++) { - mDoMtx_copy(param_3->mpNodeMtx[i], param_1->mpNodeMtx[i]); + param_1->setAnmMtx(i, param_3->getAnmMtx(i)); } } diff --git a/src/d/d_particle.cpp b/src/d/d_particle.cpp index 9a93e3e7a..fb1d8e07f 100644 --- a/src/d/d_particle.cpp +++ b/src/d/d_particle.cpp @@ -171,7 +171,7 @@ J3DModel * dPa_modelControl_c::newModel(J3DModelData* modelData) { if (model->mInit == 0) { model->mInit = 1; J3DModel * j3dmodel = model->mModel; - j3dmodel->mModelData = modelData; + j3dmodel->setModelData(modelData); J3DShapePacket * shapePacket = j3dmodel->getShapePacket(0); for (u16 j = 0; j < modelData->getShapeNum(); shapePacket++, j++) { @@ -189,7 +189,7 @@ J3DModel * dPa_modelControl_c::newModel(J3DModelData* modelData) { matPacket->setDisplayListObj(mat->getSharedDisplayListObj()); } - j3dmodel->mVertexBuffer.setVertexData(&modelData->getVertexData()); + j3dmodel->getVertexBuffer()->setVertexData(&modelData->getVertexData()); return model->mModel; } } diff --git a/src/d/d_wood.cpp b/src/d/d_wood.cpp index b98ada9d0..aae8dbb71 100644 --- a/src/d/d_wood.cpp +++ b/src/d/d_wood.cpp @@ -321,7 +321,6 @@ dWood::Anm_c::Anm_c() { mNormAnimIdx = AnmID_Norm0; mAlphaScale = 0xff; - return; } /* 800BD710-800BD800 .text play__Q25dWood5Anm_cFPQ25dWood8Packet_c */ @@ -334,7 +333,6 @@ void dWood::Anm_c::play(dWood::Packet_c *i_packet) { }; (this->*mode_proc[mMode])(i_packet); } - return; } /* 800BD800-800BD848 .text copy_angamp__Q25dWood5Anm_cFPCQ25dWood5Anm_c */ @@ -833,7 +831,6 @@ dWood::Room_c::Room_c() { void dWood::Room_c::entry_unit(dWood::Unit_c *unit) { unit->mpNext = mpUnit; mpUnit = unit; - return; } /* 800BEF94-800BEFF0 .text delete_all_unit__Q25dWood6Room_cFv */