actor enum, m_Do_ext fixes

This commit is contained in:
Jasper St. Pierre 2023-09-10 12:35:28 -07:00
parent aa738135ed
commit ef45f47306
5 changed files with 96 additions and 116 deletions

View File

@ -14,11 +14,69 @@ struct actor_method_class {
/* 0x14 */ u8 field_0x14[0xC]; // Likely padding
};
enum fopAc_Status_e {
fopAcStts_SHOWMAP_e = 0x00000020,
fopAcStts_NOEXEC_e = 0x00000080,
fopAcStts_CULLSTOP_e = 0x00000100,
fopAcStts_FREEZE_e = 0x00000400,
fopAcStts_CARRY_e = 0x00002000,
fopAcStts_NOPAUSE_e = 0x00020000,
fopAcStts_NODRAW_e = 0x01000000,
fopAcStts_BOSS_e = 0x04000000,
};
enum fopAc_Condition_e {
fopAcCnd_NOEXEC_e = 0x02,
fopAcCnd_NODRAW_e = 0x04,
fopAcCnd_INIT_e = 0x08,
};
enum fopAc_Group_e {
fopAc_ACTOR_e,
fopAc_PLAYER_e,
fopAc_ENEMY_e,
fopAc_ENV_e,
fopAc_NPC_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_8_e,
fopAc_CULLSPHERE_9_e,
fopAc_CULLSPHERE_10_e,
fopAc_CULLSPHERE_11_e,
fopAc_CULLSPHERE_12_e,
fopAc_CULLSPHERE_13_e,
fopAc_CULLSPHERE_CUSTOM_e,
};
struct actor_process_profile_definition {
/* 0x00 */ leaf_process_profile_definition mBase;
/* 0x24 */ actor_method_class* mSubMtd;
/* 0x28 */ u32 mStatus;
/* 0x2C */ u8 mActorType;
/* 0x2C */ u8 mGroup;
/* 0x2D */ u8 mCullType;
};
@ -28,10 +86,6 @@ struct actor_process_profile_definition2 {
/* 0x30 */ u32 field_0x30;
};
enum {
ACTOR_TYPE_ENEMY = 2,
};
class JKRSolidHeap;
class dEvt_info_c {

View File

@ -7,9 +7,9 @@
#include "f_pc/f_pc_searcher.h"
#define fopAcM_SetupActor(ptr,ClassName) \
if (!fopAcM_CheckCondition(ptr, 8)) { \
if (!fopAcM_CheckCondition(ptr, fopAcCnd_INIT_e)) { \
new (ptr) ClassName(); \
fopAcM_OnCondition(ptr, 8); \
fopAcM_OnCondition(ptr, fopAcCnd_INIT_e); \
}
class J3DModelData; // placeholder

View File

@ -11,33 +11,35 @@ class JKRHeap;
class JKRSolidHeap;
struct ResTIMG;
class Z2Creature;
class J3DTexMtxAnm;
class mDoExt_baseAnm {
public:
mDoExt_baseAnm() {}
/* 8000D320 */ int initPlay(s16 i_frameMax, int i_attribute, f32 i_rate, s16 i_startF,
s16 i_endF);
/* 8000D428 */ int play();
virtual ~mDoExt_baseAnm() {}
J3DFrameCtrl* getFrameCtrl() { return &mFrameCtrl; }
f32 getPlaySpeed() { return mFrameCtrl.getRate(); }
void setPlaySpeed(f32 speed) { mFrameCtrl.setRate(speed); }
f32 getFrame() { return mFrameCtrl.getFrame(); }
f32 getEndFrame() { return mFrameCtrl.getEnd(); }
void setFrame(f32 frame) { mFrameCtrl.setFrame(frame); }
void setPlayMode(int i_mode) { mFrameCtrl.setAttribute(i_mode); }
void setLoopFrame(f32 i_frame) { mFrameCtrl.setLoop(i_frame); }
int initPlay(s16 i_frameMax, int i_attribute, f32 i_rate, s16 i_startF, s16 i_endF);
int play();
J3DFrameCtrl* getFrameCtrl() { return mpFrameCtrl; }
f32 getPlaySpeed() { return mpFrameCtrl->getRate(); }
void setPlaySpeed(f32 speed) { mpFrameCtrl->setRate(speed); }
f32 getFrame() { return mpFrameCtrl->getFrame(); }
f32 getEndFrame() { return mpFrameCtrl->getEnd(); }
void setFrame(f32 frame) { mpFrameCtrl->setFrame(frame); }
void setPlayMode(int i_mode) { mpFrameCtrl->setAttribute(i_mode); }
void setLoopFrame(f32 i_frame) { mpFrameCtrl->setLoop(i_frame); }
bool isStop() {
bool stopped = true;
if (!mFrameCtrl.checkState(1) && mFrameCtrl.getRate() != 0.0f) {
if (!mpFrameCtrl->checkState(1) && mpFrameCtrl->getRate() != 0.0f) {
stopped = false;
}
return stopped;
}
private:
/* 0x0 */ J3DFrameCtrl mFrameCtrl;
}; // Size: 0x14
/* 0x4 */ J3DFrameCtrl* mpFrameCtrl;
}; // Size: 0x08
class mDoExt_btkAnm : public mDoExt_baseAnm {
public:
@ -61,66 +63,12 @@ public:
J3DAnmTextureSRTKey* getBtkAnm() const { return mpAnm; }
private:
/* 0x14 */ J3DAnmTextureSRTKey* mpAnm;
}; // Size: 0x18
/* 0x08 */ J3DAnmTextureSRTKey* mpAnm;
/* 0x0C */ J3DTexMtxAnm* mpTexMtxAnm;
/* 0x10 */ s16 mUpdateMaterialNum;
}; // Size: 0x14
STATIC_ASSERT(sizeof(mDoExt_btkAnm) == 0x18);
class mDoExt_brkAnm : public mDoExt_baseAnm {
public:
mDoExt_brkAnm() { mpAnm = 0; }
/* 8000D70C */ int init(J3DMaterialTable* i_matTable, J3DAnmTevRegKey* i_brk, int i_anmPlay,
int i_attribute, f32 i_rate, s16 i_start, s16 param_6);
/* 8000D7A8 */ void entry(J3DMaterialTable* i_matTable, f32 i_frame);
void entry(J3DModelData* i_modelData) { entry(i_modelData, getFrame()); }
void entry(J3DModelData* i_modelData, f32 i_frame) {
entry(&i_modelData->getMaterialTable(), i_frame);
}
int init(J3DModelData* i_modelData, J3DAnmTevRegKey* i_brk, int i_anmPlay, int i_attribute,
f32 i_rate, s16 i_start, s16 param_6) {
return init(&i_modelData->getMaterialTable(), i_brk, i_anmPlay, i_attribute, i_rate,
i_start, param_6);
}
int remove(J3DModelData* i_modelData) { return i_modelData->removeTevRegAnimator(mpAnm); }
void entryFrame() { entryFrame(getFrame()); }
void entryFrame(f32 frame) { mpAnm->setFrame(frame); }
J3DAnmTevRegKey* getBrkAnm() const { return mpAnm; }
private:
/* 0x14 */ J3DAnmTevRegKey* mpAnm;
}; // Size: 0x18
STATIC_ASSERT(sizeof(mDoExt_brkAnm) == 0x18);
class mDoExt_bpkAnm : public mDoExt_baseAnm {
public:
mDoExt_bpkAnm() { mpAnm = 0; }
/* 8000D47C */ int init(J3DMaterialTable* i_matTable, J3DAnmColor* i_bpk, int i_anmPlay,
int i_attribute, f32 i_rate, s16 i_start, s16 param_6);
/* 8000D518 */ void entry(J3DMaterialTable* i_matTable, f32 i_frame);
void entry(J3DModelData* i_modelData) { entry(i_modelData, getFrame()); }
void entry(J3DModelData* i_modelData, f32 i_frame) {
entry(&i_modelData->getMaterialTable(), i_frame);
}
int init(J3DModelData* i_modelData, J3DAnmColor* i_bpk, int i_anmPlay, int i_attribute,
f32 i_rate, s16 i_start, s16 param_6) {
return init(&i_modelData->getMaterialTable(), i_bpk, i_anmPlay, i_attribute, i_rate,
i_start, param_6);
}
int remove(J3DModelData* i_modelData) { return i_modelData->removeMatColorAnimator(mpAnm); }
private:
/* 0x14 */ J3DAnmColor* mpAnm;
}; // Size: 0x18
STATIC_ASSERT(sizeof(mDoExt_bpkAnm) == 0x18);
STATIC_ASSERT(sizeof(mDoExt_btkAnm) == 0x14);
class mDoExt_bckAnm : public mDoExt_baseAnm {
public:
@ -143,35 +91,11 @@ public:
}
private:
/* 0x14 */ J3DAnmTransform* mAnm;
/* 0x18 */ J3DMtxCalc* mpMtxCalc;
}; // Size: 0x1C
/* 0x08 */ J3DAnmTransform* mAnm;
/* 0x0C */ J3DMtxCalc* mpMtxCalc;
}; // Size: 0x10
STATIC_ASSERT(sizeof(mDoExt_bckAnm) == 0x1C);
class mDoExt_btpAnm : public mDoExt_baseAnm {
public:
mDoExt_btpAnm() { mpAnm = NULL; }
/* 8000D54C */ int init(J3DMaterialTable* i_matTable, J3DAnmTexPattern* i_btk, int i_anmPlay,
int i_attribute, f32 i_rate, s16 i_start, s16 param_6);
/* 8000D5E8 */ void entry(J3DMaterialTable* i_matTable, s16 i_frame);
void entry(J3DModelData* i_modelData) { entry(i_modelData, getFrame()); }
void entry(J3DModelData* i_modelData, s16 i_frame) {
entry(&i_modelData->getMaterialTable(), i_frame);
}
int init(J3DModelData* i_modelData, J3DAnmTexPattern* i_btk, int i_anmPlay, int i_attribute,
f32 i_rate, s16 i_start, s16 param_6) {
return init(&i_modelData->getMaterialTable(), i_btk, i_anmPlay, i_attribute, i_rate,
i_start, param_6);
}
int remove(J3DModelData* i_modelData) { return i_modelData->removeTexNoAnimator(mpAnm); }
private:
/* 0x14 */ J3DAnmTexPattern* mpAnm;
};
STATIC_ASSERT(sizeof(mDoExt_bckAnm) == 0x10);
J3DModel* mDoExt_J3DModel__create(J3DModelData* i_modelData, u32 i_modelFlag, u32 i_differedDlistFlag);

View File

@ -144,9 +144,9 @@ extern actor_process_profile_definition g_profile_ALLDIE = {
0,
0,
&g_fopAc_Method.base,
0x0116,
0x011D,
&l_daAlldie_Method,
0x00044000,
0,
6,
fopAc_ACTOR_e,
fopAc_CULLBOX_6_e,
};

View File

@ -41,6 +41,8 @@ public:
daObjGryw00_c * mpGryw00;
};
STATIC_ASSERT(sizeof(mDoExt_btkAnm) == 0x14);
/* 00000078-0000009C .text solidHeapCB__14daObjYgush00_cFP10fopAc_ac_c */
s32 daObjYgush00_c::solidHeapCB(fopAc_ac_c* ac) {
return ((daObjYgush00_c*)ac)->create_heap();
@ -169,7 +171,7 @@ static actor_method_class l_daObjYgush00_Mehtod = {
extern actor_process_profile_definition g_profile_Obj_Ygish00 = {
-3,
2,
3,
0xFFFD,
PROC_Obj_Ygush00,
&g_fpcLf_Method.mBase,
@ -177,9 +179,9 @@ extern actor_process_profile_definition g_profile_Obj_Ygish00 = {
0,
0,
&g_fopAc_Method.base,
0x0116,
0x005E,
&l_daObjYgush00_Mehtod,
0x00044000,
0,
6,
0x00040100,
fopAc_ACTOR_e,
fopAc_CULLBOX_CUSTOM_e,
};