Skip to content

Commit

Permalink
d_a_obj_swhang equivalent (#2277)
Browse files Browse the repository at this point in the history
  • Loading branch information
hatal175 authored Dec 31, 2024
1 parent 593f1d1 commit 477cbf1
Show file tree
Hide file tree
Showing 3 changed files with 446 additions and 514 deletions.
2 changes: 1 addition & 1 deletion configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -2008,7 +2008,7 @@ def MatchingFor(*versions):
ActorRel(Matching, "d_a_obj_swBallC"),
ActorRel(NonMatching, "d_a_obj_swLight"),
ActorRel(NonMatching, "d_a_obj_swchain"),
ActorRel(NonMatching, "d_a_obj_swhang"),
ActorRel(Equivalent, "d_a_obj_swhang"),
ActorRel(NonMatching, "d_a_obj_sword"),
ActorRel(NonMatching, "d_a_obj_swpush2"),
ActorRel(Matching, "d_a_obj_swspinner"),
Expand Down
52 changes: 42 additions & 10 deletions include/d/actor/d_a_obj_swhang.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "d/d_bg_s_movebg_actor.h"
#include "d/d_cc_d.h"
#include "d/d_event_lib.h"
#include "f_op/f_op_actor_mng.h"

/**
* @ingroup actors-objects
Expand All @@ -14,13 +15,33 @@
* @details
*
*/
class daObjSwHang_c : public dBgS_MoveBgActor {
class daObjSwHang_c : public dBgS_MoveBgActor, public dEvLib_callback_c {
public:
typedef void (daObjSwHang_c::*modeFunc)();

enum Type {
TYPE_0,
TYPE_1,
TYPE_2,
TYPE_3,
TYPE_4,
};

enum Flags {
/* 0x01 */ FLAGS_1 = 1 << 0,
/* 0x02 */ FLAGS_2 = 1 << 1,
};

enum Mode {
MODE_OFF_WAIT,
MODE_ON_WAIT,
};

/* 80CFB9D8 */ void initBaseMtx();
/* 80CFBA60 */ void setBaseMtx();
/* 80CFBDD0 */ void create1st();
/* 80CFBDD0 */ int create1st();
/* 80CFC04C */ void calcHangPos();
/* 80CFC114 */ void checkDown();
/* 80CFC114 */ BOOL checkDown();
/* 80CFC194 */ void changeOnStatus();
/* 80CFC1F4 */ void changeOffStatus();
/* 80CFC4C4 */ void action();
Expand All @@ -29,28 +50,39 @@ class daObjSwHang_c : public dBgS_MoveBgActor {
/* 80CFC6AC */ void modeOffWait();
/* 80CFCA34 */ void init_modeOnWait();
/* 80CFCA40 */ void modeOnWait();
/* 80CFCCE0 */ void eventStart();
/* 80CFD034 */ ~daObjSwHang_c();
/* 80CFCCE0 */ BOOL eventStart();
/* 80CFD034 */ virtual ~daObjSwHang_c() {}

daObjSwHang_c() : dEvLib_callback_c(this) {}

/* 80CFBCB8 */ virtual int CreateHeap();
/* 80CFBAC8 */ virtual int Create();
/* 80CFC254 */ virtual int Execute(f32 (**)[3][4]);
/* 80CFC254 */ virtual int Execute(Mtx**);
/* 80CFCD04 */ virtual int Draw();
/* 80CFCD98 */ virtual int Delete();

cXyz getHangPos() { return mHangPos; }

void setHangPlayer() { mHangPlayer = 1; }
u8 getType() { return field_0x730; }
u8 getType() { return mType; }
u8 getType_private() { return fopAcM_GetParamBit(this, 28, 4); }
u8 checkType() { return fopAcM_GetParamBit(this, 25, 1); }
u8 getSwNo() { return fopAcM_GetParamBit(this, 0, 8); }
u8 getKind() { return fopAcM_GetParamBit(this, 26, 2); }
u8 getEvId() { return fopAcM_GetParamBit(this, 8, 8); }
int getTotteJointNo() { return mTotteJointNo; }
f32 getHangLength() { return mHangLength; }
void clrFlag() { mFlags = 0; }
void onFlag(u16 flag) { mFlags |= flag; }
u16 checkFlag(u16 flag) { return mFlags & flag; }

private:
/* 0x5A0 */ dEvLib_callback_c field_0x5a0;
/* 0x5B0 */ request_of_phase_process_class mPhase;
/* 0x5B8 */ J3DModel* mpModel;
/* 0x5BC */ dCcD_Stts mCcStts;
/* 0x5F8 */ dCcD_Sph mCcSph;
/* 0x730 */ u8 field_0x730;
/* 0x731 */ u8 mType;
/* 0x730 */ u8 mType;
/* 0x731 */ u8 mMode;
/* 0x734 */ dBgW* mpBgW;
/* 0x738 */ Mtx field_0x738;
/* 0x768 */ int mTotteJointNo;
Expand Down
Loading

0 comments on commit 477cbf1

Please sign in to comment.