Sakuita rope Matching (#2470)

* Change dComIfGp_getAttention to return a pointer

* d_a_obj_sakuita_rope Matching
This commit is contained in:
hatal175
2025-06-02 06:36:19 +03:00
committed by GitHub
parent 8e91607e55
commit 588b20679d
32 changed files with 561 additions and 534 deletions
+75 -24
View File
@@ -1,8 +1,52 @@
#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"
struct daObjItaRope_Attr_c {
/* 0x00 */ f32 mGravity;
/* 0x04 */ f32 mWindRate;
/* 0x08 */ f32 mSpeedRate;
/* 0x0C */ f32 mOffsetRate;
/* 0x10 */ u8 mStringWeight;
};
class Sakuita_c {
public:
/* 80CC5238 */ int setModelData(J3DModelData*);
/* 80CC527C */ void create(cXyz*, s16, s8);
/* 80CC5314 */ void execute(cXyz*, s16);
/* 80CC5354 */ void draw();
/* 80CC5390 */ void initBaseMtx();
/* 80CC53B0 */ void setBaseMtx();
/* 80CC5444 */ void setPlatePos(cXyz*);
/* 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
@@ -18,34 +62,41 @@ public:
/* 80CC5E7C */ void setBaseMtx();
/* 80CC5ECC */ void setNormalRopePos();
static u8 const M_attr[20];
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:
/* 0x568 */ u8 field_0x568[0x638 - 0x568];
/* 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);
class Sakuita_c {
public:
/* 80CC5238 */ void setModelData(J3DModelData*);
/* 80CC527C */ void create(cXyz*, s16, s8);
/* 80CC5314 */ void execute(cXyz*, s16);
/* 80CC5354 */ void draw();
/* 80CC5390 */ void initBaseMtx();
/* 80CC53B0 */ void setBaseMtx();
/* 80CC5444 */ void setPlatePos(cXyz*);
/* 80CC5720 */ void calcAngle();
/* 80CC63E4 */ ~Sakuita_c();
/* 80CC6420 */ Sakuita_c();
};
class RopeWork_c {
public:
/* 80CC6424 */ ~RopeWork_c();
/* 80CC6460 */ RopeWork_c();
};
#endif /* D_A_OBJ_SAKUITA_ROPE_H */
+9
View File
@@ -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 */
+4 -4
View File
@@ -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) {
+11 -11
View File
@@ -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() {