forked from zeldaret/tp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathd_bg_w.h
More file actions
344 lines (314 loc) · 14 KB
/
d_bg_w.h
File metadata and controls
344 lines (314 loc) · 14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
#ifndef D_BG_D_BG_W_H
#define D_BG_D_BG_W_H
#include "SSystem/SComponent/c_m3d_g_aab.h"
#include "SSystem/SComponent/c_sxyz.h"
#include "d/d_bg_w_base.h"
#include "dolphin/mtx.h"
#include "dolphin/types.h"
class cBgS_GrpPassChk;
class cBgS_PolyPassChk;
class fopAc_ac_c;
struct cBgD_Vtx_t;
struct dBgS_CaptPoly;
class cBgW_TriElm {
public:
/* 0x00 */ cM3dGPla m_plane;
/* 80079754 */ cBgW_TriElm();
/* 800796F8 */ virtual ~cBgW_TriElm();
/* 0x14 vtable */
}; // Size: 0x18
class cBgW_RwgElm {
public:
/* 0x0 */ u16 m_next;
/* 800791C4 */ cBgW_RwgElm();
/* 800791D4 */ virtual ~cBgW_RwgElm();
}; // Size: 0x8
class cBgW_NodeTree : public cM3dGAab {
public:
/* 8007921C */ cBgW_NodeTree();
/* 80079238 */ virtual ~cBgW_NodeTree();
};
class cBgW_GrpElm {
public:
/* 8007A1E4 */ cBgW_GrpElm();
/* 8007A184 */ virtual ~cBgW_GrpElm();
/* 0x4 */ cM3dGAab m_aab;
};
struct cBgW_BlkElm {
/* 0x0 */ u16 m_roof_idx;
/* 0x2 */ u16 m_wall_idx;
/* 0x4 */ u16 m_gnd_idx;
}; // Size: 0x6
struct cBgD_Tri_t {
/* 0x0 */ u16 m_vtx_idx0;
/* 0x2 */ u16 m_vtx_idx1;
/* 0x4 */ u16 m_vtx_idx2;
/* 0x6 */ u16 m_id;
/* 0x8 */ u16 m_grp;
}; // Size: 0xA
struct cBgD_Ti_t {
/* 0x0 */ u32 m_info0;
/* 0x4 */ u32 m_info1;
/* 0x8 */ u32 m_info2;
/* 0xC */ u32 m_passFlag;
};
struct cBgD_Blk_t {
/* 0x0 */ u16 field_0x0;
};
struct cBgD_Tree_t {
/* 0x0 */ u16 m_flag;
/* 0x2 */ u16 m_parent_id;
/* 0x4 */ u16 m_id[8];
}; // Size: 0x14
struct cBgD_Grp_t {
/* 0x00 */ char* m_name;
/* 0x04 */ cXyz m_scale;
/* 0x10 */ csXyz m_rotation;
/* 0x18 */ cXyz m_translation;
/* 0x24 */ u16 m_parent;
/* 0x26 */ u16 m_next_sibling;
/* 0x28 */ u16 m_first_child;
/* 0x2A */ u16 m_room_id;
/* 0x2C */ u16 m_first_vtx_idx;
/* 0x2E */ u16 m_tree_idx;
/* 0x30 */ u32 m_info;
}; // Size: 0x34
struct cBgD_t {
/* 0x00 */ int m_v_num; // vertex num
/* 0x04 */ cBgD_Vtx_t* m_v_tbl; // vertex table
/* 0x08 */ int m_t_num; // triangle num
/* 0x0C */ cBgD_Tri_t* m_t_tbl; // triangle table
/* 0x10 */ int m_b_num;
/* 0x14 */ cBgD_Blk_t* m_b_tbl;
/* 0x18 */ int m_tree_num;
/* 0x1C */ cBgD_Tree_t* m_tree_tbl;
/* 0x20 */ int m_g_num;
/* 0x24 */ cBgD_Grp_t* m_g_tbl;
/* 0x28 */ int m_ti_num;
/* 0x2C */ cBgD_Ti_t* m_ti_tbl;
/* 0x30 */ int mFlags;
};
class cBgW : public dBgW_Base {
public:
enum Flags_e {
MOVE_BG_e = 0x1,
NO_CALC_VTX_e = 0x2,
NO_VTX_TBL_e = 0x10,
GLOBAL_e = 0x20,
CBGW_UNK_FLAG_40 = 0x40,
LOCK_e = 0x80,
};
/* 80079294 */ cBgW();
/* 800793A4 */ void FreeArea();
/* 800793C4 */ void GlobalVtx();
/* 80079484 */ bool SetVtx();
/* 80079668 */ bool SetTri();
/* 80079770 */ void BlckConnect(u16*, int*, int);
/* 8007998C */ void MakeBlckTransMinMax(cXyz*, cXyz*);
/* 800799E0 */ void MakeBlckMinMax(int, cXyz*, cXyz*);
/* 80079A68 */ void MakeBlckBnd(int, cXyz*, cXyz*);
/* 80079BDC */ void MakeNodeTreeRp(int);
/* 80079CC4 */ void MakeNodeTreeGrpRp(int);
/* 80079DF0 */ void MakeNodeTree();
/* 80079F38 */ bool Set(cBgD_t* pdzb, u32 flags, Mtx* pbase_mtx);
/* 8007A200 */ bool RwgLineCheck(u16, cBgS_LinChk*);
/* 8007A3A0 */ bool LineCheckRp(cBgS_LinChk*, int);
/* 8007A52C */ bool LineCheckGrpRp(cBgS_LinChk*, int, int);
/* 8007A680 */ bool RwgGroundCheckCommon(f32, u16, cBgS_GndChk*);
/* 8007A774 */ bool RwgGroundCheckGnd(u16, cBgS_GndChk*);
/* 8007A824 */ bool RwgGroundCheckWall(u16, cBgS_GndChk*);
/* 8007A8F4 */ bool GroundCrossRp(cBgS_GndChk*, int);
/* 8007AA50 */ bool GroundCrossGrpRp(cBgS_GndChk*, int, int);
/* 8007ABC4 */ void CopyOldMtx();
/* 8007AC10 */ void Move();
/* 8007ADF0 */ void RwgShdwDraw(int, cBgS_ShdwDraw*);
/* 8007AEA4 */ void ShdwDrawRp(cBgS_ShdwDraw*, int);
/* 8007AFC0 */ void ShdwDrawGrpRp(cBgS_ShdwDraw*, int);
/* 8007B17C */ void GetTrans(cXyz*) const;
/* 8007B2F4 */ int GetPolyInfId(int) const;
/* 8007B30C */ u32 GetPolyInf0(int, u32, u32) const;
/* 8007B360 */ u32 GetMaskPolyInf0_NoShift(int, u32) const;
/* 8007B654 */ u32 GetPolyInf1(int, u32, u32) const;
/* 8007B78C */ u32 GetMaskPolyInf1_NoShift(int, u32) const;
/* 8007B824 */ u32 GetPolyInf2(int, u32, u32) const;
/* 8007B930 */ int GetTriGrp(int) const;
/* 8007933C */ virtual ~cBgW();
/* 80079EEC */ virtual bool ChkMemoryError();
/* 8007B948 */ virtual bool ChkNotReady() const;
/* 8007B958 */ virtual bool ChkLock() const;
/* 8007B964 */ virtual bool ChkMoveBg() const;
virtual u32 ChkMoveFlag() const = 0;
/* 8007B270 */ virtual cM3dGPla GetTriPla(cBgS_PolyInfo const&) const;
/* 8007B1B4 */ virtual bool GetTriPnt(cBgS_PolyInfo const&, cXyz*, cXyz*, cXyz*) const;
/* 8007B164 */ virtual cM3dGAab* GetBnd() const;
/* 8007B2B0 */ virtual u32 GetGrpInf(cBgS_PolyInfo const&) const;
virtual void OffMoveFlag() = 0;
/* 8007B240 */ virtual void GetTopUnder(f32*, f32*) const;
/* 8007A658 */ virtual bool LineCheck(cBgS_LinChk*);
/* 8007AB9C */ virtual bool GroundCross(cBgS_GndChk*);
/* 8007B084 */ virtual void ShdwDraw(cBgS_ShdwDraw*);
virtual void CaptPoly(dBgS_CaptPoly&) = 0;
virtual bool WallCorrect(dBgS_Acch*) = 0;
virtual bool WallCorrectSort(dBgS_Acch*) = 0;
virtual bool RoofChk(dBgS_RoofChk*) = 0;
virtual bool SplGrpChk(dBgS_SplGrpChk*) = 0;
virtual bool SphChk(dBgS_SphChk*, void*) = 0;
/* 8007B0E4 */ virtual s32 GetGrpRoomIndex(cBgS_PolyInfo const&) const;
virtual s32 GetExitId(cBgS_PolyInfo const&) = 0;
virtual s32 GetPolyColor(cBgS_PolyInfo const&) = 0;
virtual BOOL GetHorseNoEntry(cBgS_PolyInfo const&) = 0;
virtual int GetSpecialCode(cBgS_PolyInfo const&) = 0;
virtual int GetSpecialCode(int) = 0;
virtual int GetMagnetCode(cBgS_PolyInfo const&) = 0;
virtual u32 GetPolyObjThrough(int) = 0;
virtual u32 GetPolyCamThrough(int) = 0;
virtual u32 GetPolyLinkThrough(int) = 0;
virtual u32 GetPolyArrowThrough(int) = 0;
virtual u32 GetPolyHSStick(int) = 0;
virtual u32 GetPolyBoomerangThrough(int) = 0;
virtual u32 GetPolyRopeThrough(int) = 0;
virtual u32 GetPolyBombThrough(int) = 0;
virtual bool GetShdwThrough(int) = 0;
virtual u32 GetUnderwaterRoofCode(int) = 0;
virtual int GetMonkeyBarsCode(cBgS_PolyInfo const&) = 0;
virtual int GetLinkNo(cBgS_PolyInfo const&) = 0;
virtual s32 GetWallCode(cBgS_PolyInfo const&) = 0;
virtual int GetPolyAtt0(cBgS_PolyInfo const&) = 0;
virtual int GetPolyAtt1(cBgS_PolyInfo const&) = 0;
virtual int GetGroundCode(cBgS_PolyInfo const&) = 0;
virtual u32 GetIronBallThrough(int) = 0;
virtual u32 GetAttackThrough(int) = 0;
virtual s32 GetCamMoveBG(cBgS_PolyInfo const&) = 0;
virtual s32 GetRoomCamId(cBgS_PolyInfo const&) = 0;
virtual s32 GetRoomPathId(cBgS_PolyInfo const&) = 0;
virtual s32 GetRoomPathPntNo(cBgS_PolyInfo const&) = 0;
virtual u8 GetPolyGrpRoomInfId(cBgS_PolyInfo const&) = 0;
virtual int GetGrpSoundId(cBgS_PolyInfo const&) = 0;
virtual void CrrPos(cBgS_PolyInfo const&, void*, bool, cXyz*, csXyz*, csXyz*) = 0;
virtual void TransPos(cBgS_PolyInfo const&, void*, bool, cXyz*, csXyz*, csXyz*) = 0;
virtual void MatrixCrrPos(cBgS_PolyInfo const&, void*, bool, cXyz*, csXyz*, csXyz*) = 0;
/* 80079564 */ virtual void CalcPlane();
/* 800797BC */ virtual void ClassifyPlane();
/* 8007B0A8 */ virtual bool ChkPolyThrough(int, cBgS_PolyPassChk*);
/* 8007B0B0 */ virtual bool ChkShdwDrawThrough(int, cBgS_PolyPassChk*);
/* 8007B0DC */ virtual bool ChkGrpThrough(int, cBgS_GrpPassChk*, int);
u32 GetOldInvMtx(Mtx m) { return MTXInverse(m_inv_mtx, m); }
MtxP GetBaseMtxP() { return pm_base; }
bool ChkNoCalcVtx() { return mFlags & NO_CALC_VTX_e; }
bool ChkFlush() { return field_0x91 & 8; }
void SetLock() { mFlags |= LOCK_e; }
void OffRoofRegist() { field_0x91 |= 0x4; }
void OnRoofRegist() { field_0x91 &= ~0x04; }
bool ChkRoofRegist() { return field_0x91 & 4;}
cBgD_Vtx_t* GetVtxTbl() const { return pm_vtx_tbl; }
int GetVtxNum() const { return pm_bgd->m_v_num; }
void ClrNoCalcVtx() { mFlags &= ~NO_CALC_VTX_e; }
void SetBaseMtxP(MtxP mtx) { pm_base = mtx; }
void SetNoCalcVtx() { mFlags |= NO_CALC_VTX_e; }
public:
/* 0x18 */ MtxP pm_base; // Model Matrix
/* 0x1C */ Mtx m_inv_mtx;
/* 0x4C */ Mtx m_mtx;
/* 0x7C */ cXyz mTransVel;
/* 0x88 */ u8 mFlags;
/* 0x89 */ u8 mNeedsFullTransform;
/* 0x8C */ u32 field_0x8c;
/* 0x90 */ u8 mMoveCounter;
/* 0x91 */ u8 field_0x91;
/* 0x92 */ u16 m_rootGrpIdx;
/* 0x94 */ cBgW_TriElm* pm_tri;
/* 0x98 */ cBgW_RwgElm* pm_rwg;
/* 0x9C */ cBgD_Vtx_t* pm_vtx_tbl;
/* 0xA0 */ cBgD_t* pm_bgd;
/* 0xA4 */ cBgW_BlkElm* pm_blk;
/* 0xA8 */ cBgW_GrpElm* pm_grp;
/* 0xAC */ cBgW_NodeTree* pm_node_tree;
};
class dBgW;
typedef void (*dBgW_RideCallback)(dBgW*, fopAc_ac_c*, fopAc_ac_c*);
typedef void (*dBgW_ArrowStickCallback)(dBgW*, fopAc_ac_c*, fopAc_ac_c*, cXyz&);
typedef void (*dBgW_CrrFunc)(dBgW*, void*, cBgS_PolyInfo const&, bool, cXyz*, csXyz*, csXyz*);
class dBgW : public cBgW {
public:
/* 8007B970 */ dBgW();
/* 8007B9C0 */ void Move();
/* 8007B9EC */ void positionWallCorrect(dBgS_Acch*, f32, cM3dGPla&, cXyz* pupper_pos, f32);
/* 8007BA40 */ bool RwgWallCorrect(dBgS_Acch*, u16);
/* 8007C234 */ bool WallCorrectRp(dBgS_Acch*, int);
/* 8007C360 */ bool WallCorrectGrpRp(dBgS_Acch*, int, int);
/* 8007C4AC */ void RwgWallCorrectSort(dBgS_Acch*, u16);
/* 8007C714 */ void WallCorrectRpSort(dBgS_Acch*, int);
/* 8007C808 */ bool WallCorrectGrpRpSort(dBgS_Acch*, int, int);
/* 8007D0DC */ bool RwgRoofChk(u16, dBgS_RoofChk*);
/* 8007D208 */ bool RoofChkRp(dBgS_RoofChk*, int);
/* 8007D330 */ bool RoofChkGrpRp(dBgS_RoofChk*, int, int);
/* 8007D498 */ bool RwgSplGrpChk(u16, dBgS_SplGrpChk*);
/* 8007D5C4 */ bool SplGrpChkRp(dBgS_SplGrpChk*, int);
/* 8007D6F0 */ bool SplGrpChkGrpRp(dBgS_SplGrpChk*, int, int);
/* 8007D858 */ void RwgCaptPoly(int, dBgS_CaptPoly&);
/* 8007D8E8 */ void CaptPolyRp(dBgS_CaptPoly&, int);
/* 8007DA04 */ void CaptPolyGrpRp(dBgS_CaptPoly&, int, int);
/* 8007DB20 */ bool RwgSphChk(u16, dBgS_SphChk*, void*);
/* 8007DC70 */ bool SphChkRp(dBgS_SphChk*, void*, int);
/* 8007DDE0 */ bool SphChkGrpRp(dBgS_SphChk*, void*, int, int);
/* 8007E548 */ virtual ~dBgW() {}
/* 8007E4B4 */ virtual u32 ChkMoveFlag() const;
/* 8007E4A4 */ virtual void OffMoveFlag();
/* 8007DAF8 */ virtual void CaptPoly(dBgS_CaptPoly&);
/* 8007C484 */ virtual bool WallCorrect(dBgS_Acch*);
/* 8007C910 */ virtual bool WallCorrectSort(dBgS_Acch*);
/* 8007D470 */ virtual bool RoofChk(dBgS_RoofChk*);
/* 8007D830 */ virtual bool SplGrpChk(dBgS_SplGrpChk*);
/* 8007DF00 */ virtual bool SphChk(dBgS_SphChk*, void*);
/* 8007B3AC */ virtual s32 GetExitId(cBgS_PolyInfo const&);
/* 8007B3D8 */ virtual s32 GetPolyColor(cBgS_PolyInfo const&);
/* 8007B404 */ virtual BOOL GetHorseNoEntry(cBgS_PolyInfo const&);
/* 8007B430 */ virtual int GetSpecialCode(cBgS_PolyInfo const&);
/* 8007B460 */ virtual int GetSpecialCode(int);
/* 8007B488 */ virtual int GetMagnetCode(cBgS_PolyInfo const&);
/* 8007B4E0 */ virtual u32 GetPolyObjThrough(int);
/* 8007B504 */ virtual u32 GetPolyCamThrough(int);
/* 8007B52C */ virtual u32 GetPolyLinkThrough(int);
/* 8007B550 */ virtual u32 GetPolyArrowThrough(int);
/* 8007B574 */ virtual u32 GetPolyHSStick(int);
/* 8007B598 */ virtual u32 GetPolyBoomerangThrough(int);
/* 8007B5BC */ virtual u32 GetPolyRopeThrough(int);
/* 8007B5E0 */ virtual u32 GetPolyBombThrough(int);
/* 8007B604 */ virtual bool GetShdwThrough(int);
/* 8007B630 */ virtual u32 GetUnderwaterRoofCode(int);
/* 8007B4B4 */ virtual int GetMonkeyBarsCode(cBgS_PolyInfo const&);
/* 8007B6AC */ virtual int GetLinkNo(cBgS_PolyInfo const&);
/* 8007B6D8 */ virtual s32 GetWallCode(cBgS_PolyInfo const&);
/* 8007B704 */ virtual int GetPolyAtt0(cBgS_PolyInfo const&);
/* 8007B734 */ virtual int GetPolyAtt1(cBgS_PolyInfo const&);
/* 8007B760 */ virtual int GetGroundCode(cBgS_PolyInfo const&);
/* 8007B7DC */ virtual u32 GetIronBallThrough(int);
/* 8007B800 */ virtual u32 GetAttackThrough(int);
/* 8007B87C */ virtual s32 GetCamMoveBG(cBgS_PolyInfo const&);
/* 8007B8A8 */ virtual s32 GetRoomCamId(cBgS_PolyInfo const&);
/* 8007B8D8 */ virtual s32 GetRoomPathId(cBgS_PolyInfo const&);
/* 8007B904 */ virtual s32 GetRoomPathPntNo(cBgS_PolyInfo const&);
/* 8007DF28 */ virtual u8 GetPolyGrpRoomInfId(cBgS_PolyInfo const&);
/* 8007DF58 */ virtual int GetGrpSoundId(cBgS_PolyInfo const&);
/* 8007DF88 */ virtual void CrrPos(cBgS_PolyInfo const&, void*, bool, cXyz*, csXyz*,
csXyz*);
/* 8007DFC4 */ virtual void TransPos(cBgS_PolyInfo const&, void*, bool, cXyz*, csXyz*,
csXyz*);
/* 8007E000 */ virtual void MatrixCrrPos(cBgS_PolyInfo const&, void*, bool, cXyz*,
csXyz*, csXyz*);
/* 8007E444 */ virtual void CallRideCallBack(fopAc_ac_c*, fopAc_ac_c*);
/* 8007E474 */ virtual void CallArrowStickCallBack(fopAc_ac_c*, fopAc_ac_c*, cXyz&);
/* 8007E02C */ virtual bool ChkPolyThrough(int, cBgS_PolyPassChk*);
/* 8007E360 */ virtual bool ChkShdwDrawThrough(int, cBgS_PolyPassChk*);
/* 8007E3D8 */ virtual bool ChkGrpThrough(int, cBgS_GrpPassChk*, int);
void SetCrrFunc(dBgW_CrrFunc func) { m_crr_func = func; }
void SetRideCallback(dBgW_RideCallback func) { m_ride_callback = func; }
void SetArrowStickCallback(dBgW_ArrowStickCallback func) { m_arrow_stick_callback = func; }
void OnMoveFlag() { m_flags |= 1; }
private:
/* 0xB0 */ dBgW_CrrFunc m_crr_func;
/* 0xB4 */ dBgW_RideCallback m_ride_callback;
/* 0xB8 */ dBgW_ArrowStickCallback m_arrow_stick_callback;
/* 0xBC */ u8 m_flags;
};
#endif /* D_BG_D_BG_W_H */