summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTtobas <epona.link@hotmail.fr>2025-03-26 02:05:02 +0100
committerGitHub <noreply@github.com>2025-03-25 18:05:02 -0700
commitb6febdc2b6e4b2f7674d581a8a59eec173e4b188 (patch)
treeec8ab635b747b0577c50f15d0f94d0bf70d16687 /include
parente876797c3d1e1192755e554deb9fce49af5f280b (diff)
d_a_obj_shoe 91% (#2347)
* Basic structure done * daNpcShoe_Param_c done, class cleaned a bit, ::Create matching, destructor matching * WIP * About 70% done * Fix after merging main * TU almost done, missing correct rodata ordering, constructor, setMotionAnim, __sinit not matching * Fix: Apply suggestions --------- Co-authored-by: Ttobas <anon@ym.ous>
Diffstat (limited to 'include')
-rw-r--r--include/d/actor/d_a_npc_shoe.h142
-rw-r--r--include/m_Do/m_Do_ext.h1
2 files changed, 122 insertions, 21 deletions
diff --git a/include/d/actor/d_a_npc_shoe.h b/include/d/actor/d_a_npc_shoe.h
index 0c23a3a254..4c78e3f303 100644
--- a/include/d/actor/d_a_npc_shoe.h
+++ b/include/d/actor/d_a_npc_shoe.h
@@ -11,47 +11,147 @@
* @details
*
*/
-class daNpcShoe_c : public fopAc_ac_c {
+class daNpcShoe_c : public daNpcF_c {
public:
+ typedef bool (daNpcShoe_c::*actionFunc)(void*);
+ typedef BOOL (daNpcShoe_c::*EventFn)(int);
+
+ enum Animation {
+ /* 0x01 */ ANM_M_SITWAIT_A,
+ /* 0x02 */ ANM_M_SITTALK_A,
+ /* 0x03 */ ANM_M_SITTALK_A_B,
+ /* 0x04 */ ANM_SHOE_TALK_A,
+ /* 0x05 */ ANM_M_SIT_TO_WOLF_A
+ };
+
+ enum Motion {
+ /* 0x01 */ MOT_SITWAIT_A,
+ /* 0x02 */ MOT_SITTALK_A,
+ /* 0x03 */ MOT_SITTALK_A_B,
+ /* 0x04 */ MOT_SHOE_TALK_A,
+ /* 0x05 */ MOT_SIT_TO_WOLF_A,
+ };
+
/* 80AE794C */ daNpcShoe_c();
/* 80AE7B60 */ ~daNpcShoe_c();
- /* 80AE7D48 */ void Create();
- /* 80AE7FD8 */ void CreateHeap();
- /* 80AE81E8 */ void Delete();
- /* 80AE821C */ void Execute();
- /* 80AE8308 */ void Draw();
- /* 80AE840C */ void ctrlJoint(J3DJoint*, J3DModel*);
- /* 80AE8598 */ void createHeapCallBack(fopAc_ac_c*);
- /* 80AE85B8 */ void ctrlJointCallBack(J3DJoint*, int);
- /* 80AE8604 */ void setMotion(int, f32, int);
+ /* 80AE7D48 */ cPhs__Step Create();
+ /* 80AE7FD8 */ BOOL CreateHeap();
+ /* 80AE81E8 */ int Delete();
+ /* 80AE821C */ int Execute();
+ /* 80AE8308 */ int Draw();
+ /* 80AE840C */ bool ctrlJoint(J3DJoint*, J3DModel*);
+ /* 80AE8598 */ static int createHeapCallBack(fopAc_ac_c*);
+ /* 80AE85B8 */ static BOOL ctrlJointCallBack(J3DJoint*, int);
+ /* 80AE8604 */ void setMotion(int, f32, BOOL);
/* 80AE864C */ void reset();
- /* 80AE895C */ void setAction(bool (daNpcShoe_c::*)(void*));
- /* 80AE8A04 */ void wait(void*);
- /* 80AE8E24 */ void fear(void*);
- /* 80AE8ED4 */ void talk(void*);
- /* 80AE9094 */ void demo(void*);
+ /* 80AE895C */ inline int setAction(actionFunc);
+ /* 80AE8A04 */ bool wait(void*);
+ /* 80AE8E24 */ bool fear(void*);
+ /* 80AE8ED4 */ bool talk(void*);
+ /* 80AE9094 */ bool demo(void*);
/* 80AE92E8 */ void setParam();
- /* 80AE93A0 */ void main();
+ /* 80AE93A0 */ BOOL main();
/* 80AE9624 */ void setAttnPos();
/* 80AE9820 */ void lookat();
/* 80AE9A00 */ bool setMotionAnm(int, f32);
- /* 80AE9AD0 */ bool drawDbgInfo();
+ /* 80AE9AD0 */ BOOL drawDbgInfo();
/* 80AEA340 */ void adjustShapeAngle();
- static u8 mEvtSeqList[12];
+ s16 getMessageNo() { return fopAcM_GetParam(this) >> 0x10; }
+
+ int getTime() { return getTimeMinute() + getTimeHour() * 60; }
+ int getTimeHour() {
+ if (dKy_darkworld_check() != 0) {
+ return dKy_getDarktime_hour();
+ } else {
+ return dKy_getdaytime_hour();
+ }
+ }
+ int getTimeMinute() {
+ if (dKy_darkworld_check() != 0) {
+ return dKy_getDarktime_minute();
+ } else {
+ return dKy_getdaytime_minute();
+ }
+ }
+ int getStartTime() { return fopAcM_GetParam(this) & 0xff; }
+ int getEndTime() { return (fopAcM_GetParam(this) >> 8) & 0xff; }
+
+ inline void setLookMode(int i_lookMode);
+ inline bool chkFindPlayer();
+ inline void playMotion();
+
+ static EventFn mEvtSeqList[1];
+
private:
- /* 0x568 */ u8 field_0x568[0xe1c - 0x568];
+ /* 0xB48 */ J3DModel* mpModel1;
+ /* 0xB4C */ J3DModel* mpModel2;
+ /* 0xB50 */ Z2CreatureCitizen mCreature;
+ /* 0xBF4 */ u8 field_0xbf4[0xbf8 - 0xbf4];
+ /* 0xBF8 */ daNpcF_Lookat_c mLookat;
+ /* 0xC94 */ daNpcF_ActorMngr_c mActorMngr[1];
+ /* 0xC9C */ u8 field_0xc9c[0xca0 - 0xc9c];
+ /* 0xCA0 */ dCcD_Cyl mCcCyl;
+ /* 0xDDC */ actionFunc mpActionFn;
+ /* 0xDE8 */ request_of_phase_process_class mPhases[3];
+ /* 0xE00 */ u32 field_0xe00;
+ /* 0xE04 */ u32 field_0xe04;
+ /* 0xE08 */ u32 field_0xe08;
+ /* 0xE0C */ u32 field_0xe0c;
+ /* 0xE10 */ s16 mLookMode;
+ /* 0xE12 */ u16 mStartTime;
+ /* 0xE14 */ u16 mEndTime;
+ /* 0xE16 */ u16 field_0xe16;
+ /* 0xE18 */ u16 mMode;
+ /* 0xE1A */ u8 field_0xe1a;
+ /* 0xE1B */ u8 field_0xe1b; // Probably isDaytime or isNighttime
};
STATIC_ASSERT(sizeof(daNpcShoe_c) == 0xe1c);
class daNpcShoe_Param_c {
public:
- /* 80AEA344 */ ~daNpcShoe_Param_c();
+ /* 8095D5D4 */ virtual ~daNpcShoe_Param_c() {}
+
+ struct param {
+ /* 0x00 */ f32 mAttnOffsetY;
+ /* 0x04 */ f32 mGravity;
+ /* 0x08 */ f32 mScale;
+ /* 0x0C */ f32 mShadowDepth;
+ /* 0x10 */ f32 mCcWeight;
+ /* 0x14 */ f32 mCylH;
+ /* 0x18 */ f32 mWallH;
+ /* 0x1C */ f32 mWallR;
+ /* 0x20 */ f32 mBodyUpAngle;
+ /* 0x24 */ f32 mBodyDownAngle;
+ /* 0x28 */ f32 mBodyLeftAngle;
+ /* 0x2C */ f32 mBodyRightAngle;
+ /* 0x30 */ f32 mHeadUpAngle;
+ /* 0x34 */ f32 mHeadDownAngle;
+ /* 0x38 */ f32 mHeadLeftAngle;
+ /* 0x3C */ f32 mHeadRightAngle;
+ /* 0x40 */ f32 mNeckAngleScl;
+ /* 0x44 */ f32 mMorfFrames;
+ /* 0x48 */ s16 mSpeakDistIdx;
+ /* 0x4A */ s16 mSpeakAngleIdx;
+ /* 0x4C */ s16 mTalkDistIdx;
+ /* 0x4E */ s16 mTalkAngleIdx;
+ /* 0x50 */ f32 mAttnFovY;
+ /* 0x54 */ f32 mAttnRadius;
+ /* 0x58 */ f32 mAttnUpperY;
+ /* 0x5C */ f32 mAttnLowerY;
+ /* 0x60 */ s16 field_0x60;
+ /* 0x62 */ s16 mDamageTimer;
+ /* 0x64 */ s16 mTestExpression;
+ /* 0x66 */ s16 mTestMotion;
+ /* 0x68 */ s16 mTestLookMode;
+ /* 0x6A */ bool mTest;
+ };
- static u8 const m[108];
+ static param const m;
};
+STATIC_ASSERT(sizeof(daNpcShoe_Param_c::param) == 0x6C);
#endif /* D_A_NPC_SHOE_H */
diff --git a/include/m_Do/m_Do_ext.h b/include/m_Do/m_Do_ext.h
index ce8ddfc083..1fdb9e815f 100644
--- a/include/m_Do/m_Do_ext.h
+++ b/include/m_Do/m_Do_ext.h
@@ -334,6 +334,7 @@ public:
J3DModel* getModel() { return mpModel; }
void offMorfNone() { mMorfNone = false; }
void onMorfNone() { mMorfNone = true; }
+ inline void setTranslateScale(cXyz& i_scale) { mTranslateScale = i_scale; }
J3DTransformInfo* getOldTransInfo() { return mpTransformInfo; }
Quaternion* getOldQuaternion() { return mpQuat; }
void offTranslate() { mTranslate = true; }