d-a-obj-barrel (#700)

* d_a_obj_barrel wip

* d_a_obj_barrel wip

* mostly match, names and cleanup

* d-a-obj-barrel 100%

* remove unused field

* remove comments and address PR suggestions
This commit is contained in:
Ross Newman
2025-03-08 16:42:46 -05:00
committed by GitHub
parent 7678a0be84
commit e696d982c6
6 changed files with 695 additions and 79 deletions
+97 -16
View File
@@ -2,14 +2,61 @@
#define D_A_OBJ_BARREL_H
#include "f_op/f_op_actor.h"
#include "c/c_damagereaction.h"
#include "d/d_a_obj.h"
namespace daObjBarrel {
class Act_c : public fopAc_ac_c {
public:
void attr() const {}
enum Prm_e {
PRM_CULL_W = 0x03,
PRM_CULL_S = 0x1c,
};
enum Mode {
MODE_WAIT = 0x0,
MODE_CARRY = 0x1,
MODE_VIB0 = 0x2,
MODE_VIB1 = 0x3,
MODE_VIB2 = 0x4,
MODE_JUMP = 0x5,
MODE_WALK = 0x6,
};
struct Attr_c {
/* 0x00 */ u16 mBdlIdx;
/* 0x02 */ u8 m02;
/* 0x03 */ bool mEnableCutoff;
/* 0x04 */ float mAttnH;
/* 0x08 */ float mNormalGravity;
/* 0x0C */ u8 mWeight;
/* 0x10 */ float mSinkDownDepth;
/* 0x14 */ float m14; // unused
/* 0x18 */ float mVib0SpeedY;
/* 0x1C */ float mVib0Gravity;
/* 0x20 */ float mVib1Gravity;
/* 0x24 */ float mVib2Gravity;
/* 0x28 */ short m28;
/* 0x2A */ short m2A;
/* 0x2C */ short m2C;
/* 0x2E */ u8 mVib0Duration;
/* 0x2F */ u8 mVib1Duration;
/* 0x30 */ u8 mVib2Duration;
/* 0x31 */ u8 m31;
/* 0x34 */ float mFallDmgH;
/* 0x38 */ u8 m38; // unused
/* 0x39 */ u8 mSeBreakP1;
/* 0x3A */ u8 mSeBreakP2;
/* 0x3B */ u8 mSeHitP1;
/* 0x3C */ u8 mSeHitP2;
/* 0x40 */ float mWPillarScaleXZ;
/* 0x44 */ float mWPillarScaleY;
};
const Attr_c& attr() const { return M_attr; }
void get_slant_angle() {}
bool pos_init() {
if (m60C == 0) {
if (mMode == MODE_WAIT) {
current.pos = home.pos;
current.angle = home.angle;
shape_angle = home.angle;
@@ -18,11 +65,11 @@ namespace daObjBarrel {
return false;
}
}
void prm_get_cull() const {}
int prm_get_cull() const { return daObj::PrmAbstract<Prm_e>(this, PRM_CULL_W, PRM_CULL_S); }
void set_slant_angle(s16) {}
void solidHeapCB(fopAc_ac_c*);
void create_heap();
static BOOL solidHeapCB(fopAc_ac_c*);
bool create_heap();
s32 _create();
bool _delete();
void mode_wait_init();
@@ -40,7 +87,7 @@ namespace daObjBarrel {
void mode_walk_init();
void mode_walk();
void vib_pos_ang();
void mode_proc_call();
bool mode_proc_call();
void set_mtx();
void init_mtx();
void set_walk_rot();
@@ -48,24 +95,58 @@ namespace daObjBarrel {
void damaged(bool);
void cull_set_draw();
void cull_set_move();
void get_se_map_hit() const;
u32 get_se_map_hit() const;
void set_senv(int, int) const;
void se_fall_water();
void eff_hit_water_splash();
void chk_sink_water();
void chk_sinkdown_water();
bool chk_sink_water();
bool chk_sinkdown_water();
void eff_land_smoke();
void damage_cc_proc();
void damage_bg_proc();
void damage_bg_proc_directly();
bool damage_cc_proc();
bool damage_bg_proc();
bool damage_bg_proc_directly();
bool _execute();
bool _draw();
static const char M_arcname[9];
static const float l_s_radius;
static const float l_l_radius;
static const float l_gnd_fric;
static const short l_gnd_deg;
static const float l_viscous_resist;
static const float l_inert_resist;
static const float l_max_move;
static const short l_max_vib_angl;
static const float l_min_move_dir;
static const float l_wind_max;
static const float l_shape_vec;
static const float l_tgr_ratio;
static const dCcD_SrcCyl M_cyl_src;
static const Attr_c M_attr;
public:
/* Place member variables here */
/* 0x290 */ u8 m290[0x60C - 0x290];
/* 0x60C */ int m60C;
};
/* 0x290 */ request_of_phase_process_class mPhs;
/* 0x298 */ J3DModel* mpModel;
/* 0x29C */ dBgS_ObjAcch mAcch;
/* 0x460 */ dBgS_AcchCir mAcchCir;
/* 0x4A0 */ dCcD_Stts mStts;
/* 0x4DC */ dCcD_Cyl mCyl;
/* 0x60C */ int mMode;
/* 0x610 */ short m610;
/* 0x612 */ short m612;
/* 0x614 */ int mTimer;
/* 0x618 */ float mLastGroundY;
/* 0x61C */ short m61C;
/* 0x61E */ u8 m61E[0x620 - 0x61E];
/* 0x620 */ bool mOnGround;
/* 0x621 */ s8 mInitTimer;
/* 0x622 */ bool mForceExec;
/* 0x623 */ bool mSunk;
/* 0x624 */ cXyz mMove;
/* 0x630 */ short m630;
}; // Size: 0x634
STATIC_ASSERT(sizeof(Act_c) == 0x634);
namespace Method {
s32 Create(void*);
+3 -1
View File
@@ -2,12 +2,14 @@
#define D_A_OBJ_EFF_H
#include "f_op/f_op_actor.h"
#include "f_op/f_op_actor_mng.h"
#include "d/d_particle.h"
#include "d/d_procname.h"
namespace daObjEff {
class Act_c : public fopAc_ac_c {
public:
void make_barrel_smoke(cXyz*) {}
static void make_barrel_smoke(cXyz* pos) { fopAcM_create(PROC_Obj_Eff, NULL, pos); }
void make_land_smoke(cXyz*, float) {}
void make_pinecone_smoke(cXyz*) {}
void make_skull_smoke(cXyz*) {}
+1
View File
@@ -12,6 +12,7 @@
enum dCcD_ObjAtType {
/* 0x00000002 */ AT_TYPE_SWORD = (1 << 1),
/* 0x00000008 */ AT_TYPE_UNK8 = (1 << 3),
/* 0x00000020 */ AT_TYPE_BOMB = (1 << 5),
/* 0x00000040 */ AT_TYPE_BOOMERANG = (1 << 6),
/* 0x00000080 */ AT_TYPE_BOKO_STICK = (1 << 7),
+1 -1
View File
@@ -1036,7 +1036,7 @@ inline s8 dStage_stagInfo_GetTimeH(stage_stag_info_class* p_info) {
return (p_info->field_0x0c >> 8) & 0xFF;
}
inline u8 dStage_stagInfo_GetCullPoint(stage_stag_info_class* p_info) {
inline u16 dStage_stagInfo_GetCullPoint(stage_stag_info_class* p_info) {
return p_info->field_0x10 & 0xFFFF;
}