J3DModel inlines cleanup, procBottleSwing_init match, etc

This commit is contained in:
LagoLunatic
2025-04-10 19:30:51 -04:00
parent 0bb7ff4051
commit 309158e274
51 changed files with 402 additions and 405 deletions
+5 -8
View File
@@ -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;
@@ -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;
+1 -1
View File
@@ -114,7 +114,7 @@ public:
virtual bool isSame(J3DMatPacket*) const;
virtual int entry(J3DDrawBuffer*);
virtual void draw();
virtual void draw() {}
virtual ~J3DPacket() {}
public:
+13 -17
View File
@@ -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
}
+7 -7
View File
@@ -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;
+2 -2
View File
@@ -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);
+10 -11
View File
@@ -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() {}
+2 -2
View File
@@ -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;
+4 -4
View File
@@ -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;
+3 -3
View File
@@ -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;
+19 -1
View File
@@ -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);
}
+1 -1
View File
@@ -396,4 +396,4 @@ u8 check_itemno(int);
u8 getEmonoItemFromLifeBallTable(u16);
u8 getItemFromLifeBallTableWithoutEmono(u16);
#endif /* D_ITEM_H */
#endif /* D_ITEM_H */
+5 -3
View File
@@ -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.
+1 -1
View File
@@ -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,
+24 -24
View File
@@ -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 {