diff options
| author | TakaRikka <38417346+TakaRikka@users.noreply.github.com> | 2023-09-07 21:22:55 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-09-07 21:22:55 -0700 |
| commit | 6deaa22a19c725fa62ee4db8eb6ec5a07e60b22f (patch) | |
| tree | 3f39d25656c0b19fc4d521f6b30d942e5df1fc24 /include | |
| parent | 3dd1963a59c4cf80c0348f10532d2ce445dec7de (diff) | |
d_a_npc / d_a_tag_mhint / d_a_grass work (#1916)
* some npc work / cleanup
* tag_mhint / grass work
* fix path / remove asm
Diffstat (limited to 'include')
| -rw-r--r-- | include/d/a/d_a_alink.h | 29 | ||||
| -rw-r--r-- | include/d/a/d_a_npc.h | 12 | ||||
| -rw-r--r-- | include/d/cc/d_cc_mass_s.h | 1 | ||||
| -rw-r--r-- | include/d/cc/d_cc_s.h | 2 | ||||
| -rw-r--r-- | include/d/com/d_com_inf_game.h | 4 | ||||
| -rw-r--r-- | include/d/d_npc_lib.h | 3 | ||||
| -rw-r--r-- | include/d/d_stage.h | 4 | ||||
| -rw-r--r-- | include/m_Do/m_Do_ext.h | 6 | ||||
| -rw-r--r-- | include/rel/d/a/d_a_grass/d_a_grass.h | 208 | ||||
| -rw-r--r-- | include/rel/d/a/tag/d_a_tag_mhint/d_a_tag_mhint.h | 8 | ||||
| -rw-r--r-- | include/rel/d/a/tag/d_a_tag_wljump/d_a_tag_wljump.h | 4 |
11 files changed, 235 insertions, 46 deletions
diff --git a/include/d/a/d_a_alink.h b/include/d/a/d_a_alink.h index bc98e385ea..fcc4f4e2f0 100644 --- a/include/d/a/d_a_alink.h +++ b/include/d/a/d_a_alink.h @@ -6365,39 +6365,22 @@ public: } bool checkShadowModelDrawSmode() const { - if (field_0x84e != 3 && field_0x84e != 4) { - if (field_0x84e == 2) { - return false; - } - } - return true; + return field_0x84e == 3 || field_0x84e == 4 || field_0x84e == 2; } - int checkShadowModelDraw() const { - int ret = 0; - - if (checkShadowModelDrawDemoForce() == 0) { - if (checkShadowModelDrawSmode() != 0) { - ret = 0; - } - } - - return ret; + bool checkShadowModelDraw() const { + return checkShadowModelDrawDemoForce() || checkShadowModelDrawSmode(); } - int checkShadowReturnEnd() const { - if (field_0x5e4[0].getIdx() == 0x21C && !field_0x578->isStop()) { - return 1; - } - - return 0; + bool checkShadowReturnEnd() const { + return field_0x5e4[0].getIdx() == 0x21C && field_0x578->isStop(); } bool checkShadowModeTalkWait() const { return (field_0x84e == 2 || field_0x84e == 1) ; } - void setShadowReturn() { mDemoType = 4; } + void setShadowReturn() { field_0x84e = 4; } bool checkPortalObjRide() const { diff --git a/include/d/a/d_a_npc.h b/include/d/a/d_a_npc.h index f19d7bf4a4..4cda66ba8b 100644 --- a/include/d/a/d_a_npc.h +++ b/include/d/a/d_a_npc.h @@ -290,7 +290,7 @@ public: /* 0xE1E */ u16 field_0xe1e; /* 0xE20 */ u16 field_0xe20; /* 0xE22 */ u16 field_0xe22; - /* 0xE24 */ u8 field_0xe24; + /* 0xE24 */ s8 field_0xe24; /* 0xE25 */ u8 field_0xe25; /* 0xE26 */ u8 field_0xe26; /* 0xE27 */ u8 field_0xe27; @@ -422,8 +422,8 @@ public: } static u8 const mCcDObjData[48]; - static u8 mCcDCyl[68]; - static u8 mCcDSph[64]; + static dCcD_SrcCyl mCcDCyl; + static dCcD_SrcSph mCcDSph; static fopAc_ac_c* mFindActorPtrs[50]; static s16 mSrchName; static s32 mFindCount; @@ -643,7 +643,7 @@ public: static u8 const mCcDObjInfo[48]; static dCcD_SrcCyl mCcDCyl; - static u8 mCcDSph[64]; + static dCcD_SrcSph mCcDSph; static fopAc_ac_c* mFindActorPList[100]; static s32 mFindCount; static s16 mSrchActorName; @@ -794,8 +794,8 @@ public: void setVtable(void* table) { vtable = table;} static u8 const mCcDObj[48]; - static u8 mCcDCyl[68]; - static u8 mCcDSph[64]; + static dCcD_SrcCyl mCcDCyl; + static dCcD_SrcSph mCcDSph; }; class daBaseNpc_moveBgActor_c : public daBaseNpc_c { diff --git a/include/d/cc/d_cc_mass_s.h b/include/d/cc/d_cc_mass_s.h index 0c0a009f9d..8cdd855acf 100644 --- a/include/d/cc/d_cc_mass_s.h +++ b/include/d/cc/d_cc_mass_s.h @@ -41,6 +41,7 @@ public: void SetCoHitObj(cCcD_Obj* obj) { mpCoObj = obj; } void SetAtHitObj(cCcD_Obj* obj) { mpAtObj = obj; } void SetCoHitLen(f32 len) { mCoHitLen = len; } + cCcD_Obj* GetAtHitObj() const { return mpAtObj; } }; class dCcMassS_Mng { diff --git a/include/d/cc/d_cc_s.h b/include/d/cc/d_cc_s.h index b2442d2563..7fbfb54a32 100644 --- a/include/d/cc/d_cc_s.h +++ b/include/d/cc/d_cc_s.h @@ -46,10 +46,10 @@ public: /* 80086754 */ virtual void CalcParticleAngle(dCcD_GObjInf*, cCcD_Stts*, cCcD_Stts*, csXyz*); void SetMass(cCcD_Obj* i_obj, u8 i_priority) { mMass_Mng.Set(i_obj, i_priority); } + void PrepareMass() { mMass_Mng.Prepare(); } static u8 m_mtrl_hit_tbl[64]; -private: // /* 0x0000 */ cCcS mCCcS; /* 0x284C */ dCcMassS_Mng mMass_Mng; }; // Size = 0x2AC4 diff --git a/include/d/com/d_com_inf_game.h b/include/d/com/d_com_inf_game.h index 12d4847d0f..4b0ca4b2e9 100644 --- a/include/d/com/d_com_inf_game.h +++ b/include/d/com/d_com_inf_game.h @@ -1831,6 +1831,10 @@ inline u8 dComIfGp_att_getCatchChgItem() { return dComIfGp_getAttention().getCatchChgItem(); } +inline int dComIfGp_att_ZHintRequest(fopAc_ac_c *param_1, int param_2) { + return dComIfGp_getAttention().ZHintRequest(param_1, param_2); +} + inline void dComIfGp_att_LookRequest(fopAc_ac_c* param_0, f32 i_horizontalDist, f32 i_upDist, f32 i_downDist, s16 i_angle, int param_5) { dComIfGp_getAttention().LookRequest(param_0, i_horizontalDist, i_upDist, i_downDist, i_angle, diff --git a/include/d/d_npc_lib.h b/include/d/d_npc_lib.h index f01ada8b9f..c815e46dfb 100644 --- a/include/d/d_npc_lib.h +++ b/include/d/d_npc_lib.h @@ -4,7 +4,8 @@ #include "d/com/d_com_inf_game.h" #include "dolphin/types.h" -struct dNpcLib_lookat_c { +class dNpcLib_lookat_c { +public: /* 80251314 */ dNpcLib_lookat_c(); /* 8025140C */ void init(J3DModel*, int*, csXyz*, csXyz*); /* 80251534 */ void action(cXyz, cXyz, fopAc_ac_c*, f32 (*)[4], int); diff --git a/include/d/d_stage.h b/include/d/d_stage.h index e9dc613493..b7ff0a72ad 100644 --- a/include/d/d_stage.h +++ b/include/d/d_stage.h @@ -165,12 +165,12 @@ struct stage_camera_class { struct stage_arrow_data_class { /* 0x00 */ cXyz mPosition; /* 0x0C */ csXyz mAngle; -}; +}; // Size: 0x14 struct stage_arrow_class { /* 0x00 */ int mNum; /* 0x04 */ stage_arrow_data_class* mEntries; -}; // Size: 0x14 +}; class stage_actor_data_class { public: diff --git a/include/m_Do/m_Do_ext.h b/include/m_Do/m_Do_ext.h index b19daeab7c..5ccf6fd623 100644 --- a/include/m_Do/m_Do_ext.h +++ b/include/m_Do/m_Do_ext.h @@ -278,11 +278,7 @@ public: void changeAnm(J3DAnmTransform* anm) { mpAnm = anm; } bool isStop() { - bool stopped = true; - if (!mFrameCtrl.checkState(1) && mFrameCtrl.getRate() != 0.0f) { - stopped = false; - } - return stopped; + return mFrameCtrl.checkState(1) || mFrameCtrl.getRate() == 0.0f; } /* 0x04 */ J3DModel* mpModel; diff --git a/include/rel/d/a/d_a_grass/d_a_grass.h b/include/rel/d/a/d_a_grass/d_a_grass.h index d9d7770980..03a24af334 100644 --- a/include/rel/d/a/d_a_grass/d_a_grass.h +++ b/include/rel/d/a/d_a_grass/d_a_grass.h @@ -1,6 +1,212 @@ #ifndef D_A_GRASS_H #define D_A_GRASS_H -#include "dolphin/types.h" +#include "f_op/f_op_actor_mng.h" + +class dCcMassS_HitInf; +class cCcD_Obj; + +class dGrass_data_c { +public: + /* 8051D88C */ void WorkCo(fopAc_ac_c*, u32, int); + /* 8051DA20 */ void WorkAt_NoCutAnim(fopAc_ac_c*, u32, int, dCcMassS_HitInf*, cCcD_Obj*); + /* 8051DF54 */ void Direction_Set(fopAc_ac_c*, u32, int, dCcMassS_HitInf*, cCcD_Obj*, csXyz*); + /* 8051E1C8 */ void WorkAt(fopAc_ac_c*, u32, int, dCcMassS_HitInf*, u16); + /* 8051EB88 */ void hitCheck(int, u16); + /* 80520940 */ ~dGrass_data_c(); + /* 8052097C */ dGrass_data_c(); + + /* 0x00 */ u8 m_state; + /* 0x01 */ u8 field_0x01; + /* 0x02 */ s8 field_0x02; + /* 0x03 */ u8 m_tableNo; + /* 0x04 */ u8 m_itemBitNo; + /* 0x05 */ u8 field_0x05; + /* 0x06 */ u8 field_0x06[0x08 - 0x06]; + /* 0x08 */ s16 m_addCol; + /* 0x0C */ cXyz m_pos; + /* 0x18 */ Mtx m_modelMtx; + /* 0x48 */ dGrass_data_c* mp_next; +}; + +class dGrass_room_c { +public: + /* 8051EDE0 */ void newData(dGrass_data_c*); + /* 8051EDF0 */ void deleteData(); + /* 80520928 */ dGrass_room_c(); + + /* 0x0 */ dGrass_data_c* mp_data; +}; + +class dGrass_anm_c { +public: + /* 80520934 */ dGrass_anm_c(); + + /* 0x00 */ u8 m_state; + /* 0x02 */ s16 m_angY; + /* 0x04 */ s16 m_angX; + /* 0x08 */ Mtx m_animMtx; +}; + +class dGrass_packet_c : public J3DPacket { +public: + /* 8051EE8C */ dGrass_packet_c(); + /* 8051FABC */ void calc(); + /* 80520030 */ void update(); + /* 8052067C */ void setData(dGrass_data_c*, int, cXyz&, int, u8, u8, s16, u8); + /* 80520770 */ dGrass_data_c* newData(cXyz&, int, u8, u8, s16, u8); + /* 80520864 */ void deleteRoom(int); + /* 80520898 */ int newAnm(); + /* 805208E4 */ void setAnm(int, s16); + + /* 8051F03C */ virtual void draw(); + /* 8051BFBC */ virtual ~dGrass_packet_c(); + + typedef void (dGrass_packet_c::*deleteFunc)(int); + static deleteFunc m_deleteRoom; + + dGrass_anm_c* getAnm() { return m_anm; } + dGrass_data_c* getData() { return m_data; } + + void deleteAnm(int i_idx) { m_anm[i_idx].m_state = 0; } + + /* 0x00010 */ u16 field_0x10; + /* 0x00014 */ dGrass_data_c m_data[1500]; + /* 0x1BD64 */ dGrass_anm_c m_anm[112]; + /* 0x1D5E4 */ dGrass_room_c m_room[64]; + /* 0x1D6E4 */ Vec* mp_pos; + /* 0x1D6E8 */ Vec* mp_normal; + /* 0x1D6EC */ GXColor* mp_colors; + /* 0x1D6F0 */ Vec* mp_texCoords; + /* 0x1D6F4 */ u8* mp_kusa9q_DL; + /* 0x1D6F8 */ u32 m_kusa9q_DL_size; + /* 0x1D6FC */ u8* mp_kusa9q_14_DL; + /* 0x1D700 */ u32 m_kusa9q_DL_14_size; + /* 0x1D704 */ u8* mp_Mkusa_9q_DL; + /* 0x1D708 */ u32 m_Mkusa_9q_DL_size; + /* 0x1D70C */ u8* mp_Mkusa_9q_cDL; + /* 0x1D710 */ u32 m_Mkusa_9q_cDL_size; + /* 0x1D714 */ u16 field_0x1d714; +}; // Size: 0x1D718 + +STATIC_ASSERT(sizeof(dGrass_packet_c) == 0x1D718); + +class dFlower_data_c { +public: + /* 80520988 */ void WorkCo(fopAc_ac_c*, u32, int); + /* 80520AD8 */ void deleteAnm(); + /* 80520B34 */ void WorkAt_NoCutAnim(fopAc_ac_c*, u32, int, dCcMassS_HitInf*, cCcD_Obj*); + /* 80520CFC */ void WorkAt(fopAc_ac_c*, u32, int, dCcMassS_HitInf*); + /* 80521A3C */ void hitCheck(fopAc_ac_c*, int); + /* 80522FCC */ ~dFlower_data_c(); + /* 80523008 */ dFlower_data_c(); + + /* 0x00 */ u8 m_state; + /* 0x01 */ s8 field_0x01; + /* 0x02 */ s8 m_tableNo; + /* 0x03 */ u8 field_0x03; + /* 0x04 */ s16 field_0x04; + /* 0x08 */ cXyz m_pos; + /* 0x14 */ Mtx m_modelMtx; + /* 0x44 */ dFlower_data_c* mp_next; +}; + +class dFlower_room_c { +public: + /* 80521BF8 */ void newData(dFlower_data_c*); + /* 80521C08 */ void deleteData(); + /* 80522FB4 */ dFlower_room_c(); + + /* 0x0 */ dFlower_data_c* mp_data; +}; + +class dFlower_anm_c { +public: + /* 80522FC0 */ dFlower_anm_c(); + + /* 0x00 */ u8 m_state; + /* 0x02 */ s16 m_angY; + /* 0x04 */ s16 m_angX; + /* 0x08 */ Mtx m_animMtx; +}; + +class dFlower_packet_c : public J3DPacket { +public: + /* 80521C64 */ dFlower_packet_c(); + /* 80522774 */ void calc(); + /* 80522A64 */ void update(); + /* 80522CBC */ void setData(dFlower_data_c*, int, s8, cXyz&, int, s8, s16); + /* 80522E28 */ dFlower_data_c* newData(s8, cXyz&, int, s8, s16); + /* 80522F0C */ void deleteRoom(int); + /* 80522F40 */ int newAnm(); + /* 80522F8C */ void setAnm(int, s16); + + /* 80521DAC */ virtual void draw(); + /* 8051C194 */ virtual ~dFlower_packet_c(); + + typedef void (dFlower_packet_c::*deleteFunc)(int); + static deleteFunc m_deleteRoom; + + dFlower_anm_c* getAnm(int i_idx) { return &m_anm[i_idx]; } + dFlower_data_c* getData() { return m_data; } + + void deleteAnm(int i_idx) { m_anm[i_idx].m_state = 0; } + + /* 0x00010 */ u16 field_0x10; + /* 0x00014 */ dFlower_data_c m_data[1000]; + /* 0x11954 */ dFlower_anm_c m_anm[72]; + /* 0x12914 */ dFlower_room_c m_room[64]; + /* 0x12A14 */ u8 m_playerCutFlg; + /* 0x12A16 */ s16 m_playerSwordAngY; + /* 0x12A18 */ s16 m_playerSwordMoveAngY; + /* 0x12A1C */ cXyz m_playerSwordTop; + /* 0x12A28 */ Vec* mp_pos; + /* 0x12A2C */ GXColor* mp_colors; + /* 0x12A30 */ Vec* mp_texCoords; + /* 0x12A34 */ u8* mp_mat2DL; + /* 0x12A38 */ u32 m_mat2DL_size; + /* 0x12A3C */ u8* mp_mat2Light4DL; + /* 0x12A40 */ u32 m_mat2Light4DL_size; + /* 0x12A44 */ u8* mp_Jhana01DL; + /* 0x12A48 */ u32 m_Jhana01DL_size; + /* 0x12A4C */ u8* mp_Jhana01_cDL; + /* 0x12A50 */ u32 m_Jhana01_cDL_size; +}; // Size: 0x12A54 + +class daGrass_c : public fopAc_ac_c { +public: + /* 8051BEFC */ int createGrass(); + /* 8051BF68 */ void deleteGrass(); + /* 8051C040 */ void executeGrass(); + /* 8051C074 */ void drawGrass(); + /* 8051C0A8 */ void newGrassData(cXyz&, int, u8, u8, s16, u8); + /* 8051C0D4 */ int createFlower(); + /* 8051C140 */ void deleteFlower(); + /* 8051C218 */ void executeFlower(); + /* 8051C24C */ void drawFlower(); + /* 8051C280 */ void newFlowerData(s8, cXyz&, int, s8, s16); + /* 8051C304 */ int create(); + + inline int Delete(); + inline int execute(); + inline int draw(); + + static dGrass_packet_c* getGrass() { return m_grass; } + static dFlower_packet_c* getFlower() { return m_flower; } + + /* 800319C8 */ static void deleteRoomGrass(int); + /* 80031A20 */ static void deleteRoomFlower(int); + + static daGrass_c* m_myObj; + static dGrass_packet_c* m_grass; + static dFlower_packet_c* m_flower; +}; + +namespace daGrass_prm { + inline u8 getKind(daGrass_c* i_this) { return (fopAcM_GetParam(i_this) >> 4) & 3; } + inline u8 getType(daGrass_c* i_this) { return fopAcM_GetParam(i_this) & 0xF; } + inline u8 getItemNo(daGrass_c* i_this) { return (fopAcM_GetParam(i_this) >> 0x10) & 0xFF; } + inline u8 getItemBitNo(daGrass_c* i_this) { return (fopAcM_GetParam(i_this) >> 8) & 0xFF; } +}; #endif /* D_A_GRASS_H */ diff --git a/include/rel/d/a/tag/d_a_tag_mhint/d_a_tag_mhint.h b/include/rel/d/a/tag/d_a_tag_mhint/d_a_tag_mhint.h index 05e2b8e308..dea6866d59 100644 --- a/include/rel/d/a/tag/d_a_tag_mhint/d_a_tag_mhint.h +++ b/include/rel/d/a/tag/d_a_tag_mhint/d_a_tag_mhint.h @@ -1,16 +1,18 @@ #ifndef D_A_TAG_MHINT_H #define D_A_TAG_MHINT_H -#include "f_op/f_op_actor.h" +#include "f_op/f_op_actor_mng.h" #include "d/msg/d_msg_flow.h" class daTagMhint_c : public fopAc_ac_c { public: - /* 805A56B8 */ void create(); + /* 805A56B8 */ int create(); /* 805A58E8 */ ~daTagMhint_c(); /* 805A5974 */ void eventOrder(); - /* 805A5AE4 */ void execute(); + /* 805A5AE4 */ int execute(); + bool checkNoAttention() const { return field_0x56d == 0xFF; } + bool checkEventID() const { return mToolEventID != 0xFF; } private: /* 0x568 */ u8 field_0x568; diff --git a/include/rel/d/a/tag/d_a_tag_wljump/d_a_tag_wljump.h b/include/rel/d/a/tag/d_a_tag_wljump/d_a_tag_wljump.h index c70adb356d..b9aca220c6 100644 --- a/include/rel/d/a/tag/d_a_tag_wljump/d_a_tag_wljump.h +++ b/include/rel/d/a/tag/d_a_tag_wljump/d_a_tag_wljump.h @@ -12,10 +12,6 @@ struct daTagWljump_c : fopAc_ac_c { /* 80D65090 */ int execute(); /* 80D6589C */ int draw(); - int dComIfGp_att_ZHintRequest(fopAc_ac_c *param_1, int param_2) { - return dComIfGp_getAttention().ZHintRequest(param_1, param_2); - } - /* 0x568 */ s8 field_0x568; /* 0x568 */ s8 field_0x569; /* 0x568 */ u8 field_0x56a; |
