Twilight Princess
Decompilation of The Legend of Zelda: Twilight Princess
Loading...
Searching...
No Matches
d_a_obj_movebox.h
Go to the documentation of this file.
1#ifndef D_A_OBJ_MOVEBOX_H
2#define D_A_OBJ_MOVEBOX_H
3
4#include "d/d_com_inf_game.h"
5#include "d/d_a_obj.h"
8#include "d/d_bg_w.h"
9
21namespace daObjMovebox {
22 class Hio_c {
23 public:
24 class Attr_c {
25 public:
28 /* 0x04 */ s16 mPushMoveTime;
31 /* 0x0A */ s16 mPullMoveTime;
32 /* 0x0C */ f32 mUnitDistance;
33 /* 0x10 */ f32 mShadowSize;
34 /* 0x14 */ f32 mGravity;
37 /* 0x20 */ f32 mFallYInitSpeed;
38 /* 0x24 */ f32 mLandSmokeScale;
39 /* 0x28 */ f32 mBuoyancy;
40 /* 0x2C */ f32 mPlayerGravity;
41 /* 0x30 */ f32 mMiscGravity;
47 /* 0x48 */ f32 mMiscTiltPower;
48 /* 0x4C */ f32 mMaxTiltPower;
51 /* 0x58 */ int field_0x58;
52 /* 0x5C */ int field_0x5c;
53 /* 0x60 */ u32 field_0x60;
54 /* 0x64 */ f32 field_0x64;
55 /* 0x68 */ f32 field_0x68;
56 /* 0x6C */ f32 field_0x6c;
57 /* 0x70 */ f32 field_0x70;
58 /* 0x74 */ f32 field_0x74;
59 /* 0x78 */ f32 field_0x78;
60 /* 0x7C */ u32 field_0x7c;
61 /* 0x80 */ u32 field_0x80;
62 /* 0x84 */ u32 field_0x84;
63 /* 0x88 */ u32 field_0x88;
64 /* 0x8C */ int field_0x8c;
65 /* 0x90 */ s16 field_0x90;
66 /* 0x92 */ s16 field_0x92;
67 /* 0x94 */ s16 field_0x94;
68 /* 0x96 */ s16 field_0x96;
69 /* 0x98 */ s16 field_0x98;
70 /* 0x9A */ s16 field_0x9a;
71 /* 0x9C */ u8 field_0x9c;
72 /* 0x9D */ u8 field_0x9d;
73 /* 0x9E */ u8 field_0x9e;
74 };
75 };
76
77 class BgcSrc_c {
78 public:
79 /* 0x0 */ f32 field_0x0;
80 /* 0x4 */ f32 field_0x4;
81 /* 0x8 */ f32 field_0x8;
82 /* 0xC */ f32 field_0xc;
83 };
84
85 class Act_c;
86
87 class Bgc_c {
88 public:
89 enum State_e {
90 STATE_0_e = 0x0,
91 STATE_1_e = 0x1,
92 STATE_2_e = 0x2,
93 STATE_4_e = 0x4,
94 STATE_8_e = 0x8,
95 STATE_10_e = 0x10,
96 STATE_20_e = 0x20,
97 STATE_40_e = 0x40,
98 };
99
100 /* 8047DAEC */ Bgc_c();
101 /* 8047DBF0 */ void gnd_pos(daObjMovebox::Act_c const*, daObjMovebox::BgcSrc_c const*, int,
102 f32);
103 /* 8047DD88 */ void wrt_pos(cXyz const&);
104 /* 8047DE58 */ void wall_pos(daObjMovebox::Act_c const*, daObjMovebox::BgcSrc_c const*, int,
105 s16, f32);
106 /* 8047E134 */ void proc_vertical(daObjMovebox::Act_c*);
107 /* 8047E2D4 */ bool chk_wall_pre(daObjMovebox::Act_c const*, daObjMovebox::BgcSrc_c const*,
108 int, s16);
109 /* 8047E350 */ bool chk_wall_touch(daObjMovebox::Act_c const*,
111 /* 8047E5A0 */ bool chk_wall_touch2(daObjMovebox::Act_c const*,
112 daObjMovebox::BgcSrc_c const*, int, s16);
113
114 static const daObjMovebox::BgcSrc_c M_lin5[];
115 static const daObjMovebox::BgcSrc_c M_lin20[];
116
120
121 /* 0x000 */ f32 field_0x0[23];
122 /* 0x05C */ int field_0x5c;
123 /* 0x060 */ f32 field_0x60;
124 /* 0x064 */ cXyz field_0x64[23];
125 /* 0x178 */ int field_0x178;
126 /* 0x17C */ f32 field_0x17c;
127 /* 0x180 */ State_e mState;
128 };
129
130 class Act_c : public dBgS_MoveBgActor {
131 public:
132 enum Prm_e {
133 PRM_4_e = 0x4,
134 PRM_8_e = 0x8,
135 PRM_18_e = 0x18,
136 PRM_1C_e = 0x1C,
137 };
138
139 /* 8047E628 */ int prm_get_swSave1() const;
140 /* 8047E650 */ void prmZ_init();
141 /* 8047E680 */ void prmX_init();
142 /* 8047E6B0 */ const daObjMovebox::Hio_c::Attr_c& attr() const;
143 /* 8047E6C8 */ void set_mtx();
144 /* 8047E7B0 */ void init_mtx();
145 /* 8047E7F4 */ void path_init();
146 /* 8047E92C */ void path_save();
147 /* 8047EBEC */ static void RideCallBack(dBgW*, fopAc_ac_c*, fopAc_ac_c*);
149 /* 8047F11C */ void afl_sway();
150 /* 8047F38C */ int check_to_walk();
151 /* 8047F50C */ void clr_moment_cnt();
152 /* 8047F530 */ bool chk_appear() const;
153 /* 8047F5CC */ void eff_smoke_slip_start();
154 /* 8047F634 */ void mode_wait_init();
155 /* 8047F6A8 */ void mode_wait();
156 /* 8047F8D4 */ void mode_walk_init();
157 /* 8047F8F4 */ void mode_walk();
158 /* 8047FCBC */ void mode_afl_init();
159 /* 8047FCE4 */ void mode_afl();
160 /* 8047FF5C */ void sound_slip();
161 /* 80480020 */ void sound_limit();
162 /* 804800E4 */ void sound_land();
163 /* 804801A8 */ void vib_land();
164 /* 804801FC */ void eff_land_smoke();
165
166 /* 8047EB48 */ virtual int CreateHeap();
167 /* 8047EE0C */ virtual int Create();
168 /* 8048027C */ virtual int Execute(Mtx**);
169 /* 80480728 */ virtual int Draw();
170 /* 804808FC */ virtual int Delete();
171
172 inline void mode_proc_call();
173 inline int Mthd_Create();
174 inline int Mthd_Delete();
175
176 // some functions need an inlined version of `attr`, find better fix later
177 const daObjMovebox::Hio_c::Attr_c& i_attr() const { return M_attr[mType]; }
178
179 int prm_get_swSave() const { return daObj::PrmAbstract(this, PRM_8_e, PRM_8_e); }
180 int prmZ_get_swSave2() const { return (u8)(mPrmZ >> 8); }
181 int prm_get_dmy() const { return 0; }
182 int prmZ_get_pathId() const { return mPrmZ & 0xFF; }
184 int prm_get_type() const { return daObj::PrmAbstract(this, PRM_4_e, PRM_18_e); }
185
186 int is_switch1() const { return fopAcM_isSwitch(this, prm_get_swSave1()) != 0; }
187 int is_switch2() const { return fopAcM_isSwitch(this, prmZ_get_swSave2()) != 0; }
188
189 void on_switch1() const { fopAcM_onSwitch(this, prm_get_swSave1()); }
190 void on_switch2() const { fopAcM_onSwitch(this, prmZ_get_swSave2()); }
193
194 int getType() { return prm_get_type(); }
195
196 static const s16 M_dir_base[4];
197 static const char* const M_arcname[8];
198 static const dCcD_SrcCyl M_cyl_src;
199 static const daObjMovebox::Hio_c::Attr_c M_attr[8];
200
202 /* 0x5A8 */ J3DModel* mpModel;
203 /* 0x5AC */ int field_0x5ac;
204 /* 0x5B0 */ dCcD_Stts mCcStts;
205 /* 0x5EC */ dCcD_Cyl mCcCyl;
206 /* 0x728 */ Bgc_c mBgc;
207 /* 0x8AC */ int mType;
208 /* 0x8B0 */ u16 mPrmZ;
209 /* 0x8B2 */ u16 mPrmX;
210 /* 0x8B4 */ dPath* mpPath;
211 /* 0x8B8 */ s16 field_0x8b8;
212 /* 0x8BC */ f32 field_0x8bc;
213 /* 0x8C0 */ f32 field_0x8c0;
214 /* 0x8C4 */ f32 field_0x8c4;
215 /* 0x8C8 */ f32 field_0x8c8;
216 /* 0x8CC */ f32 field_0x8cc;
217 /* 0x8D0 */ f32 field_0x8d0;
218 /* 0x8D4 */ f32 field_0x8d4;
219 /* 0x8D8 */ f32 field_0x8d8;
220 /* 0x8DC */ int field_0x8dc;
221 /* 0x8E0 */ int field_0x8e0;
222 /* 0x8E4 */ f32 field_0x8e4;
223 /* 0x8E8 */ int field_0x8e8;
225 /* 0x8F0 */ s16 field_0x8f0[4];
226 /* 0x8F8 */ s16 field_0x8f8;
227 /* 0x8FA */ s16 field_0x8fa;
228 /* 0x8FC */ s16 field_0x8fc;
229 /* 0x8FE */ u8 field_0x8fe;
230 /* 0x8FF */ s8 mReverb;
231 /* 0x900 */ u8 field_0x900;
232 /* 0x901 */ u8 field_0x901;
233 /* 0x902 */ u8 field_0x902;
234 /* 0x904 */ int field_0x904;
235 /* 0x908 */ s8 field_0x908;
236 };
237};
238
240
241#endif /* D_A_OBJ_MOVEBOX_H */
Definition d_bg_s_movebg_actor.h:10
Definition d_bg_s_lin_chk.h:48
Definition d_bg_s_wtr_chk.h:6
PushPullLabel
Definition d_bg_w_base.h:28
Definition d_bg_w.h:252
Definition d_a_obj_movebox.h:130
void sound_slip()
Definition d_a_obj_movebox.cpp:1042
f32 field_0x8c4
Definition d_a_obj_movebox.h:214
int is_switch1() const
Definition d_a_obj_movebox.h:186
s16 field_0x8f8
Definition d_a_obj_movebox.h:226
void afl_sway()
Definition d_a_obj_movebox.cpp:743
int getType()
Definition d_a_obj_movebox.h:194
void sound_limit()
Definition d_a_obj_movebox.cpp:1056
void mode_afl_init()
Definition d_a_obj_movebox.cpp:986
dCcD_Cyl mCcCyl
Definition d_a_obj_movebox.h:205
void eff_land_smoke()
Definition d_a_obj_movebox.cpp:1094
Prm_e
Definition d_a_obj_movebox.h:132
@ PRM_18_e
Definition d_a_obj_movebox.h:135
@ PRM_4_e
Definition d_a_obj_movebox.h:133
@ PRM_1C_e
Definition d_a_obj_movebox.h:136
@ PRM_8_e
Definition d_a_obj_movebox.h:134
virtual int Create()
Definition d_a_obj_movebox.cpp:668
virtual int CreateHeap()
Definition d_a_obj_movebox.cpp:550
dCcD_Stts mCcStts
Definition d_a_obj_movebox.h:204
bool chk_appear() const
Definition d_a_obj_movebox.cpp:841
const daObjMovebox::Hio_c::Attr_c & i_attr() const
Definition d_a_obj_movebox.h:177
void off_switch1() const
Definition d_a_obj_movebox.h:191
f32 field_0x8e4
Definition d_a_obj_movebox.h:222
static const daObjMovebox::Hio_c::Attr_c M_attr[8]
Definition d_a_obj_movebox.h:354
int field_0x904
Definition d_a_obj_movebox.h:234
s8 field_0x908
Definition d_a_obj_movebox.h:235
s8 mReverb
Definition d_a_obj_movebox.h:230
u8 field_0x901
Definition d_a_obj_movebox.h:232
f32 field_0x8c0
Definition d_a_obj_movebox.h:213
static const dCcD_SrcCyl M_cyl_src
Definition d_a_obj_movebox.h:338
void vib_land()
Definition d_a_obj_movebox.cpp:1085
u16 mPrmX
Definition d_a_obj_movebox.h:209
void prmX_init()
Definition d_a_obj_movebox.cpp:319
static const char *const M_arcname[8]
Definition d_a_obj_movebox.h:332
int field_0x8dc
Definition d_a_obj_movebox.h:220
Bgc_c mBgc
Definition d_a_obj_movebox.h:206
s16 field_0x8f0[4]
Definition d_a_obj_movebox.h:225
void mode_walk_init()
Definition d_a_obj_movebox.cpp:921
f32 field_0x8cc
Definition d_a_obj_movebox.h:216
int prm_get_type() const
Definition d_a_obj_movebox.h:184
int mType
Definition d_a_obj_movebox.h:207
int Mthd_Delete()
Definition d_a_obj_movebox.cpp:1274
virtual int Draw()
Definition d_a_obj_movebox.cpp:1215
static fopAc_ac_c * PPCallBack(fopAc_ac_c *, fopAc_ac_c *, s16, dBgW_Base::PushPullLabel)
Definition d_a_obj_movebox.cpp:623
u8 prm_get_answer() const
Definition d_a_obj_movebox.h:183
int field_0x5ac
Definition d_a_obj_movebox.h:203
int is_switch2() const
Definition d_a_obj_movebox.h:187
virtual int Delete()
Definition d_a_obj_movebox.cpp:1241
void mode_wait_init()
Definition d_a_obj_movebox.cpp:866
void on_switch2() const
Definition d_a_obj_movebox.h:190
void clr_moment_cnt()
Definition d_a_obj_movebox.cpp:834
f32 field_0x8d8
Definition d_a_obj_movebox.h:219
int prmZ_get_swSave2() const
Definition d_a_obj_movebox.h:180
f32 field_0x8d4
Definition d_a_obj_movebox.h:218
s16 field_0x8fc
Definition d_a_obj_movebox.h:228
void mode_afl()
Definition d_a_obj_movebox.cpp:994
void prmZ_init()
Definition d_a_obj_movebox.cpp:301
int field_0x8e0
Definition d_a_obj_movebox.h:221
u8 field_0x8fe
Definition d_a_obj_movebox.h:229
void mode_wait()
Definition d_a_obj_movebox.cpp:877
J3DModel * mpModel
Definition d_a_obj_movebox.h:202
void path_save()
Definition d_a_obj_movebox.cpp:492
u8 field_0x902
Definition d_a_obj_movebox.h:233
f32 field_0x8d0
Definition d_a_obj_movebox.h:217
const daObjMovebox::Hio_c::Attr_c & attr() const
Definition d_a_obj_movebox.cpp:420
f32 field_0x8bc
Definition d_a_obj_movebox.h:212
void set_mtx()
Definition d_a_obj_movebox.cpp:426
int check_to_walk()
Definition d_a_obj_movebox.cpp:785
virtual int Execute(Mtx **)
Definition d_a_obj_movebox.cpp:1105
dBgW::PushPullLabel mPPLabel
Definition d_a_obj_movebox.h:224
void sound_land()
Definition d_a_obj_movebox.cpp:1070
void path_init()
Definition d_a_obj_movebox.cpp:465
void eff_smoke_slip_start()
Definition d_a_obj_movebox.cpp:857
void mode_walk()
Definition d_a_obj_movebox.cpp:929
static const s16 M_dir_base[4]
Definition d_a_obj_movebox.h:310
static void RideCallBack(dBgW *, fopAc_ac_c *, fopAc_ac_c *)
Definition d_a_obj_movebox.cpp:569
int prm_get_swSave1() const
Definition d_a_obj_movebox.cpp:295
int prm_get_swSave() const
Definition d_a_obj_movebox.h:179
int field_0x8e8
Definition d_a_obj_movebox.h:223
f32 field_0x8c8
Definition d_a_obj_movebox.h:215
void mode_proc_call()
Definition d_a_obj_movebox.cpp:1030
s16 field_0x8b8
Definition d_a_obj_movebox.h:211
u16 mPrmZ
Definition d_a_obj_movebox.h:208
int Mthd_Create()
Definition d_a_obj_movebox.cpp:1250
request_of_phase_process_class mPhase
Definition d_a_obj_movebox.h:201
int prmZ_get_pathId() const
Definition d_a_obj_movebox.h:182
dPath * mpPath
Definition d_a_obj_movebox.h:210
void on_switch1() const
Definition d_a_obj_movebox.h:189
void off_switch2() const
Definition d_a_obj_movebox.h:192
u8 field_0x900
Definition d_a_obj_movebox.h:231
int prm_get_dmy() const
Definition d_a_obj_movebox.h:181
void init_mtx()
Definition d_a_obj_movebox.cpp:455
s16 field_0x8fa
Definition d_a_obj_movebox.h:227
Definition d_a_obj_movebox.h:77
f32 field_0xc
Definition d_a_obj_movebox.h:82
f32 field_0x0
Definition d_a_obj_movebox.h:79
f32 field_0x8
Definition d_a_obj_movebox.h:81
f32 field_0x4
Definition d_a_obj_movebox.h:80
Definition d_a_obj_movebox.h:87
static const daObjMovebox::BgcSrc_c M_lin5[]
Definition d_a_obj_movebox.h:17
static dBgS_WtrChk M_wrt_work
Definition d_a_obj_movebox.h:118
int field_0x178
Definition d_a_obj_movebox.h:125
static dBgS_ObjLinChk M_wall_work[23]
Definition d_a_obj_movebox.h:119
f32 field_0x0[23]
Definition d_a_obj_movebox.h:121
f32 field_0x60
Definition d_a_obj_movebox.h:123
void gnd_pos(daObjMovebox::Act_c const *, daObjMovebox::BgcSrc_c const *, int, f32)
f32 field_0x17c
Definition d_a_obj_movebox.h:126
static dBgS_ObjGndChk M_gnd_work[23]
Definition d_a_obj_movebox.h:117
bool chk_wall_pre(daObjMovebox::Act_c const *, daObjMovebox::BgcSrc_c const *, int, s16)
Definition d_a_obj_movebox.cpp:229
bool chk_wall_touch2(daObjMovebox::Act_c const *, daObjMovebox::BgcSrc_c const *, int, s16)
Definition d_a_obj_movebox.cpp:279
bool chk_wall_touch(daObjMovebox::Act_c const *, daObjMovebox::BgcSrc_c const *, s16)
Definition d_a_obj_movebox.cpp:238
static const daObjMovebox::BgcSrc_c M_lin20[]
Definition d_a_obj_movebox.h:23
void wall_pos(daObjMovebox::Act_c const *, daObjMovebox::BgcSrc_c const *, int, s16, f32)
Definition d_a_obj_movebox.cpp:132
Bgc_c()
Definition d_a_obj_movebox.cpp:35
cXyz field_0x64[23]
Definition d_a_obj_movebox.h:124
State_e
Definition d_a_obj_movebox.h:89
@ STATE_8_e
Definition d_a_obj_movebox.h:94
@ STATE_10_e
Definition d_a_obj_movebox.h:95
@ STATE_0_e
Definition d_a_obj_movebox.h:90
@ STATE_20_e
Definition d_a_obj_movebox.h:96
@ STATE_4_e
Definition d_a_obj_movebox.h:93
@ STATE_40_e
Definition d_a_obj_movebox.h:97
@ STATE_2_e
Definition d_a_obj_movebox.h:92
@ STATE_1_e
Definition d_a_obj_movebox.h:91
void wrt_pos(cXyz const &)
Definition d_a_obj_movebox.cpp:108
State_e mState
Definition d_a_obj_movebox.h:127
int field_0x5c
Definition d_a_obj_movebox.h:122
void proc_vertical(daObjMovebox::Act_c *)
Definition d_a_obj_movebox.cpp:187
Definition d_a_obj_movebox.h:24
f32 field_0x78
Definition d_a_obj_movebox.h:59
f32 mWaterOscillationAccel
Definition d_a_obj_movebox.h:42
f32 mMiscGravity
Definition d_a_obj_movebox.h:41
f32 mFallYInitSpeed
Definition d_a_obj_movebox.h:37
f32 field_0x70
Definition d_a_obj_movebox.h:57
u32 field_0x80
Definition d_a_obj_movebox.h:61
s16 mFirstPullStopTime
Definition d_a_obj_movebox.h:29
f32 field_0x74
Definition d_a_obj_movebox.h:58
int field_0x8c
Definition d_a_obj_movebox.h:64
f32 mTiltViscoscityResistance
Definition d_a_obj_movebox.h:50
s16 field_0x92
Definition d_a_obj_movebox.h:66
f32 mPlayerGravity
Definition d_a_obj_movebox.h:40
s16 mPushMoveTime
Definition d_a_obj_movebox.h:28
s16 mRepeatPullStopTime
Definition d_a_obj_movebox.h:30
int field_0x5c
Definition d_a_obj_movebox.h:52
s16 field_0x96
Definition d_a_obj_movebox.h:68
s16 field_0x90
Definition d_a_obj_movebox.h:65
f32 mWaterInertiaResistance
Definition d_a_obj_movebox.h:45
int field_0x58
Definition d_a_obj_movebox.h:51
f32 mMaxTiltPower
Definition d_a_obj_movebox.h:48
s16 mWaterOscillationAngleSpeed
Definition d_a_obj_movebox.h:43
s16 field_0x98
Definition d_a_obj_movebox.h:69
f32 mGravity
Definition d_a_obj_movebox.h:34
f32 mInertiaResistance
Definition d_a_obj_movebox.h:36
f32 mLandSmokeScale
Definition d_a_obj_movebox.h:38
f32 field_0x68
Definition d_a_obj_movebox.h:55
s16 mPullMoveTime
Definition d_a_obj_movebox.h:31
f32 mBuoyancy
Definition d_a_obj_movebox.h:39
f32 field_0x64
Definition d_a_obj_movebox.h:54
s16 mRepeatPushStopTime
Definition d_a_obj_movebox.h:27
f32 mPlayerTiltPower
Definition d_a_obj_movebox.h:46
s16 field_0x9a
Definition d_a_obj_movebox.h:70
u32 field_0x84
Definition d_a_obj_movebox.h:62
u8 field_0x9c
Definition d_a_obj_movebox.h:71
f32 mViscosityResistance
Definition d_a_obj_movebox.h:35
u32 field_0x7c
Definition d_a_obj_movebox.h:60
f32 mTiltSpringFactor
Definition d_a_obj_movebox.h:49
u8 field_0x9d
Definition d_a_obj_movebox.h:72
f32 mUnitDistance
Definition d_a_obj_movebox.h:32
s16 field_0x94
Definition d_a_obj_movebox.h:67
f32 mWaterViscoscityResistance
Definition d_a_obj_movebox.h:44
f32 mMiscTiltPower
Definition d_a_obj_movebox.h:47
f32 mShadowSize
Definition d_a_obj_movebox.h:33
u32 field_0x88
Definition d_a_obj_movebox.h:63
u32 field_0x60
Definition d_a_obj_movebox.h:53
f32 field_0x6c
Definition d_a_obj_movebox.h:56
s16 mFirstPushStopTime
Definition d_a_obj_movebox.h:26
u8 field_0x9e
Definition d_a_obj_movebox.h:73
Definition d_a_obj_movebox.h:22
STATIC_ASSERT(sizeof(daObjMovebox::Act_c)==0x90C)
void fopAcM_offSwitch(const fopAc_ac_c *pActor, int sw)
Definition f_op_actor_mng.h:429
BOOL fopAcM_isSwitch(const fopAc_ac_c *pActor, int sw)
Definition f_op_actor_mng.h:433
void fopAcM_onSwitch(const fopAc_ac_c *pActor, int sw)
Definition f_op_actor_mng.h:425
f32 Mtx[3][4]
Definition mtx.h:15
Definition d_a_obj_movebox.h:21
int PrmAbstract(const fopAc_ac_c *i_actor, T i_prmA, T i_prmB)
Definition d_a_obj.h:20
Definition d_a_ep.cpp:155
Definition d_a_hozelda.cpp:20
Definition d_a_ep.cpp:110
Definition d_a_npc_fguard.cpp:86
Definition d_a_npc_fguard.cpp:74
Definition d_a_npc_fguard.cpp:70
Definition d_a_npc_cd2.cpp:35
Definition d_a_ep.cpp:19
Definition d_a_hozelda.cpp:14
signed char s8
Definition types.h:4
unsigned long u32
Definition types.h:10
float f32
Definition types.h:22
signed short s16
Definition types.h:5
unsigned short u16
Definition types.h:9
unsigned char u8
Definition types.h:8