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_a_obj.h"
6#include "d/d_bg_w.h"
7#include "d/d_com_inf_game.h"
9
10
22namespace daObjMovebox {
23
24enum Type_e { pp_field = 3 };
25
26struct Attr_c {
27 struct sMinMax3 { // fabricated
28 s16 xMin;
29 s16 xMax;
30 s16 yMin;
31 s16 yMax;
32 s16 zMin;
33 s16 zMax;
34 };
35 /* 0x00 */ s16 mFirstPushStopTime;
36 /* 0x02 */ s16 mRepeatPushStopTime;
37 /* 0x04 */ s16 mPushMoveTime;
38 /* 0x06 */ s16 mFirstPullStopTime;
39 /* 0x08 */ s16 mRepeatPullStopTime;
40 /* 0x0A */ s16 mPullMoveTime;
41 /* 0x0C */ f32 mUnitDistance;
42 /* 0x10 */ f32 mShadowSize;
43 /* 0x14 */ f32 mGravity;
44 /* 0x18 */ f32 mViscosityResistance;
45 /* 0x1C */ f32 mInertiaResistance;
46 /* 0x20 */ f32 mFallYInitSpeed;
47 /* 0x24 */ f32 mLandSmokeScale;
48 /* 0x28 */ f32 mBuoyancy;
49 /* 0x2C */ f32 mPlayerGravity;
50 /* 0x30 */ f32 mMiscGravity;
51 /* 0x34 */ f32 mWaterOscillationAccel;
55 /* 0x44 */ f32 mPlayerTiltPower;
56 /* 0x48 */ f32 mMiscTiltPower;
57 /* 0x4C */ f32 mMaxTiltPower;
58 /* 0x50 */ f32 mTiltSpringFactor;
60 /* 0x58 */ int mModelResIdx;
61 /* 0x5C */ int mMoveBGIdx;
62 /* 0x60 */ u32 mHeapSize;
63 /* 0x64 */ f32 mScaleY;
64 /* 0x68 */ f32 field_0x68;
65 /* 0x6C */ f32 mWaterBobScale; // always the reciprocal of field_0x68
66 /* 0x70 */ f32 mScaleXZ;
67 /* 0x74 */ f32 mTiltForceScale; // always the reciprocal of mScaleXZ
68 /* 0x78 */ f32 field_0x78;
74 /* 0x90 */ sMinMax3 mCull;
75 /* 0x9C */ bool field_0x9c;
76 /* 0x9D */ bool mDisableShadow;
77 /* 0x9E */ bool mUseLargeGrid;
78};
79
80struct Hio_c : JORReflexible {
81 Hio_c(daObjMovebox::Type_e);
82 void default_set();
83 void ct();
84 void dt();
85 void genMessage(JORMContext*);
86
87 static u8 M_flag_bgc[8];
88 static const char* const M_name[];
89
90 /* 0x4 */ Type_e mType;
91 /* 0x8 */ int mCount;
93};
94
95struct BgcSrc_c {
96 /* 0x0 */ f32 field_0x0;
97 /* 0x4 */ f32 field_0x4;
98 /* 0x8 */ f32 field_0x8;
99 /* 0xC */ f32 field_0xc;
100};
101
102class Act_c;
103
104struct Bgc_c {
105 enum State_e {
114 };
115
116 Bgc_c();
117 void gnd_pos(daObjMovebox::Act_c const*, daObjMovebox::BgcSrc_c const*, int, f32);
118 void wrt_pos(cXyz const&);
119 void wall_pos(daObjMovebox::Act_c const*, daObjMovebox::BgcSrc_c const*, int, s16, f32);
121 bool chk_wall_pre(daObjMovebox::Act_c const*, daObjMovebox::BgcSrc_c const*, int, s16);
123 bool chk_wall_touch2(daObjMovebox::Act_c const*, daObjMovebox::BgcSrc_c const*, int, s16);
124
125 static const daObjMovebox::BgcSrc_c M_lin5[];
126 static const daObjMovebox::BgcSrc_c M_lin20[];
127
131
132 /* 0x000 */ f32 field_0x0[23];
133 /* 0x05C */ int field_0x5c;
134 /* 0x060 */ f32 field_0x60;
135 /* 0x064 */ cXyz field_0x64[23];
136 /* 0x178 */ int field_0x178;
137 /* 0x17C */ f32 field_0x17c;
138 /* 0x180 */ State_e mState;
139#if DEBUG
140 /* 0x184 */ cXyz field_0x184[92];
141 /* 0x184 */ cXyz field_0x5D4[92];
142 /* 0xA24 */ int field_0xA24;
143 /* 0xA28 */ int field_0xA28;
144#endif
145};
146
147struct Act_c : public dBgS_MoveBgActor {
148 enum Prm_e {
149 PRM_4_e = 0x4,
150 PRM_8_e = 0x8,
151 PRM_18_e = 0x18,
152 PRM_1C_e = 0x1C,
153 };
154
155 int prm_get_swSave1() const;
156 void prmZ_init();
157 void prmX_init();
158 // it seems like this signature changed between GCN and Wii?
159 // GCN only matches with a const reference return type and Wii/Shield only match with non-const
160#if PLATFORM_GCN
161 const daObjMovebox::Attr_c& attr() const;
162#else
164#endif
165 void set_mtx();
166 void init_mtx();
167 void path_init();
168 void path_save();
171 void afl_sway();
174 bool chk_appear() const;
177 void mode_wait();
179 void mode_walk();
181 void mode_afl();
185 void vib_land();
187 void eff_break();
188
189 virtual int CreateHeap();
190 virtual int Create();
191 virtual int Execute(Mtx**);
192 virtual int Draw();
193 virtual int Delete();
194
195 inline void mode_proc_call();
196 inline int Mthd_Create();
197 inline int Mthd_Delete();
198
199 int prm_get_swSave() const { return daObj::PrmAbstract(this, PRM_8_e, PRM_8_e); }
200 int prmZ_get_swSave2() const { return (u8)(mPrmZ >> 8); }
201 int prm_get_dmy() const { return 0; }
202 int prmZ_get_pathId() const { return mPrmZ & 0xFF; }
203 u8 prm_get_answer() const { return daObj::PrmAbstract(this, PRM_4_e, PRM_1C_e); }
204 int prm_get_type() const { return daObj::PrmAbstract(this, PRM_4_e, PRM_18_e); }
205
206 bool is_switch1() const { return fopAcM_isSwitch(this, prm_get_swSave1()); }
207 int is_switch2() const { return fopAcM_isSwitch(this, prmZ_get_swSave2()) != 0; }
208
209 void on_switch1() const { fopAcM_onSwitch(this, prm_get_swSave1()); }
210 void on_switch2() const { fopAcM_onSwitch(this, prmZ_get_swSave2()); }
213
214 int getType() { return prm_get_type(); }
215
216 static const s16 M_dir_base[4];
217 static const char* const M_arcname[8];
218 static const dCcD_SrcCyl M_cyl_src;
219
220 static const daObjMovebox::Attr_c M_attr[8];
221
223 /* 0x5A8 */ J3DModel* mpModel;
224 /* 0x5AC */ int field_0x5ac;
225 /* 0x5B0 */ dCcD_Stts mCcStts;
226 /* 0x5EC */ dCcD_Cyl mCcCyl;
227 /* 0x728 */ Bgc_c mBgc;
228 /* 0x8AC */ int mType;
229 /* 0x8B0 */ u16 mPrmZ;
230 /* 0x8B2 */ u16 mPrmX;
231 /* 0x8B4 */ dPath* mpPath;
232 /* 0x8B8 */ s16 field_0x8b8;
233 /* 0x8BC */ f32 field_0x8bc;
234 /* 0x8C0 */ f32 field_0x8c0;
235 /* 0x8C4 */ f32 field_0x8c4;
236 /* 0x8C8 */ f32 field_0x8c8;
237 /* 0x8CC */ f32 field_0x8cc;
238 /* 0x8D0 */ f32 field_0x8d0;
239 /* 0x8D4 */ f32 field_0x8d4;
240 /* 0x8D8 */ f32 field_0x8d8;
241 /* 0x8DC */ int field_0x8dc;
242 /* 0x8E0 */ int field_0x8e0;
243 /* 0x8E4 */ f32 field_0x8e4;
244 /* 0x8E8 */ int field_0x8e8;
246 /* 0x8F0 */ s16 field_0x8f0[4];
247 /* 0x8F8 */ s16 field_0x8f8;
248 /* 0x8FA */ s16 field_0x8fa;
249 /* 0x8FC */ s16 field_0x8fc;
250 /* 0x8FE */ u8 field_0x8fe;
251 /* 0x8FF */ s8 mReverb;
252 /* 0x900 */ u8 field_0x900;
253 /* 0x901 */ u8 field_0x901;
254 /* 0x902 */ u8 field_0x902;
255 /* 0x904 */ int field_0x904;
256 /* 0x908 */ s8 field_0x908;
257#if DEBUG
258 static daObjMovebox::Hio_c M_hio[];
259#endif
260};
261}; // namespace daObjMovebox
262
264
265#endif /* D_A_OBJ_MOVEBOX_H */
Z2SoundID
Definition Z2SeMgr.h:123
Definition d_bg_s_movebg_actor.h:11
Definition d_bg_s_gnd_chk.h:19
Definition d_bg_s_lin_chk.h:48
Definition d_bg_s_wtr_chk.h:6
PushPullLabel
Definition d_bg_w_base.h:29
Definition d_bg_w.h:262
Definition d_cc_d.h:472
Definition d_cc_d.h:273
Type_e
Definition d_a_obj_movebox.h:24
@ pp_field
Definition d_a_obj_movebox.h:24
Definition f_op_actor.h:271
STATIC_ASSERT(sizeof(daObjMovebox::Act_c)==0x90C)
BOOL fopAcM_isSwitch(const fopAc_ac_c *i_actor, int sw)
Definition f_op_actor_mng.h:446
void fopAcM_offSwitch(const fopAc_ac_c *i_actor, int sw)
Definition f_op_actor_mng.h:438
void fopAcM_onSwitch(const fopAc_ac_c *i_actor, int sw)
Definition f_op_actor_mng.h:434
Definition d_a_obj_movebox.cpp:34
T PrmAbstract(const fopAc_ac_c *i_actor, T i_nbits, T i_shift)
Definition d_a_obj.h:20
Definition c_xyz.h:7
Definition d_cc_d.h:104
Definition d_path.h:18
Definition d_a_obj_movebox.h:147
f32 field_0x8c4
Definition d_a_obj_movebox.h:235
s16 field_0x8f8
Definition d_a_obj_movebox.h:247
int getType()
Definition d_a_obj_movebox.h:214
dCcD_Cyl mCcCyl
Definition d_a_obj_movebox.h:226
Prm_e
Definition d_a_obj_movebox.h:148
@ PRM_18_e
Definition d_a_obj_movebox.h:151
@ PRM_4_e
Definition d_a_obj_movebox.h:149
@ PRM_1C_e
Definition d_a_obj_movebox.h:152
@ PRM_8_e
Definition d_a_obj_movebox.h:150
dCcD_Stts mCcStts
Definition d_a_obj_movebox.h:225
bool chk_appear() const
void off_switch1() const
Definition d_a_obj_movebox.h:211
static daObjMovebox::Hio_c M_hio[]
Definition d_a_obj_movebox.h:353
static fopAc_ac_c * PPCallBack(fopAc_ac_c *, fopAc_ac_c *, s16, dBgW_Base::PushPullLabel)
f32 field_0x8e4
Definition d_a_obj_movebox.h:243
const daObjMovebox::Attr_c & attr() const
Definition d_a_obj_movebox.cpp:598
int field_0x904
Definition d_a_obj_movebox.h:255
s8 field_0x908
Definition d_a_obj_movebox.h:256
s8 mReverb
Definition d_a_obj_movebox.h:251
u8 field_0x901
Definition d_a_obj_movebox.h:253
f32 field_0x8c0
Definition d_a_obj_movebox.h:234
daObjMovebox::Attr_c & attr() const
static const dCcD_SrcCyl M_cyl_src
Definition d_a_obj_movebox.h:416
static const daObjMovebox::Attr_c M_attr[8]
Definition d_a_obj_movebox.h:433
u16 mPrmX
Definition d_a_obj_movebox.h:230
void prmX_init()
Definition d_a_obj_movebox.cpp:401
static const char *const M_arcname[8]
Definition d_a_obj_movebox.h:412
int field_0x8dc
Definition d_a_obj_movebox.h:241
Bgc_c mBgc
Definition d_a_obj_movebox.h:227
s16 field_0x8f0[4]
Definition d_a_obj_movebox.h:246
f32 field_0x8cc
Definition d_a_obj_movebox.h:237
int prm_get_type() const
Definition d_a_obj_movebox.h:204
int mType
Definition d_a_obj_movebox.h:228
u8 prm_get_answer() const
Definition d_a_obj_movebox.h:203
int field_0x5ac
Definition d_a_obj_movebox.h:224
int is_switch2() const
Definition d_a_obj_movebox.h:207
void on_switch2() const
Definition d_a_obj_movebox.h:210
f32 field_0x8d8
Definition d_a_obj_movebox.h:240
int prmZ_get_swSave2() const
Definition d_a_obj_movebox.h:200
f32 field_0x8d4
Definition d_a_obj_movebox.h:239
virtual int Draw()
s16 field_0x8fc
Definition d_a_obj_movebox.h:249
void prmZ_init()
Definition d_a_obj_movebox.cpp:385
int field_0x8e0
Definition d_a_obj_movebox.h:242
u8 field_0x8fe
Definition d_a_obj_movebox.h:250
bool is_switch1() const
Definition d_a_obj_movebox.h:206
J3DModel * mpModel
Definition d_a_obj_movebox.h:223
u8 field_0x902
Definition d_a_obj_movebox.h:254
f32 field_0x8d0
Definition d_a_obj_movebox.h:238
f32 field_0x8bc
Definition d_a_obj_movebox.h:233
dBgW::PushPullLabel mPPLabel
Definition d_a_obj_movebox.h:245
virtual int Create()
static void RideCallBack(dBgW *, fopAc_ac_c *, fopAc_ac_c *)
static const s16 M_dir_base[4]
Definition d_a_obj_movebox.h:22
int prm_get_swSave1() const
Definition d_a_obj_movebox.cpp:381
int prm_get_swSave() const
Definition d_a_obj_movebox.h:199
int field_0x8e8
Definition d_a_obj_movebox.h:244
f32 field_0x8c8
Definition d_a_obj_movebox.h:236
s16 field_0x8b8
Definition d_a_obj_movebox.h:232
u16 mPrmZ
Definition d_a_obj_movebox.h:229
request_of_phase_process_class mPhase
Definition d_a_obj_movebox.h:222
int prmZ_get_pathId() const
Definition d_a_obj_movebox.h:202
dPath * mpPath
Definition d_a_obj_movebox.h:231
void on_switch1() const
Definition d_a_obj_movebox.h:209
virtual int Delete()
void off_switch2() const
Definition d_a_obj_movebox.h:212
u8 field_0x900
Definition d_a_obj_movebox.h:252
int prm_get_dmy() const
Definition d_a_obj_movebox.h:201
virtual int Execute(Mtx **)
s16 field_0x8fa
Definition d_a_obj_movebox.h:248
virtual int CreateHeap()
Definition d_a_obj_movebox.h:27
s16 yMin
Definition d_a_obj_movebox.h:30
s16 yMax
Definition d_a_obj_movebox.h:31
s16 xMax
Definition d_a_obj_movebox.h:29
s16 zMax
Definition d_a_obj_movebox.h:33
s16 xMin
Definition d_a_obj_movebox.h:28
s16 zMin
Definition d_a_obj_movebox.h:32
Definition d_a_obj_movebox.h:26
f32 field_0x68
Definition d_a_obj_movebox.h:64
f32 mShadowSize
Definition d_a_obj_movebox.h:42
f32 mTiltSpringFactor
Definition d_a_obj_movebox.h:58
s16 mPullMoveTime
Definition d_a_obj_movebox.h:40
sMinMax3 mCull
Definition d_a_obj_movebox.h:74
int mMoveBGIdx
Definition d_a_obj_movebox.h:61
f32 mPlayerTiltPower
Definition d_a_obj_movebox.h:55
f32 mTiltForceScale
Definition d_a_obj_movebox.h:67
s16 mRepeatPushStopTime
Definition d_a_obj_movebox.h:36
f32 mMiscGravity
Definition d_a_obj_movebox.h:50
f32 mInertiaResistance
Definition d_a_obj_movebox.h:45
s16 mFirstPushStopTime
Definition d_a_obj_movebox.h:35
Z2SoundID mSoundSlip
Definition d_a_obj_movebox.h:69
f32 mBuoyancy
Definition d_a_obj_movebox.h:48
int mModelResIdx
Definition d_a_obj_movebox.h:60
f32 field_0x78
Definition d_a_obj_movebox.h:68
bool mUseLargeGrid
Definition d_a_obj_movebox.h:77
s16 mFirstPullStopTime
Definition d_a_obj_movebox.h:38
f32 mGravity
Definition d_a_obj_movebox.h:43
f32 mWaterBobScale
Definition d_a_obj_movebox.h:65
f32 mLandSmokeScale
Definition d_a_obj_movebox.h:47
s16 mPushMoveTime
Definition d_a_obj_movebox.h:37
f32 mFallYInitSpeed
Definition d_a_obj_movebox.h:46
s16 mRepeatPullStopTime
Definition d_a_obj_movebox.h:39
Z2SoundID mSoundLimit
Definition d_a_obj_movebox.h:70
f32 mWaterViscoscityResistance
Definition d_a_obj_movebox.h:53
f32 mPlayerGravity
Definition d_a_obj_movebox.h:49
u32 mHeapSize
Definition d_a_obj_movebox.h:62
Z2SoundID mSoundFallMagma
Definition d_a_obj_movebox.h:73
f32 mTiltViscoscityResistance
Definition d_a_obj_movebox.h:59
f32 mViscosityResistance
Definition d_a_obj_movebox.h:44
bool mDisableShadow
Definition d_a_obj_movebox.h:76
f32 mWaterOscillationAccel
Definition d_a_obj_movebox.h:51
f32 mMiscTiltPower
Definition d_a_obj_movebox.h:56
f32 mWaterInertiaResistance
Definition d_a_obj_movebox.h:54
f32 mUnitDistance
Definition d_a_obj_movebox.h:41
Z2SoundID mSoundFallWater
Definition d_a_obj_movebox.h:72
Z2SoundID mSoundLand
Definition d_a_obj_movebox.h:71
f32 mScaleY
Definition d_a_obj_movebox.h:63
f32 mMaxTiltPower
Definition d_a_obj_movebox.h:57
bool field_0x9c
Definition d_a_obj_movebox.h:75
f32 mScaleXZ
Definition d_a_obj_movebox.h:66
s16 mWaterOscillationAngleSpeed
Definition d_a_obj_movebox.h:52
Definition d_a_obj_movebox.h:95
f32 field_0xc
Definition d_a_obj_movebox.h:99
f32 field_0x0
Definition d_a_obj_movebox.h:96
f32 field_0x8
Definition d_a_obj_movebox.h:98
f32 field_0x4
Definition d_a_obj_movebox.h:97
Definition d_a_obj_movebox.h:104
static dBgS_WtrChk M_wrt_work
Definition d_a_obj_movebox.h:129
int field_0x178
Definition d_a_obj_movebox.h:136
cXyz field_0x5D4[92]
Definition d_a_obj_movebox.h:141
static dBgS_ObjLinChk M_wall_work[23]
Definition d_a_obj_movebox.h:130
f32 field_0x0[23]
Definition d_a_obj_movebox.h:132
f32 field_0x60
Definition d_a_obj_movebox.h:134
void gnd_pos(daObjMovebox::Act_c const *, daObjMovebox::BgcSrc_c const *, int, f32)
Definition d_a_obj_movebox.cpp:133
f32 field_0x17c
Definition d_a_obj_movebox.h:137
bool chk_wall_pre(daObjMovebox::Act_c const *, daObjMovebox::BgcSrc_c const *, int, s16)
Definition d_a_obj_movebox.cpp:291
bool chk_wall_touch2(daObjMovebox::Act_c const *, daObjMovebox::BgcSrc_c const *, int, s16)
Definition d_a_obj_movebox.cpp:366
bool chk_wall_touch(daObjMovebox::Act_c const *, daObjMovebox::BgcSrc_c const *, s16)
Definition d_a_obj_movebox.cpp:298
static const daObjMovebox::BgcSrc_c M_lin5[]
Definition d_a_obj_movebox.h:102
static const daObjMovebox::BgcSrc_c M_lin20[]
Definition d_a_obj_movebox.h:107
void wall_pos(daObjMovebox::Act_c const *, daObjMovebox::BgcSrc_c const *, int, s16, f32)
Definition d_a_obj_movebox.cpp:192
Bgc_c()
Definition d_a_obj_movebox.cpp:118
cXyz field_0x184[92]
Definition d_a_obj_movebox.h:140
cXyz field_0x64[23]
Definition d_a_obj_movebox.h:135
State_e
Definition d_a_obj_movebox.h:105
@ STATE_8_e
Definition d_a_obj_movebox.h:110
@ STATE_10_e
Definition d_a_obj_movebox.h:111
@ STATE_0_e
Definition d_a_obj_movebox.h:106
@ STATE_20_e
Definition d_a_obj_movebox.h:112
@ STATE_4_e
Definition d_a_obj_movebox.h:109
@ STATE_40_e
Definition d_a_obj_movebox.h:113
@ STATE_2_e
Definition d_a_obj_movebox.h:108
@ STATE_1_e
Definition d_a_obj_movebox.h:107
static dBgS_ObjGndChk M_gnd_work[23]
Definition d_a_obj_movebox.h:128
int field_0xA24
Definition d_a_obj_movebox.h:142
int field_0xA28
Definition d_a_obj_movebox.h:143
void wrt_pos(cXyz const &)
Definition d_a_obj_movebox.cpp:171
State_e mState
Definition d_a_obj_movebox.h:138
int field_0x5c
Definition d_a_obj_movebox.h:133
void proc_vertical(daObjMovebox::Act_c *)
Definition d_a_obj_movebox.cpp:252
Definition d_a_obj_movebox.h:80
void genMessage(JORMContext *)
Definition d_a_obj_movebox.cpp:67
void ct()
Definition d_a_obj_movebox.cpp:55
void default_set()
Definition d_a_obj_movebox.cpp:51
Hio_c(daObjMovebox::Type_e)
Definition d_a_obj_movebox.cpp:45
void dt()
Definition d_a_obj_movebox.cpp:61
static u8 M_flag_bgc[8]
Definition d_a_obj_movebox.h:87
Type_e mType
Definition d_a_obj_movebox.h:90
int mCount
Definition d_a_obj_movebox.h:91
static const char *const M_name[]
Definition d_a_obj_movebox.h:21
daObjMovebox::Attr_c mAttr
Definition d_a_obj_movebox.h:92
Definition c_phase.h:19