Work on create functions of d_a_npc_midp and changed mpMatAnm to array (#2366)

* Work on create functions of d_a_npc_midp and changed mpMatAnm to array

* Pull request cleanup
This commit is contained in:
Carco_21
2025-04-01 13:31:12 -07:00
committed by GitHub
parent 3df4a4b8d5
commit cc7f26c838
10 changed files with 297 additions and 435 deletions
+1 -2
View File
@@ -433,8 +433,7 @@ public:
/* 0x8A0 */ dBgS_AcchCir mAcchCir;
/* 0x8E0 */ request_of_phase_process_class mPhase[10];
/* 0x930 */ cBgS_GndChk mGndChk;
/* 0x96C */ daNpcT_MatAnm_c* mpMatAnm;
/* 0x970 */ u8 field_0x970[4];
/* 0x96C */ daNpcT_MatAnm_c* mpMatAnm[2];
/* 0x974 */ dMsgFlow_c mFlow;
/* 0x9C0 */ dPaPoT_c field_0x9c0;
/* 0xA40 */ dCcD_Stts field_0xa40;
+76 -21
View File
@@ -11,54 +11,68 @@
* @details
*
*/
class daNpc_midP_c : public fopAc_ac_c {
class daNpc_midP_c : public daNpcT_c {
public:
typedef int (daNpc_midP_c::*cutFunc)(int);
/* 80A70C6C */ ~daNpc_midP_c();
/* 80A70D90 */ void create();
/* 80A71074 */ void CreateHeap();
/* 80A70D90 */ int create();
/* 80A71074 */ int CreateHeap();
/* 80A714BC */ void Delete();
/* 80A714F0 */ void Execute();
/* 80A71510 */ void Draw();
/* 80A715D4 */ void createHeapCallBack(fopAc_ac_c*);
/* 80A715F4 */ void ctrlJointCallBack(J3DJoint*, int);
/* 80A7164C */ void getType();
/* 80A7166C */ void isDelete();
/* 80A715D4 */ static int createHeapCallBack(fopAc_ac_c*);
/* 80A715F4 */ static int ctrlJointCallBack(J3DJoint*, int);
/* 80A7164C */ u8 getType();
/* 80A7166C */ int isDelete();
/* 80A7168C */ void reset();
/* 80A717D4 */ void afterJntAnm(int);
/* 80A71860 */ void ctrlBtk();
/* 80A71860 */ BOOL ctrlBtk();
/* 80A7199C */ void setParam();
/* 80A71A98 */ void setAfterTalkMotion();
/* 80A71AF8 */ void srchActors();
/* 80A71AFC */ void evtTalk();
/* 80A71BFC */ void evtCutProc();
/* 80A71AFC */ BOOL evtTalk();
/* 80A71BFC */ BOOL evtCutProc();
/* 80A71CC4 */ void action();
/* 80A71DB0 */ void beforeMove();
/* 80A71E28 */ void setAttnPos();
/* 80A72064 */ void setCollision();
/* 80A7216C */ bool drawDbgInfo();
/* 80A7216C */ int drawDbgInfo();
/* 80A72174 */ void drawGhost();
/* 80A721E0 */ void selectAction();
/* 80A72228 */ void chkAction(int (daNpc_midP_c::*)(void*));
/* 80A72254 */ void setAction(int (daNpc_midP_c::*)(void*));
/* 80A722FC */ void wait(void*);
/* 80A72548 */ void talk(void*);
/* 80A737D0 */ daNpc_midP_c(daNpcT_faceMotionAnmData_c const*, daNpcT_motionAnmData_c const*,
daNpcT_MotionSeqMngr_c::sequenceStepData_c const*, int,
daNpcT_MotionSeqMngr_c::sequenceStepData_c const*, int,
daNpcT_evtData_c const*, char**);
/* 80A737D0 */ daNpc_midP_c(daNpcT_faceMotionAnmData_c const* param_1, daNpcT_motionAnmData_c const* param_2,
daNpcT_MotionSeqMngr_c::sequenceStepData_c const* param_3, int param_4,
daNpcT_MotionSeqMngr_c::sequenceStepData_c const* param_5, int param_6,
daNpcT_evtData_c const* param_7, char** param_8) :
daNpcT_c(param_1, param_2, param_3, param_4, param_5, param_6, param_7, param_8) {}
/* 80A7390C */ s32 getEyeballRMaterialNo();
/* 80A73914 */ s32 getEyeballLMaterialNo();
/* 80A7391C */ s32 getHeadJointNo();
/* 80A73924 */ s32 getNeckJointNo();
/* 80A7392C */ s32 getBackboneJointNo();
/* 80A73934 */ void checkChangeJoint(int);
/* 80A73944 */ void checkRemoveJoint(int);
/* 80A73934 */ BOOL checkChangeJoint(int);
/* 80A73944 */ BOOL checkRemoveJoint(int);
static void* mCutNameList;
static u8 mCutList[12];
int getFlowNodeNo() {
u16 nodeNo = home.angle.x;
if (nodeNo == 0xffff) {
return -1;
}
return nodeNo;
}
static char* mCutNameList;
static cutFunc mCutList[1];
private:
/* 0x568 */ u8 field_0x568[0xfa0 - 0x568];
/* 0xE40 */ u8 field_0xE40[0xe44 - 0xe40];
/* 0xE44 */ dCcD_Cyl mCyl;
/* 0xF80 */ u8 mType;
/* 0xF81 */ u8 field_0xf81[0xfa0-0xf81];
};
STATIC_ASSERT(sizeof(daNpc_midP_c) == 0xfa0);
@@ -67,7 +81,48 @@ class daNpc_midP_Param_c {
public:
/* 80A73954 */ ~daNpc_midP_Param_c();
static u8 const m[140];
struct Data {
/* 0x00 */ f32 field_0x00;
/* 0x04 */ f32 field_0x04;
/* 0x08 */ f32 field_0x08;
/* 0x0C */ f32 field_0x0c;
/* 0x10 */ f32 field_0x10;
/* 0x14 */ f32 field_0x14;
/* 0x18 */ f32 field_0x18;
/* 0x1C */ f32 field_0x1c;
/* 0x20 */ f32 field_0x20;
/* 0x24 */ f32 field_0x24;
/* 0x28 */ f32 field_0x28;
/* 0x2C */ f32 field_0x2c;
/* 0x30 */ f32 field_0x30;
/* 0x34 */ f32 field_0x34;
/* 0x38 */ f32 field_0x38;
/* 0x3C */ f32 field_0x3c;
/* 0x40 */ f32 field_0x40;
/* 0x44 */ f32 field_0x44;
/* 0x48 */ s16 field_0x48;
/* 0x4A */ s16 field_0x4a;
/* 0x4C */ s16 field_0x4c;
/* 0x4E */ s16 field_0x4e;
/* 0x50 */ f32 field_0x50;
/* 0x54 */ f32 field_0x54;
/* 0x58 */ f32 field_0x58;
/* 0x5C */ f32 field_0x5c;
/* 0x60 */ s16 field_0x60;
/* 0x62 */ s16 field_0x62;
/* 0x64 */ int field_0x64;
/* 0x68 */ int field_0x68;
/* 0x6C */ f32 field_0x6c;
/* 0x70 */ f32 field_0x70;
/* 0x74 */ f32 field_0x74;
/* 0x78 */ f32 field_0x78;
/* 0x7C */ f32 field_0x7c;
/* 0x80 */ f32 field_0x80;
/* 0x84 */ f32 field_0x84;
/* 0x88 */ f32 field_0x88;
};
static const Data m;
};
+7 -7
View File
@@ -1432,23 +1432,23 @@ void daNpcT_c::playAllAnm() {
/* 801490D4-80149190 143A14 00BC+00 1/0 1/0 55/0 .text ctrlBtk__8daNpcT_cFv */
BOOL daNpcT_c::ctrlBtk() {
if (mpMatAnm != NULL) {
if (mpMatAnm[0] != NULL) {
if (field_0xe29 != 0 && mBtkAnm.getBtkAnm() != NULL) {
mpMatAnm->setNowOffsetX(field_0xde4 * cM_ssin(mJntAnm.getEyeAngleY()));
mpMatAnm->setNowOffsetY(field_0xde0 * cM_ssin(mJntAnm.getEyeAngleX()));
mpMatAnm[0]->setNowOffsetX(field_0xde4 * cM_ssin(mJntAnm.getEyeAngleY()));
mpMatAnm[0]->setNowOffsetY(field_0xde0 * cM_ssin(mJntAnm.getEyeAngleX()));
if (field_0xe2a != 0) {
mpMatAnm->setMorfFrm(field_0xe2a);
mpMatAnm[0]->setMorfFrm(field_0xe2a);
field_0xe2a = 0;
}
mpMatAnm->onEyeMoveFlg();
mpMatAnm[0]->onEyeMoveFlg();
return TRUE;
}
if (field_0xe2a != 0) {
mpMatAnm->setMorfFrm(field_0xe2a);
mpMatAnm[0]->setMorfFrm(field_0xe2a);
field_0xe2a = 0;
}
mpMatAnm->offEyeMoveFlg();
mpMatAnm[0]->offEyeMoveFlg();
}
return FALSE;
+2 -2
View File
@@ -711,9 +711,9 @@ COMPILER_STRIP_GATE(0x809BE550, &lit_4391);
/* 809BBE80-809BBF44 000960 00C4+00 1/1 0/0 0/0 .text Draw__11daNpc_Gnd_cFv */
int daNpc_Gnd_c::Draw() {
if (mpMatAnm != NULL) {
if (mpMatAnm[0] != NULL) {
J3DModelData* modelData = mpMorf[0]->getModel()->getModelData();
modelData->getMaterialNodePointer(getEyeballMaterialNo())->setMaterialAnm(mpMatAnm);
modelData->getMaterialNodePointer(getEyeballMaterialNo())->setMaterialAnm(mpMatAnm[0]);
}
return daNpcT_c::draw(0, 0, field_0xde8, NULL, 100.0f, 0, 0, 0);
}
+6 -6
View File
@@ -843,8 +843,8 @@ int daNpc_Hanjo_c::CreateHeap() {
modelData->getJointNodePointer(i)->setCallBack(ctrlJointCallBack);
}
model->setUserArea((u32)this);
mpMatAnm = new daNpcT_MatAnm_c();
if (mpMatAnm == NULL) {
mpMatAnm[0] = new daNpcT_MatAnm_c();
if (mpMatAnm[0] == NULL) {
return 0;
}
switch (mType) {
@@ -915,9 +915,9 @@ int daNpc_Hanjo_c::Execute() {
/* 809F9B8C-809F9C20 000BEC 0094+00 1/1 0/0 0/0 .text Draw__13daNpc_Hanjo_cFv */
int daNpc_Hanjo_c::Draw() {
if (mpMatAnm != NULL) {
if (mpMatAnm[0] != NULL) {
J3DModelData* modelData = mpMorf[0]->getModel()->getModelData();
modelData->getMaterialNodePointer(getEyeballMaterialNo())->setMaterialAnm(mpMatAnm);
modelData->getMaterialNodePointer(getEyeballMaterialNo())->setMaterialAnm(mpMatAnm[0]);
}
return daNpcT_c::draw(0, 0, field_0xde8, NULL, 100.0f, 0, 0, 0);
}
@@ -982,8 +982,8 @@ int daNpc_Hanjo_c::isDelete() {
void daNpc_Hanjo_c::reset() {
csXyz acStack_20;
int iVar1 = (u8*)&field_0x1728 - (u8*)&field_0x16e0;
if (mpMatAnm != NULL) {
mpMatAnm->initialize();
if (mpMatAnm[0] != NULL) {
mpMatAnm[0]->initialize();
}
initialize();
for (int i = 0; i < 4; i++) {
+6 -6
View File
@@ -249,8 +249,8 @@ int daNpc_Jagar_c::CreateHeap() {
modelData->getJointNodePointer(i)->setCallBack(ctrlJointCallBack);
}
model->setUserArea((u32)this);
mpMatAnm = new daNpcT_MatAnm_c();
if (mpMatAnm == NULL) {
mpMatAnm[0] = new daNpcT_MatAnm_c();
if (mpMatAnm[0] == NULL) {
return 0;
}
@@ -275,9 +275,9 @@ int daNpc_Jagar_c::Execute() {
/* 80A14FA0-80A15034 000980 0094+00 1/1 0/0 0/0 .text Draw__13daNpc_Jagar_cFv */
int daNpc_Jagar_c::Draw() {
if (mpMatAnm != NULL) {
if (mpMatAnm[0] != NULL) {
J3DModelData* modelData = mpMorf[0]->getModel()->getModelData();
modelData->getMaterialNodePointer(getEyeballMaterialNo())->setMaterialAnm(mpMatAnm);
modelData->getMaterialNodePointer(getEyeballMaterialNo())->setMaterialAnm(mpMatAnm[0]);
}
return daNpcT_c::draw(0, 0, field_0xde8, NULL, 100.0f, 0, 0, 0);
}
@@ -338,8 +338,8 @@ int daNpc_Jagar_c::isDelete() {
void daNpc_Jagar_c::reset() {
csXyz acStack_20;
int iVar1 = (u8*)&field_0x1008 - (u8*)&field_0xfd4;
if (mpMatAnm != NULL) {
mpMatAnm->initialize();
if (mpMatAnm[0] != NULL) {
mpMatAnm[0]->initialize();
}
initialize();
File diff suppressed because it is too large Load Diff
+6 -6
View File
@@ -451,8 +451,8 @@ int daNpc_Yelia_c::CreateHeap() {
}
model->setUserArea((u32)this);
mpMatAnm = new daNpcT_MatAnm_c();
if (mpMatAnm == NULL) {
mpMatAnm[0] = new daNpcT_MatAnm_c();
if (mpMatAnm[0] == NULL) {
return 0;
}
@@ -484,9 +484,9 @@ int daNpc_Yelia_c::Execute() {
/* 80B4DC74-80B4DD08 000A54 0094+00 1/1 0/0 0/0 .text Draw__13daNpc_Yelia_cFv */
int daNpc_Yelia_c::Draw() {
if (mpMatAnm != NULL) {
if (mpMatAnm[0] != NULL) {
J3DModelData* model_data = mpMorf[0]->getModel()->getModelData();
model_data->getMaterialNodePointer(getEyeballMaterialNo())->setMaterialAnm(mpMatAnm);
model_data->getMaterialNodePointer(getEyeballMaterialNo())->setMaterialAnm(mpMatAnm[0]);
}
return draw(FALSE, FALSE, field_0xde8, NULL, 100.0f, FALSE, FALSE, FALSE);
}
@@ -565,8 +565,8 @@ BOOL daNpc_Yelia_c::isDelete() {
/* 80B4DF10-80B4E068 000CF0 0158+00 1/1 0/0 0/0 .text reset__13daNpc_Yelia_cFv */
void daNpc_Yelia_c::reset() {
u32 size = (u32)&field_0xfec - (u32)&mpNextAction;
if (mpMatAnm != NULL) {
mpMatAnm->initialize();
if (mpMatAnm[0] != NULL) {
mpMatAnm[0]->initialize();
}
initialize();
for (int i = 0; i < 4; i++) {
+4 -4
View File
@@ -181,9 +181,9 @@ int daNpc_Zant_c::Execute() {
/* 80B6C754-80B6C7E8 000694 0094+00 1/1 0/0 0/0 .text Draw__12daNpc_Zant_cFv */
int daNpc_Zant_c::Draw() {
if (mpMatAnm != NULL) {
if (mpMatAnm[0] != NULL) {
J3DModelData* modelData = mpMorf[0]->getModel()->getModelData();
modelData->getMaterialNodePointer(getEyeballMaterialNo())->setMaterialAnm(mpMatAnm);
modelData->getMaterialNodePointer(getEyeballMaterialNo())->setMaterialAnm(mpMatAnm[0]);
}
return daNpcT_c::draw(0, 0, field_0xde8, NULL, 0.0f, 1, 0, 0);
}
@@ -245,8 +245,8 @@ void daNpc_Zant_c::reset() {
int iVar1 = (u8*)&field_0xf9c - (u8*)&field_0xf84;
memset(&field_0xf84, 0, iVar1);
if (mpMatAnm) {
mpMatAnm->initialize();
if (mpMatAnm[0]) {
mpMatAnm[0]->initialize();
}
setAngle(home.angle.y);
+5 -5
View File
@@ -245,8 +245,8 @@ int daPeru_c::CreateHeap() {
}
model->setUserArea((u32)this);
mpMatAnm = new daNpcT_MatAnm_c();
if (mpMatAnm == NULL) {
mpMatAnm[0] = new daNpcT_MatAnm_c();
if (mpMatAnm[0] == NULL) {
return 0;
}
@@ -293,7 +293,7 @@ int daPeru_c::Execute() {
/* 80D477A4-80D47840 0009A4 009C+00 1/1 0/0 0/0 .text Draw__8daPeru_cFv */
int daPeru_c::Draw() {
daNpcT_MatAnm_c* matAnm = mpMatAnm;
daNpcT_MatAnm_c* matAnm = mpMatAnm[0];
if (matAnm != NULL) {
J3DModelData* modelData = mpMorf[0]->getModel()->getModelData();
u16 eyeballMat = getEyeballMaterialNo();
@@ -351,8 +351,8 @@ void daPeru_c::reset() {
field_0xa80 = daPeru_Param_c::m.field_0x64[2];
mMorfFrames = daPeru_Param_c::m.field_0x00[17];
mActionFunc = NULL;
if (mpMatAnm != NULL) {
mpMatAnm->initialize();
if (mpMatAnm[0] != NULL) {
mpMatAnm[0]->initialize();
}
field_0xe80 = 0;
for (int i = 0; i < 3; i++) {