Skip to content

Commit aec2c09

Browse files
d_a_npc_grmc equivalent (#2596)
* initial work * cleanup * added anm enums * added joint enum * updated configure.py * Indentation --------- Co-authored-by: hatal175 <hatal175@users.noreply.github.com>
1 parent 15d0094 commit aec2c09

File tree

3 files changed

+799
-1167
lines changed

3 files changed

+799
-1167
lines changed

configure.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1786,7 +1786,7 @@ def MatchingFor(*versions) -> bool:
17861786
ActorRel(Equivalent, "d_a_npc_grc", extra_cflags=[DANPCF_C_HACK]), # weak func order
17871787
ActorRel(NonMatching, "d_a_npc_grd"),
17881788
ActorRel(NonMatching, "d_a_npc_grm"),
1789-
ActorRel(NonMatching, "d_a_npc_grmc"),
1789+
ActorRel(Equivalent, "d_a_npc_grmc"), # weak func order
17901790
ActorRel(NonMatching, "d_a_npc_gro"),
17911791
ActorRel(NonMatching, "d_a_npc_grr"),
17921792
ActorRel(NonMatching, "d_a_npc_grs"),

include/d/actor/d_a_npc_grmc.h

Lines changed: 106 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#define D_A_NPC_GRMC_H
33

44
#include "d/actor/d_a_npc.h"
5+
#include "d/d_shop_system.h"
56

67
/**
78
* @ingroup actors-npcs
@@ -10,66 +11,128 @@
1011
*
1112
* @details
1213
*
13-
*/
14-
class daNpc_grMC_c : public fopAc_ac_c {
14+
*/
15+
16+
struct daNpc_grMC_HIOParam {
17+
/* 0x0 */ daNpcT_HIOParam common;
18+
};
19+
20+
class daNpc_grMC_HIO_c : public mDoHIO_entry_c {
21+
public:
22+
/* 0x8 */ daNpc_grMC_HIOParam param;
23+
};
24+
25+
class daNpc_grMC_Param_c {
26+
public:
27+
/* 809D9014 */ virtual ~daNpc_grMC_Param_c() {}
28+
29+
static daNpc_grMC_HIOParam const m;
30+
};
31+
32+
class daNpc_grMC_c : public dShopSystem_c {
1533
public:
34+
35+
enum Joint {
36+
/* 0x00 */ JNT_CENTER,
37+
/* 0x01 */ JNT_BACKBONE1,
38+
/* 0x02 */ JNT_BACKBONE2,
39+
/* 0x03 */ JNT_NECK,
40+
/* 0x04 */ JNT_HEAD,
41+
/* 0x05 */ JNT_CHIN,
42+
/* 0x06 */ JNT_MAYU,
43+
/* 0x07 */ JNT_MOUTH,
44+
/* 0x08 */ JNT_SHOULDERL,
45+
/* 0x09 */ JNT_ARML1,
46+
/* 0x0A */ JNT_ARML2,
47+
/* 0x0B */ JNT_HANDL,
48+
/* 0x0C */ JNT_SHOULDERR,
49+
/* 0x0D */ JNT_ARMR1,
50+
/* 0x0E */ JNT_ARMR2,
51+
/* 0x0F */ JNT_HANDR,
52+
/* 0x10 */ JNT_WAIST,
53+
/* 0x11 */ JNT_LEGL1,
54+
/* 0x12 */ JNT_LEGL2,
55+
/* 0x13 */ JNT_FOOTL,
56+
/* 0x14 */ JNT_LEGR1,
57+
/* 0x15 */ JNT_LEGR2,
58+
/* 0x16 */ JNT_FOOTR,
59+
};
60+
61+
typedef int (daNpc_grMC_c::*cutFunc)(int);
62+
typedef int (daNpc_grMC_c::*actionFunc)(void*);
63+
1664
/* 809D740C */ ~daNpc_grMC_c();
17-
/* 809D7534 */ void create();
18-
/* 809D77BC */ void CreateHeap();
19-
/* 809D79BC */ void Delete();
20-
/* 809D79F0 */ void Execute();
21-
/* 809D7AD4 */ void Draw();
22-
/* 809D7B18 */ void createHeapCallBack(fopAc_ac_c*);
23-
/* 809D7B38 */ void ctrlJointCallBack(J3DJoint*, int);
24-
/* 809D7B90 */ bool getType();
25-
/* 809D7B98 */ void getFlowNodeNo();
26-
/* 809D7BB4 */ void getMaxNumItem();
27-
/* 809D7BC0 */ void isDelete();
65+
/* 809D7534 */ cPhs__Step create();
66+
/* 809D77BC */ int CreateHeap();
67+
/* 809D79BC */ int Delete();
68+
/* 809D79F0 */ int Execute();
69+
/* 809D7AD4 */ int Draw();
70+
/* 809D7B18 */ static int createHeapCallBack(fopAc_ac_c*);
71+
/* 809D7B38 */ static int ctrlJointCallBack(J3DJoint*, int);
72+
/* 809D7B90 */ u8 getType();
73+
/* 809D7B98 */ int getFlowNodeNo();
74+
/* 809D7BB4 */ u8 getMaxNumItem();
75+
/* 809D7BC0 */ BOOL isDelete();
2876
/* 809D7C34 */ void reset();
2977
/* 809D7D48 */ void afterJntAnm(int);
3078
/* 809D7DD4 */ void setParam();
3179
/* 809D7F28 */ void setAfterTalkMotion();
3280
/* 809D7FCC */ void srchActors();
33-
/* 809D7FD0 */ void evtTalk();
34-
/* 809D8174 */ void evtCutProc();
81+
/* 809D7FD0 */ BOOL evtTalk();
82+
/* 809D8174 */ BOOL evtCutProc();
3583
/* 809D823C */ void action();
3684
/* 809D8398 */ void beforeMove();
3785
/* 809D8410 */ void setAttnPos();
3886
/* 809D8670 */ void setCollision();
39-
/* 809D87A0 */ bool drawDbgInfo();
87+
/* 809D87A0 */ int drawDbgInfo();
4088
/* 809D87A8 */ void drawOtherMdl();
41-
/* 809D8808 */ void selectAction();
42-
/* 809D8850 */ void chkAction(int (daNpc_grMC_c::*)(void*));
43-
/* 809D887C */ void setAction(int (daNpc_grMC_c::*)(void*));
44-
/* 809D8924 */ void tend(void*);
45-
/* 809D8AE8 */ void talk(void*);
46-
/* 809D8C6C */ void shop(void*);
47-
/* 809D8E5C */ daNpc_grMC_c(daNpcT_faceMotionAnmData_c const*, daNpcT_motionAnmData_c const*,
48-
daNpcT_MotionSeqMngr_c::sequenceStepData_c const*, int,
49-
daNpcT_MotionSeqMngr_c::sequenceStepData_c const*, int,
50-
daNpcT_evtData_c const*, char**);
51-
/* 809D8FD4 */ s32 getHeadJointNo();
52-
/* 809D8FDC */ s32 getNeckJointNo();
53-
/* 809D8FE4 */ bool getBackboneJointNo();
54-
/* 809D8FEC */ void checkChangeJoint(int);
55-
/* 809D8FFC */ void checkRemoveJoint(int);
56-
/* 809D900C */ u16 getEyeballMaterialNo();
89+
/* 809D8808 */ BOOL selectAction();
90+
/* 809D8850 */ BOOL chkAction(actionFunc);
91+
/* 809D887C */ BOOL setAction(actionFunc);
92+
/* 809D8924 */ int tend(void*);
93+
/* 809D8AE8 */ int talk(void*);
94+
/* 809D8C6C */ int shop(void*);
95+
#ifdef DEBUG
96+
int test(void*);
97+
#endif
98+
/* 809D8E5C */ daNpc_grMC_c(
99+
daNpcT_faceMotionAnmData_c const* i_faceMotionAnmData,
100+
daNpcT_motionAnmData_c const* i_motionAnmData,
101+
daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_faceMotionSequenceData,
102+
int i_faceMotionStepNum,
103+
daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_motionSequenceData,
104+
int i_motionStepNum,
105+
daNpcT_evtData_c const* i_evtData,
106+
char** i_arcNames)
107+
: dShopSystem_c(i_faceMotionAnmData, i_motionAnmData, i_faceMotionSequenceData,
108+
i_faceMotionStepNum, i_motionSequenceData, i_motionStepNum, i_evtData,
109+
i_arcNames) {}
110+
/* 809D8FD4 */ s32 getHeadJointNo() { return JNT_HEAD; }
111+
/* 809D8FDC */ s32 getNeckJointNo() { return JNT_NECK; }
112+
/* 809D8FE4 */ s32 getBackboneJointNo() { return JNT_BACKBONE1; }
113+
/* 809D8FEC */ BOOL checkChangeJoint(int param_1) { return param_1 == JNT_HEAD; }
114+
/* 809D8FFC */ BOOL checkRemoveJoint(int param_1) { return param_1 == JNT_MOUTH; }
115+
/* 809D900C */ u16 getEyeballMaterialNo() { return 1; };
57116

58-
static void* mCutNameList;
59-
static u8 mCutList[12];
117+
static char* mCutNameList;
118+
static cutFunc mCutList[1];
60119

61120
private:
62-
/* 0x568 */ u8 field_0x568[0x10e4 - 0x568];
121+
#ifdef DEBUG
122+
/* 0xFCC */ daNpc_grMC_HIO_c* mHIO;
123+
#endif
124+
/* 0x0F7C */ u8 field_0xf7c[0xf80 - 0xf7c];
125+
/* 0x0F80 */ dCcD_Cyl mCyl;
126+
/* 0x10BC */ u8 mType;
127+
/* 0x10C0 */ actionFunc mNextAction;
128+
/* 0x10CC */ actionFunc mAction;
129+
/* 0x10D8 */ int field_0x10d8;
130+
/* 0x10DC */ u8 field_0x10dc;
131+
/* 0x10DD */ u8 field_0x10dd;
132+
/* 0x10DE */ u8 field_0x10de[0x10e0 - 0x10de];
133+
/* 0x10E0 */ u8 field_0x10e0;
63134
};
64135

65136
STATIC_ASSERT(sizeof(daNpc_grMC_c) == 0x10e4);
66137

67-
class daNpc_grMC_Param_c {
68-
public:
69-
/* 809D9014 */ ~daNpc_grMC_Param_c();
70-
71-
static u8 const m[140];
72-
};
73-
74-
75138
#endif /* D_A_NPC_GRMC_H */

0 commit comments

Comments
 (0)