Skip to content

Commit

Permalink
actor enum, m_Do_ext fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
magcius committed Sep 10, 2023
1 parent aa73813 commit ef45f47
Show file tree
Hide file tree
Showing 5 changed files with 97 additions and 117 deletions.
64 changes: 59 additions & 5 deletions include/f_op/f_op_actor.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};

Expand All @@ -28,10 +86,6 @@ struct actor_process_profile_definition2 {
/* 0x30 */ u32 field_0x30;
};

enum {
ACTOR_TYPE_ENEMY = 2,
};

class JKRSolidHeap;

class dEvt_info_c {
Expand Down
4 changes: 2 additions & 2 deletions include/f_op/f_op_actor_mng.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
128 changes: 26 additions & 102 deletions include/m_Do/m_Do_ext.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();

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); }
virtual ~mDoExt_baseAnm() {}

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:
Expand All @@ -61,66 +63,12 @@ class mDoExt_btkAnm : public mDoExt_baseAnm {
J3DAnmTextureSRTKey* getBtkAnm() const { return mpAnm; }

private:
/* 0x14 */ J3DAnmTextureSRTKey* mpAnm;
}; // Size: 0x18

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
/* 0x08 */ J3DAnmTextureSRTKey* mpAnm;
/* 0x0C */ J3DTexMtxAnm* mpTexMtxAnm;
/* 0x10 */ s16 mUpdateMaterialNum;
}; // Size: 0x14

STATIC_ASSERT(sizeof(mDoExt_bpkAnm) == 0x18);
STATIC_ASSERT(sizeof(mDoExt_btkAnm) == 0x14);

class mDoExt_bckAnm : public mDoExt_baseAnm {
public:
Expand All @@ -143,35 +91,11 @@ class mDoExt_bckAnm : public mDoExt_baseAnm {
}

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);

Expand Down
6 changes: 3 additions & 3 deletions src/d/actor/d_a_alldie.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
12 changes: 7 additions & 5 deletions src/d/actor/d_a_obj_Ygush00.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ struct daObjYgush00_c : public fopAc_ac_c {
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();
Expand Down Expand Up @@ -169,17 +171,17 @@ 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,
sizeof(daObjYgush00_c),
0,
0,
&g_fopAc_Method.base,
0x0116,
0x005E,
&l_daObjYgush00_Mehtod,
0x00044000,
0,
6,
0x00040100,
fopAc_ACTOR_e,
fopAc_CULLBOX_CUSTOM_e,
};

0 comments on commit ef45f47

Please sign in to comment.