summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorhatal175 <hatal175@users.noreply.github.com>2025-06-02 06:36:19 +0300
committerGitHub <noreply@github.com>2025-06-01 20:36:19 -0700
commit588b20679dd6f23b52084e888c199d5b3ec85a0e (patch)
treebedfc51f92d2c410e5b11eaa0498fe5a5dcb2d25 /include
parent8e91607e5582feb846354aa75630905e9d8089c7 (diff)
Sakuita rope Matching (#2470)
* Change dComIfGp_getAttention to return a pointer * d_a_obj_sakuita_rope Matching
Diffstat (limited to 'include')
-rw-r--r--include/d/actor/d_a_obj_sakuita_rope.h95
-rw-r--r--include/d/d_a_obj.h9
-rw-r--r--include/d/d_camera.h8
-rw-r--r--include/d/d_com_inf_game.h22
4 files changed, 97 insertions, 37 deletions
diff --git a/include/d/actor/d_a_obj_sakuita_rope.h b/include/d/actor/d_a_obj_sakuita_rope.h
index d04a3d6da7..2aac0945b1 100644
--- a/include/d/actor/d_a_obj_sakuita_rope.h
+++ b/include/d/actor/d_a_obj_sakuita_rope.h
@@ -1,34 +1,20 @@
#ifndef D_A_OBJ_SAKUITA_ROPE_H
#define D_A_OBJ_SAKUITA_ROPE_H
+#include "d/d_cc_d.h"
#include "f_op/f_op_actor_mng.h"
-/**
- * @ingroup actors-objects
- * @class daObjItaRope_c
- * @brief Rope Banner Fence
- *
- * @details
- *
- */
-class daObjItaRope_c : public fopAc_ac_c {
-public:
- /* 80CC57E4 */ void create_init();
- /* 80CC5E48 */ void initBaseMtx();
- /* 80CC5E7C */ void setBaseMtx();
- /* 80CC5ECC */ void setNormalRopePos();
-
- static u8 const M_attr[20];
-
-private:
- /* 0x568 */ u8 field_0x568[0x638 - 0x568];
+struct daObjItaRope_Attr_c {
+ /* 0x00 */ f32 mGravity;
+ /* 0x04 */ f32 mWindRate;
+ /* 0x08 */ f32 mSpeedRate;
+ /* 0x0C */ f32 mOffsetRate;
+ /* 0x10 */ u8 mStringWeight;
};
-STATIC_ASSERT(sizeof(daObjItaRope_c) == 0x638);
-
class Sakuita_c {
public:
- /* 80CC5238 */ void setModelData(J3DModelData*);
+ /* 80CC5238 */ int setModelData(J3DModelData*);
/* 80CC527C */ void create(cXyz*, s16, s8);
/* 80CC5314 */ void execute(cXyz*, s16);
/* 80CC5354 */ void draw();
@@ -38,14 +24,79 @@ public:
/* 80CC5720 */ void calcAngle();
/* 80CC63E4 */ ~Sakuita_c();
/* 80CC6420 */ Sakuita_c();
+
+ /* 0x00 */ J3DModel* mModel;
+ /* 0x04 */ cXyz* field_0x04;
+ /* 0x08 */ cXyz field_0x08;
+ /* 0x14 */ cXyz field_0x14;
+ /* 0x20 */ cXyz field_0x20;
+ /* 0x2C */ f32 field_0x2c;
+ /* 0x30 */ csXyz mRotation;
+ /* 0x36 */ s16 field_0x36;
+ /* 0x38 */ s16 field_0x38;
+ /* 0x3A */ s8 field_0x3a;
};
class RopeWork_c {
public:
/* 80CC6424 */ ~RopeWork_c();
/* 80CC6460 */ RopeWork_c();
+
+ /* 0x00 */ cXyz field_0x00;
+ /* 0x0C */ cXyz field_0x0c;
+ /* 0x18 */ int field_0x18;
};
+/**
+ * @ingroup actors-objects
+ * @class daObjItaRope_c
+ * @brief Rope Banner Fence
+ *
+ * @details
+ *
+ */
+class daObjItaRope_c : public fopAc_ac_c {
+public:
+ /* 80CC57E4 */ void create_init();
+ /* 80CC5E48 */ void initBaseMtx();
+ /* 80CC5E7C */ void setBaseMtx();
+ /* 80CC5ECC */ void setNormalRopePos();
+
+ inline ~daObjItaRope_c();
+ inline int createHeap();
+ inline int draw();
+ inline int execute();
+ inline int create();
+
+ daObjItaRope_Attr_c const& attr() const { return M_attr; }
+ u8 getJointNum() { return fopAcM_GetParam(this) & 0xff; }
+ int getPathID() { return (fopAcM_GetParam(this) >> 8) & 0xff; }
+ cXyz* getRopeStartPos() { return mLineMat.getPos(0);}
+
+ f32 getStartRate(const cXyz* pos) {
+ if (field_0x634 != 0) {
+ return field_0x62c * (pos->x - getRopeStartPos()->x);
+ }
+ return field_0x62c * (pos->z - getRopeStartPos()->z);
+ }
+ static daObjItaRope_Attr_c const M_attr;
+
+private:
+ /* 0x570 */ mDoExt_3DlineMat1_c mLineMat;
+ /* 0x5A4 */ request_of_phase_process_class mPhase;
+ /* 0x5AC */ Mtx mMtx;
+ /* 0x5AC */ dCcD_Stts mStts;
+ /* 0x618 */ RopeWork_c* mRopes;
+ /* 0x61C */ Sakuita_c* mSakuitas;
+ /* 0x620 */ cXyz field_0x620;
+ /* 0x62C */ f32 field_0x62c;
+ /* 0x630 */ f32 field_0x630;
+ /* 0x634 */ u8 field_0x634;
+ /* 0x635 */ u8 field_0x635;
+ /* 0x636 */ u8 field_0x636;
+};
+
+STATIC_ASSERT(sizeof(daObjItaRope_c) == 0x638);
#endif /* D_A_OBJ_SAKUITA_ROPE_H */
diff --git a/include/d/d_a_obj.h b/include/d/d_a_obj.h
index bc771a0444..70adf5b4ab 100644
--- a/include/d/d_a_obj.h
+++ b/include/d/d_a_obj.h
@@ -21,6 +21,15 @@ int PrmAbstract(const fopAc_ac_c* i_actor, T i_prmA, T i_prmB) {
u32 param = fopAcM_GetParam(i_actor);
return ((1 << i_prmA) - 1) & (param >> i_prmB);
}
+
+#ifdef DEBUG
+class HioVarious_c {
+public:
+ static void init(JORReflexible*, const char*);
+ static void clean(JORReflexible*);
+};
+#endif
+
}; // namespace daObj
#endif /* D_A_D_A_OBJ_H */
diff --git a/include/d/d_camera.h b/include/d/d_camera.h
index 69f41e4846..38b63295a2 100644
--- a/include/d/d_camera.h
+++ b/include/d/d_camera.h
@@ -10,7 +10,7 @@
#include "d/d_stage.h"
#include "f_op/f_op_actor.h"
-dAttention_c& dComIfGp_getAttention();
+dAttention_c* dComIfGp_getAttention();
struct dCamMapToolData {
dCamMapToolData() { Clr(); }
@@ -419,9 +419,9 @@ public:
}
void Att() {
- dAttention_c& attn = dComIfGp_getAttention();
- mpLockonTarget = attn.LockonTruth() ? attn.LockonTarget(0) : NULL;
- attn.LockSoundOn();
+ dAttention_c* attn = dComIfGp_getAttention();
+ mpLockonTarget = attn->LockonTruth() ? attn->LockonTarget(0) : NULL;
+ attn->LockSoundOn();
}
void SetWindow(f32 param_0, f32 param_1) {
diff --git a/include/d/d_com_inf_game.h b/include/d/d_com_inf_game.h
index a6797a1b63..409c8f5dc5 100644
--- a/include/d/d_com_inf_game.h
+++ b/include/d/d_com_inf_game.h
@@ -290,7 +290,7 @@ public:
fopAc_ac_c* getPlayer(int idx) { return (fopAc_ac_c*)mPlayer[idx * 2]; }
dPa_control_c* getParticle() { return mParticle; }
dEvent_manager_c& getEvtManager() { return mEvtManager; }
- dAttention_c& getAttention() { return mAttention; }
+ dAttention_c* getAttention() { return &mAttention; }
dStage_startStage_c* getStartStage() { return &mStartStage; }
void setCurrentGrafPort(J2DOrthoGraph* i_graf) { mCurrentGrafPort = i_graf; }
@@ -1792,8 +1792,8 @@ inline void dComIfGs_removeZone(int i_zoneNo) {
g_dComIfG_gameInfo.info.removeZone(i_zoneNo);
}
-inline void dComIfGp_addSimpleModel(J3DModelData* i_modelData, int roomNo, u8 i_drawBG) {
- g_dComIfG_gameInfo.play.addSimpleModel(i_modelData, roomNo, i_drawBG);
+inline int dComIfGp_addSimpleModel(J3DModelData* i_modelData, int roomNo, u8 i_drawBG) {
+ return g_dComIfG_gameInfo.play.addSimpleModel(i_modelData, roomNo, i_drawBG);
}
inline void dComIfGp_removeSimpleModel(J3DModelData* i_modelData, int roomNo) {
@@ -2157,40 +2157,40 @@ inline dEvent_manager_c* dComIfGp_getPEvtManager() {
return &g_dComIfG_gameInfo.play.getEvtManager();
}
-inline dAttention_c& dComIfGp_getAttention() {
+inline dAttention_c* dComIfGp_getAttention() {
return g_dComIfG_gameInfo.play.getAttention();
}
inline u8 dComIfGp_att_getCatchChgItem() {
- return dComIfGp_getAttention().getCatchChgItem();
+ return dComIfGp_getAttention()->getCatchChgItem();
}
inline fopAc_ac_c* dComIfGp_att_getCatghTarget() {
- return dComIfGp_getAttention().getCatghTarget();
+ return dComIfGp_getAttention()->getCatghTarget();
}
inline fopAc_ac_c* dComIfGp_att_getZHint() {
- return dComIfGp_getAttention().getZHintTarget();
+ return dComIfGp_getAttention()->getZHintTarget();
}
inline int dComIfGp_att_ZHintRequest(fopAc_ac_c* param_1, int param_2) {
- return dComIfGp_getAttention().ZHintRequest(param_1, 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,
+ dComIfGp_getAttention()->LookRequest(param_0, i_horizontalDist, i_upDist, i_downDist, i_angle,
param_5);
}
inline void dComIfGp_att_CatchRequest(fopAc_ac_c* param_0, u8 param_1, f32 i_horizontalDist,
f32 i_upDist, f32 i_downDist, s16 i_angle, int param_5) {
- dComIfGp_getAttention().CatchRequest(param_0, param_1, i_horizontalDist, i_upDist, i_downDist,
+ dComIfGp_getAttention()->CatchRequest(param_0, param_1, i_horizontalDist, i_upDist, i_downDist,
i_angle, param_5);
}
inline fopAc_ac_c* dComIfGp_att_getLookTarget() {
- return dComIfGp_getAttention().getLookTarget();
+ return dComIfGp_getAttention()->getLookTarget();
}
inline J2DGrafContext* dComIfGp_getCurrentGrafPort() {