Skip to content

Commit 9db3df6

Browse files
committed
Work on create functions of d_a_npc_midp and changed mpMatAnm to array
1 parent d7a8fb9 commit 9db3df6

File tree

10 files changed

+316
-426
lines changed

10 files changed

+316
-426
lines changed

include/d/actor/d_a_npc.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -433,8 +433,7 @@ class daNpcT_c : public fopAc_ac_c {
433433
/* 0x8A0 */ dBgS_AcchCir mAcchCir;
434434
/* 0x8E0 */ request_of_phase_process_class mPhase[10];
435435
/* 0x930 */ cBgS_GndChk mGndChk;
436-
/* 0x96C */ daNpcT_MatAnm_c* mpMatAnm;
437-
/* 0x970 */ u8 field_0x970[4];
436+
/* 0x96C */ daNpcT_MatAnm_c* mpMatAnm[2];
438437
/* 0x974 */ dMsgFlow_c mFlow;
439438
/* 0x9C0 */ dPaPoT_c field_0x9c0;
440439
/* 0xA40 */ dCcD_Stts field_0xa40;

include/d/actor/d_a_npc_midp.h

Lines changed: 76 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -11,63 +11,117 @@
1111
* @details
1212
*
1313
*/
14-
class daNpc_midP_c : public fopAc_ac_c {
14+
class daNpc_midP_c : public daNpcT_c {
1515
public:
16+
typedef int (daNpc_midP_c::*cutFunc)(int);
17+
1618
/* 80A70C6C */ ~daNpc_midP_c();
17-
/* 80A70D90 */ void create();
18-
/* 80A71074 */ void CreateHeap();
19+
/* 80A70D90 */ int create();
20+
/* 80A71074 */ int CreateHeap();
1921
/* 80A714BC */ void Delete();
2022
/* 80A714F0 */ void Execute();
2123
/* 80A71510 */ void Draw();
22-
/* 80A715D4 */ void createHeapCallBack(fopAc_ac_c*);
23-
/* 80A715F4 */ void ctrlJointCallBack(J3DJoint*, int);
24-
/* 80A7164C */ void getType();
25-
/* 80A7166C */ void isDelete();
24+
/* 80A715D4 */ static int createHeapCallBack(fopAc_ac_c*);
25+
/* 80A715F4 */ static int ctrlJointCallBack(J3DJoint*, int);
26+
/* 80A7164C */ u8 getType();
27+
/* 80A7166C */ int isDelete();
2628
/* 80A7168C */ void reset();
2729
/* 80A717D4 */ void afterJntAnm(int);
28-
/* 80A71860 */ void ctrlBtk();
30+
// /* 80A71860 */ void ctrlBtk();
2931
/* 80A7199C */ void setParam();
3032
/* 80A71A98 */ void setAfterTalkMotion();
3133
/* 80A71AF8 */ void srchActors();
32-
/* 80A71AFC */ void evtTalk();
33-
/* 80A71BFC */ void evtCutProc();
34+
// /* 80A71AFC */ void evtTalk();
35+
// /* 80A71BFC */ void evtCutProc();
3436
/* 80A71CC4 */ void action();
3537
/* 80A71DB0 */ void beforeMove();
3638
/* 80A71E28 */ void setAttnPos();
3739
/* 80A72064 */ void setCollision();
38-
/* 80A7216C */ bool drawDbgInfo();
40+
// /* 80A7216C */ bool drawDbgInfo();
3941
/* 80A72174 */ void drawGhost();
4042
/* 80A721E0 */ void selectAction();
4143
/* 80A72228 */ void chkAction(int (daNpc_midP_c::*)(void*));
4244
/* 80A72254 */ void setAction(int (daNpc_midP_c::*)(void*));
4345
/* 80A722FC */ void wait(void*);
4446
/* 80A72548 */ void talk(void*);
45-
/* 80A737D0 */ daNpc_midP_c(daNpcT_faceMotionAnmData_c const*, daNpcT_motionAnmData_c const*,
46-
daNpcT_MotionSeqMngr_c::sequenceStepData_c const*, int,
47-
daNpcT_MotionSeqMngr_c::sequenceStepData_c const*, int,
48-
daNpcT_evtData_c const*, char**);
47+
/* 80A737D0 */ daNpc_midP_c(daNpcT_faceMotionAnmData_c const* param_1, daNpcT_motionAnmData_c const* param_2,
48+
daNpcT_MotionSeqMngr_c::sequenceStepData_c const* param_3, int param_4,
49+
daNpcT_MotionSeqMngr_c::sequenceStepData_c const* param_5, int param_6,
50+
daNpcT_evtData_c const* param_7, char** param_8) :
51+
daNpcT_c(param_1, param_2, param_3, param_4, param_5, param_6, param_7, param_8) {}
4952
/* 80A7390C */ s32 getEyeballRMaterialNo();
5053
/* 80A73914 */ s32 getEyeballLMaterialNo();
5154
/* 80A7391C */ s32 getHeadJointNo();
5255
/* 80A73924 */ s32 getNeckJointNo();
5356
/* 80A7392C */ s32 getBackboneJointNo();
54-
/* 80A73934 */ void checkChangeJoint(int);
55-
/* 80A73944 */ void checkRemoveJoint(int);
57+
// /* 80A73934 */ void checkChangeJoint(int);
58+
// /* 80A73944 */ void checkRemoveJoint(int);
59+
60+
int getFlowNodeNo() {
61+
u16 nodeNo = home.angle.x;
62+
if (nodeNo == 0xffff) {
63+
return -1;
64+
}
65+
return nodeNo;
66+
}
5667

57-
static void* mCutNameList;
58-
static u8 mCutList[12];
68+
static char* mCutNameList;
69+
static cutFunc mCutList[1];
5970

6071
private:
61-
/* 0x568 */ u8 field_0x568[0xfa0 - 0x568];
72+
/* 0xE40 */ u8 field_0xE40[0xe44 - 0xe40];
73+
/* 0xE44 */ dCcD_Cyl mCyl;
74+
/* 0xF80 */ u8 mType;
6275
};
6376

64-
STATIC_ASSERT(sizeof(daNpc_midP_c) == 0xfa0);
77+
// STATIC_ASSERT(sizeof(daNpc_midP_c) == 0xfa0);
6578

6679
class daNpc_midP_Param_c {
6780
public:
6881
/* 80A73954 */ ~daNpc_midP_Param_c();
6982

70-
static u8 const m[140];
83+
struct Data {
84+
/* 0x00 */ f32 field_0x00;
85+
/* 0x04 */ f32 field_0x04;
86+
/* 0x08 */ f32 field_0x08;
87+
/* 0x0C */ f32 field_0x0c;
88+
/* 0x10 */ f32 field_0x10;
89+
/* 0x14 */ f32 field_0x14;
90+
/* 0x18 */ f32 field_0x18;
91+
/* 0x1C */ f32 field_0x1c;
92+
/* 0x20 */ f32 field_0x20;
93+
/* 0x24 */ f32 field_0x24;
94+
/* 0x28 */ f32 field_0x28;
95+
/* 0x2C */ f32 field_0x2c;
96+
/* 0x30 */ f32 field_0x30;
97+
/* 0x34 */ f32 field_0x34;
98+
/* 0x38 */ f32 field_0x38;
99+
/* 0x3C */ f32 field_0x3c;
100+
/* 0x40 */ f32 field_0x40;
101+
/* 0x44 */ f32 field_0x44;
102+
/* 0x48 */ s16 field_0x48;
103+
/* 0x4A */ s16 field_0x4a;
104+
/* 0x4C */ s16 field_0x4c;
105+
/* 0x4E */ s16 field_0x4e;
106+
/* 0x50 */ f32 field_0x50;
107+
/* 0x54 */ f32 field_0x54;
108+
/* 0x58 */ f32 field_0x58;
109+
/* 0x5C */ f32 field_0x5c;
110+
/* 0x60 */ s16 field_0x60;
111+
/* 0x62 */ s16 field_0x62;
112+
/* 0x64 */ int field_0x64;
113+
/* 0x68 */ int field_0x68;
114+
/* 0x6C */ f32 field_0x6c;
115+
/* 0x70 */ f32 field_0x70;
116+
/* 0x74 */ f32 field_0x74;
117+
/* 0x78 */ f32 field_0x78;
118+
/* 0x7C */ f32 field_0x7c;
119+
/* 0x80 */ f32 field_0x80;
120+
/* 0x84 */ f32 field_0x84;
121+
/* 0x88 */ f32 field_0x88;
122+
};
123+
124+
static const Data m;
71125
};
72126

73127

src/d/actor/d_a_npc.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1432,23 +1432,23 @@ void daNpcT_c::playAllAnm() {
14321432

14331433
/* 801490D4-80149190 143A14 00BC+00 1/0 1/0 55/0 .text ctrlBtk__8daNpcT_cFv */
14341434
BOOL daNpcT_c::ctrlBtk() {
1435-
if (mpMatAnm != NULL) {
1435+
if (mpMatAnm[0] != NULL) {
14361436
if (field_0xe29 != 0 && mBtkAnm.getBtkAnm() != NULL) {
1437-
mpMatAnm->setNowOffsetX(field_0xde4 * cM_ssin(mJntAnm.getEyeAngleY()));
1438-
mpMatAnm->setNowOffsetY(field_0xde0 * cM_ssin(mJntAnm.getEyeAngleX()));
1437+
mpMatAnm[0]->setNowOffsetX(field_0xde4 * cM_ssin(mJntAnm.getEyeAngleY()));
1438+
mpMatAnm[0]->setNowOffsetY(field_0xde0 * cM_ssin(mJntAnm.getEyeAngleX()));
14391439
if (field_0xe2a != 0) {
1440-
mpMatAnm->setMorfFrm(field_0xe2a);
1440+
mpMatAnm[0]->setMorfFrm(field_0xe2a);
14411441
field_0xe2a = 0;
14421442
}
1443-
mpMatAnm->onEyeMoveFlg();
1443+
mpMatAnm[0]->onEyeMoveFlg();
14441444
return TRUE;
14451445
}
14461446

14471447
if (field_0xe2a != 0) {
1448-
mpMatAnm->setMorfFrm(field_0xe2a);
1448+
mpMatAnm[0]->setMorfFrm(field_0xe2a);
14491449
field_0xe2a = 0;
14501450
}
1451-
mpMatAnm->offEyeMoveFlg();
1451+
mpMatAnm[0]->offEyeMoveFlg();
14521452
}
14531453

14541454
return FALSE;

src/d/actor/d_a_npc_gnd.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -711,9 +711,9 @@ COMPILER_STRIP_GATE(0x809BE550, &lit_4391);
711711

712712
/* 809BBE80-809BBF44 000960 00C4+00 1/1 0/0 0/0 .text Draw__11daNpc_Gnd_cFv */
713713
int daNpc_Gnd_c::Draw() {
714-
if (mpMatAnm != NULL) {
714+
if (mpMatAnm[0] != NULL) {
715715
J3DModelData* modelData = mpMorf[0]->getModel()->getModelData();
716-
modelData->getMaterialNodePointer(getEyeballMaterialNo())->setMaterialAnm(mpMatAnm);
716+
modelData->getMaterialNodePointer(getEyeballMaterialNo())->setMaterialAnm(mpMatAnm[0]);
717717
}
718718
return daNpcT_c::draw(0, 0, field_0xde8, NULL, 100.0f, 0, 0, 0);
719719
}

src/d/actor/d_a_npc_hanjo.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -843,8 +843,8 @@ int daNpc_Hanjo_c::CreateHeap() {
843843
modelData->getJointNodePointer(i)->setCallBack(ctrlJointCallBack);
844844
}
845845
model->setUserArea((u32)this);
846-
mpMatAnm = new daNpcT_MatAnm_c();
847-
if (mpMatAnm == NULL) {
846+
mpMatAnm[0] = new daNpcT_MatAnm_c();
847+
if (mpMatAnm[0] == NULL) {
848848
return 0;
849849
}
850850
switch (mType) {
@@ -915,9 +915,9 @@ int daNpc_Hanjo_c::Execute() {
915915

916916
/* 809F9B8C-809F9C20 000BEC 0094+00 1/1 0/0 0/0 .text Draw__13daNpc_Hanjo_cFv */
917917
int daNpc_Hanjo_c::Draw() {
918-
if (mpMatAnm != NULL) {
918+
if (mpMatAnm[0] != NULL) {
919919
J3DModelData* modelData = mpMorf[0]->getModel()->getModelData();
920-
modelData->getMaterialNodePointer(getEyeballMaterialNo())->setMaterialAnm(mpMatAnm);
920+
modelData->getMaterialNodePointer(getEyeballMaterialNo())->setMaterialAnm(mpMatAnm[0]);
921921
}
922922
return daNpcT_c::draw(0, 0, field_0xde8, NULL, 100.0f, 0, 0, 0);
923923
}
@@ -982,8 +982,8 @@ int daNpc_Hanjo_c::isDelete() {
982982
void daNpc_Hanjo_c::reset() {
983983
csXyz acStack_20;
984984
int iVar1 = (u8*)&field_0x1728 - (u8*)&field_0x16e0;
985-
if (mpMatAnm != NULL) {
986-
mpMatAnm->initialize();
985+
if (mpMatAnm[0] != NULL) {
986+
mpMatAnm[0]->initialize();
987987
}
988988
initialize();
989989
for (int i = 0; i < 4; i++) {

src/d/actor/d_a_npc_jagar.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -249,8 +249,8 @@ int daNpc_Jagar_c::CreateHeap() {
249249
modelData->getJointNodePointer(i)->setCallBack(ctrlJointCallBack);
250250
}
251251
model->setUserArea((u32)this);
252-
mpMatAnm = new daNpcT_MatAnm_c();
253-
if (mpMatAnm == NULL) {
252+
mpMatAnm[0] = new daNpcT_MatAnm_c();
253+
if (mpMatAnm[0] == NULL) {
254254
return 0;
255255
}
256256

@@ -275,9 +275,9 @@ int daNpc_Jagar_c::Execute() {
275275

276276
/* 80A14FA0-80A15034 000980 0094+00 1/1 0/0 0/0 .text Draw__13daNpc_Jagar_cFv */
277277
int daNpc_Jagar_c::Draw() {
278-
if (mpMatAnm != NULL) {
278+
if (mpMatAnm[0] != NULL) {
279279
J3DModelData* modelData = mpMorf[0]->getModel()->getModelData();
280-
modelData->getMaterialNodePointer(getEyeballMaterialNo())->setMaterialAnm(mpMatAnm);
280+
modelData->getMaterialNodePointer(getEyeballMaterialNo())->setMaterialAnm(mpMatAnm[0]);
281281
}
282282
return daNpcT_c::draw(0, 0, field_0xde8, NULL, 100.0f, 0, 0, 0);
283283
}
@@ -338,8 +338,8 @@ int daNpc_Jagar_c::isDelete() {
338338
void daNpc_Jagar_c::reset() {
339339
csXyz acStack_20;
340340
int iVar1 = (u8*)&field_0x1008 - (u8*)&field_0xfd4;
341-
if (mpMatAnm != NULL) {
342-
mpMatAnm->initialize();
341+
if (mpMatAnm[0] != NULL) {
342+
mpMatAnm[0]->initialize();
343343
}
344344

345345
initialize();

0 commit comments

Comments
 (0)