summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTakaRikka <38417346+TakaRikka@users.noreply.github.com>2021-11-10 10:56:51 -0800
committerGitHub <noreply@github.com>2021-11-10 19:56:51 +0100
commit74ed2da8bc93804373cddf64c0c878603150b699 (patch)
tree1acc85f32337fcf70cc4ffa6091824d362b7f8ff /include
parent901b222eb877be81bb9043d65b6616bd21152a12 (diff)
d_bg_s (#159)
* wip * d_bg_s * most of d_bg_s * small cleanup * clang * fixes
Diffstat (limited to 'include')
-rw-r--r--include/JSystem/J3DGraphBase/J3DVertex.h5
-rw-r--r--include/SSystem/SComponent/c_bg_s_chk.h23
-rw-r--r--include/SSystem/SComponent/c_bg_s_gnd_chk.h8
-rw-r--r--include/SSystem/SComponent/c_bg_s_lin_chk.h17
-rw-r--r--include/SSystem/SComponent/c_bg_s_poly_info.h18
-rw-r--r--include/SSystem/SComponent/c_bg_w.h15
-rw-r--r--include/SSystem/SComponent/c_xyz.h7
-rw-r--r--include/d/bg/d_bg_pc.h16
-rw-r--r--include/d/bg/d_bg_plc.h24
-rw-r--r--include/d/bg/d_bg_s.h133
-rw-r--r--include/d/bg/d_bg_s_acch.h181
-rw-r--r--include/d/bg/d_bg_s_chk.h13
-rw-r--r--include/d/bg/d_bg_s_gnd_chk.h52
-rw-r--r--include/d/bg/d_bg_s_grp_pass_chk.h23
-rw-r--r--include/d/bg/d_bg_s_lin_chk.h66
-rw-r--r--include/d/bg/d_bg_s_movebg_actor.h32
-rw-r--r--include/d/bg/d_bg_s_poly_pass_chk.h1
-rw-r--r--include/d/bg/d_bg_s_roof_chk.h17
-rw-r--r--include/d/bg/d_bg_s_sph_chk.h19
-rw-r--r--include/d/bg/d_bg_s_spl_grp_chk.h30
-rw-r--r--include/d/bg/d_bg_s_wtr_chk.h7
-rw-r--r--include/d/bg/d_bg_w.h269
-rw-r--r--include/d/bg/d_bg_w_base.h97
-rw-r--r--include/d/bg/d_bg_w_kcol.h83
-rw-r--r--include/d/com/d_com_inf_game.h8
-rw-r--r--include/d/d_resorce.h4
-rw-r--r--include/f_op/f_op_actor_mng.h23
-rw-r--r--include/m_Do/m_Do_mtx.h4
28 files changed, 868 insertions, 327 deletions
diff --git a/include/JSystem/J3DGraphBase/J3DVertex.h b/include/JSystem/J3DGraphBase/J3DVertex.h
index 9543468037..87e50c9276 100644
--- a/include/JSystem/J3DGraphBase/J3DVertex.h
+++ b/include/JSystem/J3DGraphBase/J3DVertex.h
@@ -2,6 +2,7 @@
#define J3DVERTEX_H
#include "dolphin/gx/GX.h"
+#include "dolphin/mtx/vec.h"
#include "dolphin/types.h"
class J3DModel;
@@ -84,11 +85,11 @@ private:
}; // Size: 0x38
struct VertexNormal {
- u8 data[0xC];
+ Vec data;
};
struct VertexPosition {
- u8 data[0xC];
+ Vec data;
};
#endif /* J3DVERTEX_H */
diff --git a/include/SSystem/SComponent/c_bg_s_chk.h b/include/SSystem/SComponent/c_bg_s_chk.h
index 3000479fa7..eddabdabf3 100644
--- a/include/SSystem/SComponent/c_bg_s_chk.h
+++ b/include/SSystem/SComponent/c_bg_s_chk.h
@@ -3,19 +3,32 @@
#include "dolphin/types.h"
+class cBgS_GrpPassChk {
+public:
+ virtual ~cBgS_GrpPassChk();
+};
+
+class cBgS_PolyPassChk;
+
class cBgS_Chk {
private:
- /* 0x0 */ u32 mPolyPassChk;
- /* 0x4 */ u32 mGrpPassChk;
+ /* 0x0 */ cBgS_PolyPassChk* mPolyPassChk;
+ /* 0x4 */ cBgS_GrpPassChk* mGrpPassChk;
/* 0x8 */ u32 mActorPid;
/* 0xC */ u8 unk_0x0C;
/* 0x10 */ // __vtable__
+
public:
- cBgS_Chk(void);
- virtual ~cBgS_Chk(void);
+ cBgS_Chk();
void SetExtChk(cBgS_Chk&);
bool ChkSameActorPid(unsigned int) const;
+
void setActorPid(u32 pid) { mActorPid = pid; }
-}; // Size = 0x14
+ u32 GetActorPid() const { return mActorPid; }
+ void SetPolyPassChk(cBgS_PolyPassChk* p_chk) { mPolyPassChk = p_chk; }
+ void SetGrpPassChk(cBgS_GrpPassChk* p_chk) { mGrpPassChk = p_chk; }
+
+ virtual ~cBgS_Chk(void);
+}; // Size: 0x14
#endif /* C_BG_S_CHK_H */
diff --git a/include/SSystem/SComponent/c_bg_s_gnd_chk.h b/include/SSystem/SComponent/c_bg_s_gnd_chk.h
index 7c63a99c6a..d1b2ceef59 100644
--- a/include/SSystem/SComponent/c_bg_s_gnd_chk.h
+++ b/include/SSystem/SComponent/c_bg_s_gnd_chk.h
@@ -7,15 +7,17 @@
#include "dolphin/types.h"
class cBgS_GndChk : public cBgS_Chk, public cBgS_PolyInfo {
+public:
/* 80267C1C */ cBgS_GndChk();
- /* 80267C94 */ virtual ~cBgS_GndChk();
/* 80267D28 */ void SetPos(cXyz const*);
/* 80267D0C */ void SetPos(Vec const*);
/* 80267D44 */ void PreCheck();
+ /* 80267C94 */ virtual ~cBgS_GndChk();
+
private:
- /* 0x24 */ cXyz mPosition;
- /* 0x30 */ s32 _30;
+ /* 0x24 */ cXyz m_pos;
+ /* 0x30 */ u32 mFlags;
/* 0x34 */ f32 mNowY;
/* 0x38 */ u32 mWallPrecheck;
};
diff --git a/include/SSystem/SComponent/c_bg_s_lin_chk.h b/include/SSystem/SComponent/c_bg_s_lin_chk.h
index 8e42c12876..2db857959e 100644
--- a/include/SSystem/SComponent/c_bg_s_lin_chk.h
+++ b/include/SSystem/SComponent/c_bg_s_lin_chk.h
@@ -9,9 +9,9 @@
class cBgS_LinChk : public cBgS_Chk, public cBgS_PolyInfo {
private:
- /* 0x024 */ cM3dGLin mLin;
+ /* 0x024 */ cM3dGLin mLinP;
/* 0x040 */ cXyz field_0x40;
- /* 0x04C */ int field_0x4c;
+ /* 0x04C */ u32 field_0x4c;
/* 0x050 */ bool mPreWallChk;
/* 0x051 */ bool mPreGroundChk;
/* 0x052 */ bool mPreRoofChk;
@@ -19,11 +19,16 @@ private:
/* 0x054 */ u8 mBackFlag;
public:
- cBgS_LinChk(void);
- virtual ~cBgS_LinChk(void);
- void ct(void);
+ cBgS_LinChk();
+ void ct();
void Set2(const cXyz*, const cXyz*, unsigned int);
- void PreCalc(void);
+ void PreCalc();
+
+ virtual ~cBgS_LinChk();
+
+ void ClrHit() { field_0x4c &= ~16; }
+ void SetHit() { field_0x4c |= 16; }
+ u32 ChkHit() const { return field_0x4c & 16; }
};
#endif /* C_BG_S_LIN_CHK_H */
diff --git a/include/SSystem/SComponent/c_bg_s_poly_info.h b/include/SSystem/SComponent/c_bg_s_poly_info.h
index ed0ca41b60..984c0cd5b9 100644
--- a/include/SSystem/SComponent/c_bg_s_poly_info.h
+++ b/include/SSystem/SComponent/c_bg_s_poly_info.h
@@ -6,20 +6,24 @@
class cBgS_PolyInfo {
private:
/* 0x00 */ u16 mPolyIndex;
- /* 0x02 */ u16 unk_0x02;
+ /* 0x02 */ u16 mBgIndex;
/* 0x04 */ void* unk_0x04;
/* 0x08 */ u32 unk_0x08;
public:
- cBgS_PolyInfo(void);
- virtual ~cBgS_PolyInfo(void);
- bool ChkSetInfo(void) const;
- void ClearPi(void);
+ cBgS_PolyInfo();
+ bool ChkSetInfo() const;
+ void ClearPi();
void SetPolyInfo(const cBgS_PolyInfo&);
void SetActorInfo(int, void*, unsigned int);
bool ChkSafe(const void*, unsigned int) const;
void SetPolyIndex(int);
- bool ChkBgIndex(void) const;
-};
+ bool ChkBgIndex() const;
+
+ virtual ~cBgS_PolyInfo();
+
+ u16 GetPolyIndex() const { return mPolyIndex; }
+ u16 GetBgIndex() const { return mBgIndex; }
+}; // Size: 0x10
#endif /* C_BG_S_POLY_INFO_H */
diff --git a/include/SSystem/SComponent/c_bg_w.h b/include/SSystem/SComponent/c_bg_w.h
index b46c178241..9837f8a2e0 100644
--- a/include/SSystem/SComponent/c_bg_w.h
+++ b/include/SSystem/SComponent/c_bg_w.h
@@ -4,14 +4,19 @@
#include "dolphin/types.h"
class cBgW_BgId {
+private:
+ /* 0x0 */ u16 m_id;
+ /* 0x4 vtable */
+
public:
- void Regist(int a1);
- void Release();
+ /* 802681C8 */ void Release();
+ /* 802681D4 */ bool ChkUsed() const;
+ /* 802681C0 */ void Regist(int);
- unsigned int ChkUsed() const;
+ /* 8007E5F8 */ virtual ~cBgW_BgId();
-private:
- unsigned short mId;
+ cBgW_BgId() { Ct(); }
+ void Ct() { m_id = 0x100; }
};
bool cBgW_CheckBGround(float a1);
diff --git a/include/SSystem/SComponent/c_xyz.h b/include/SSystem/SComponent/c_xyz.h
index a60742f190..0f28e22048 100644
--- a/include/SSystem/SComponent/c_xyz.h
+++ b/include/SSystem/SComponent/c_xyz.h
@@ -100,15 +100,22 @@ struct cXyz : Vec {
}
float getSquareMag() const { return PSVECSquareMag(this); }
+ f32 getSquareDistance(const Vec& other) const { return PSVECSquareDistance(this, &other); }
static float getNearZeroValue() { return 8e-11f; }
bool isNearZeroSquare() const { return (this->getSquareMag() < getNearZeroValue()); }
f32 abs2() const { return this->getSquareMag(); }
+ f32 abs2(const Vec& other) const { return this->getSquareDistance(other); }
f32 abs2XZ() const {
cXyz tmp(this->x, 0, this->z);
return tmp.abs2();
}
+ f32 abs2XZ(const Vec& other) const {
+ cXyz tmp(this->x, 0, this->z);
+ cXyz tmp2(other.x, 0, other.z);
+ return tmp.abs2(tmp2);
+ }
f32 getMagXZ() const { return cXyz(this->x, 0, this->z).getSquareMag(); }
};
diff --git a/include/d/bg/d_bg_pc.h b/include/d/bg/d_bg_pc.h
index 863737a92b..b1f91e96c2 100644
--- a/include/d/bg/d_bg_pc.h
+++ b/include/d/bg/d_bg_pc.h
@@ -3,4 +3,20 @@
#include "dolphin/types.h"
+struct sBgPc {
+ /* 0x00 */ u32 code0;
+ /* 0x04 */ u32 code1;
+ /* 0x08 */ u32 code2;
+ /* 0x0C */ u32 code3;
+ /* 0x10 */ u32 code4;
+}; // Size: 0x14
+
+class dBgPc {
+public:
+ void setCode(sBgPc&);
+
+private:
+ /* 0x0 */ sBgPc m_code;
+};
+
#endif /* D_BG_D_BG_PC_H */
diff --git a/include/d/bg/d_bg_plc.h b/include/d/bg/d_bg_plc.h
index 9710355ed6..ed0c55085f 100644
--- a/include/d/bg/d_bg_plc.h
+++ b/include/d/bg/d_bg_plc.h
@@ -1,6 +1,30 @@
#ifndef D_BG_D_BG_PLC_H
#define D_BG_D_BG_PLC_H
+#include "d/bg/d_bg_pc.h"
#include "dolphin/types.h"
+enum {
+ /* 0x14 */ ZELDA_CODE_SIZE = 0x14
+};
+
+struct PLC {
+ /* 0x0 */ u32 magic;
+ /* 0x4 */ u16 m_code_size;
+ /* 0x6 */ u16 m_num;
+ // ...
+};
+
+class dBgPlc {
+public:
+ /* 80074074 */ dBgPlc();
+ /* 80074080 */ ~dBgPlc();
+ /* 800740BC */ void setBase(void*);
+ /* 800740C4 */ void getCode(int, sBgPc**) const;
+ /* 800740DC */ void getGrpCode(int) const;
+
+private:
+ /* 0x00 */ void* m_base;
+};
+
#endif /* D_BG_D_BG_PLC_H */
diff --git a/include/d/bg/d_bg_s.h b/include/d/bg/d_bg_s.h
index 0b759c8198..0f8b51946b 100644
--- a/include/d/bg/d_bg_s.h
+++ b/include/d/bg/d_bg_s.h
@@ -8,64 +8,52 @@
#include "dolphin/types.h"
#include "f_op/f_op_actor.h"
-struct cBgW_BgId {
- /* 802681C8 */ void Release();
- /* 802681D4 */ void ChkUsed() const;
-};
-
class cBgS_ChkElm {
-private:
- /* 0x00 */ dBgW_Base* bgw_base_pointer;
- /* 0x04 */ u8 used;
- /* 0x05 */ u8 padding[3];
+public:
+ /* 0x00 */ dBgW_Base* m_bgw_base_ptr;
+ /* 0x04 */ bool m_used;
/* 0x08 */ u32 field_0x8;
- /* 0x0C */ void* actor_pointer;
+ /* 0x0C */ fopAc_ac_c* m_actor_ptr;
/* 0x10 vtable */
+
public:
- cBgS_ChkElm(void) { this->Init(); }
- virtual ~cBgS_ChkElm() {}
+ cBgS_ChkElm() { this->Init(); }
void Init();
- virtual void Regist2(dBgW_Base*, unsigned int, void*);
void Release();
-}; // Size = 0x14
+
+ virtual ~cBgS_ChkElm() {}
+ virtual void Regist2(dBgW_Base*, unsigned int, void*);
+
+ bool ChkUsed() const { return m_used; }
+}; // Size: 0x14
STATIC_ASSERT(sizeof(cBgS_ChkElm) == 0x14);
class cBgS {
-private:
- /* 0x0000 */ cBgS_ChkElm cbgs_elements[256];
+public:
+ /* 0x0000 */ cBgS_ChkElm m_chk_element[256];
/* 0x1400 vtable */
+
public:
cBgS() {}
- virtual ~cBgS() {}
- void Regist(dBgW_Base*, unsigned int, void*);
+ bool Regist(dBgW_Base*, unsigned int, void*);
void Release(dBgW_Base*);
- virtual void Ct();
- virtual void Dt();
- void LineCross(cBgS_LinChk*);
- void GroundCross(cBgS_GndChk*);
- void ConvDzb(void*);
- void GetActorPointer(int) const;
- void GetBgWBasePointer(cBgS_PolyInfo const&) const;
- void ChkPolySafe(cBgS_PolyInfo const&);
- void GetGrpRoomId(cBgS_PolyInfo const&) const;
- void GetTriPla(cBgS_PolyInfo const&, cM3dGPla*) const;
- void GetTriPnt(cBgS_PolyInfo const&, cXyz*, cXyz*, cXyz*) const;
+ bool LineCross(cBgS_LinChk*);
+ f32 GroundCross(cBgS_GndChk*);
+ static void ConvDzb(void*);
+ fopAc_ac_c* GetActorPointer(int) const;
+ dBgW_Base* GetBgWBasePointer(cBgS_PolyInfo const&) const;
+ bool ChkPolySafe(cBgS_PolyInfo const&);
+ s32 GetGrpRoomId(cBgS_PolyInfo const&) const;
+ bool GetTriPla(cBgS_PolyInfo const&, cM3dGPla*) const;
+ bool GetTriPnt(cBgS_PolyInfo const&, cXyz*, cXyz*, cXyz*) const;
void ShdwDraw(cBgS_ShdwDraw*);
- void GetGrpInf(cBgS_PolyInfo const&) const;
-}; // Size = 0x1404
+ u32 GetGrpInf(cBgS_PolyInfo const&) const;
-class dBgS_HIO {
- /* 0x00 */ u8 vtable[4];
- /* 0x04 */ u8 field_0x4[2];
- /* 0x06 */ u16 field_0x6;
- /* 0x08 */ u16 field_0x8;
- /* 0x0A */ u8 field_0xa[2];
- /* 0x0C */ cXyz field_0xc;
- /* 0x18 */ cXyz field_0x18;
- /* 0x24 */ cXyz field_0x24;
- /* 0x30 */ u8 field_0x30[4];
-};
+ virtual ~cBgS() {}
+ virtual void Ct();
+ virtual void Dt();
+}; // Size: 0x1404
class dBgS_Acch;
@@ -77,44 +65,45 @@ public:
void Dt();
void ClrMoveFlag();
void Move();
- void Regist(dBgW_Base*, fopAc_ac_c*);
- void ChkMoveBG(cBgS_PolyInfo const&);
- void ChkMoveBG_NoDABg(cBgS_PolyInfo const&);
- void GetExitId(cBgS_PolyInfo const&);
- void GetPolyColor(cBgS_PolyInfo const&);
- void GetHorseNoEntry(cBgS_PolyInfo const&);
- void GetSpecialCode(cBgS_PolyInfo const&);
- void GetMagnetCode(cBgS_PolyInfo const&);
- void GetMonkeyBarsCode(cBgS_PolyInfo const&);
- void GetUnderwaterRoofCode(cBgS_PolyInfo const&);
- void GetWallCode(cBgS_PolyInfo const&);
- void GetPolyAtt0(cBgS_PolyInfo const&);
- void GetPolyAtt1(cBgS_PolyInfo const&);
- void GetGroundCode(cBgS_PolyInfo const&);
- void GetCamMoveBG(cBgS_PolyInfo const&);
- void GetRoomCamId(cBgS_PolyInfo const&);
- void GetRoomPathId(cBgS_PolyInfo const&);
- void GetRoomPathPntNo(cBgS_PolyInfo const&);
- void GetGrpSoundId(cBgS_PolyInfo const&);
- void ChkGrpInf(cBgS_PolyInfo const&, u32);
- void GetRoomId(cBgS_PolyInfo const&);
- void GetPolyAttackThrough(cBgS_PolyInfo const&);
- void ChkPolyHSStick(cBgS_PolyInfo const&);
+ bool Regist(dBgW_Base*, fopAc_ac_c*);
+ bool ChkMoveBG(cBgS_PolyInfo const&);
+ bool ChkMoveBG_NoDABg(cBgS_PolyInfo const&);
+ s32 GetExitId(cBgS_PolyInfo const&);
+ s32 GetPolyColor(cBgS_PolyInfo const&);
+ bool GetHorseNoEntry(cBgS_PolyInfo const&);
+ bool GetSpecialCode(cBgS_PolyInfo const&);
+ bool GetMagnetCode(cBgS_PolyInfo const&);
+ bool GetMonkeyBarsCode(cBgS_PolyInfo const&);
+ bool GetUnderwaterRoofCode(cBgS_PolyInfo const&);
+ bool GetWallCode(cBgS_PolyInfo const&);
+ bool GetPolyAtt0(cBgS_PolyInfo const&);
+ bool GetPolyAtt1(cBgS_PolyInfo const&);
+ bool GetGroundCode(cBgS_PolyInfo const&);
+ s32 GetCamMoveBG(cBgS_PolyInfo const&);
+ s32 GetRoomCamId(cBgS_PolyInfo const&);
+ s32 GetRoomPathId(cBgS_PolyInfo const&);
+ s32 GetRoomPathPntNo(cBgS_PolyInfo const&);
+ s32 GetGrpSoundId(cBgS_PolyInfo const&);
+ u32 ChkGrpInf(cBgS_PolyInfo const&, u32);
+ s32 GetRoomId(cBgS_PolyInfo const&);
+ bool GetPolyAttackThrough(cBgS_PolyInfo const&);
+ bool ChkPolyHSStick(cBgS_PolyInfo const&);
void WallCorrect(dBgS_Acch*);
void WallCorrectSort(dBgS_Acch*);
- void RoofChk(dBgS_RoofChk*);
- void SplGrpChk(dBgS_SplGrpChk*);
+ f32 RoofChk(dBgS_RoofChk*);
+ bool SplGrpChk(dBgS_SplGrpChk*);
void SphChk(dBgS_SphChk*, void*);
void MoveBgCrrPos(cBgS_PolyInfo const&, bool, cXyz*, csXyz*, csXyz*, bool, bool);
void MoveBgTransPos(cBgS_PolyInfo const&, bool, cXyz*, csXyz*, csXyz*);
void MoveBgMatrixCrrPos(cBgS_PolyInfo const&, bool, cXyz*, csXyz*, csXyz*);
void RideCallBack(cBgS_PolyInfo const&, fopAc_ac_c*);
void ArrowStickCallBack(cBgS_PolyInfo const&, fopAc_ac_c*, cXyz&);
- void PushPullCallBack(cBgS_PolyInfo const&, fopAc_ac_c*, s16, dBgW_Base::PushPullLabel);
+ bool PushPullCallBack(cBgS_PolyInfo const&, fopAc_ac_c*, s16, dBgW_Base::PushPullLabel);
+
+ bool WaterChk(dBgS_SplGrpChk* chk) { return SplGrpChk(chk); }
+}; // Size: 0x1404
-private:
- // /* 0x0000 */ cBgS cbgs;
- // /* 0x1400 */ void* vtable;
-};
+bool dBgS_CheckBGroundPoly(cBgS_PolyInfo const&);
+bool dBgS_CheckBWallPoly(cBgS_PolyInfo const&);
#endif /* D_BG_D_BG_S_H */
diff --git a/include/d/bg/d_bg_s_acch.h b/include/d/bg/d_bg_s_acch.h
index b0e2facd96..a1d6f5dc10 100644
--- a/include/d/bg/d_bg_s_acch.h
+++ b/include/d/bg/d_bg_s_acch.h
@@ -14,33 +14,66 @@
#include "dolphin/types.h"
//#include "d/bg/d_bg_s.h"
-class dBgS_AcchCir {
+class dBgS_AcchCir : public cBgS_PolyInfo {
+private:
+ /* 0x10 */ u32 m_flags;
+ /* 0x14 */ cM3dGCir m_cir;
+ /* 0x28 */ f32 m_wall_rr;
+ /* 0x2C */ f32 field_0x2c;
+ /* 0x30 */ f32 m_wall_h;
+ /* 0x34 */ f32 m_wall_r;
+ /* 0x38 */ f32 m_wall_h_direct;
+ /* 0x3C */ s16 m_wall_angle_y;
+
public:
+ enum {
+ /* 0x2 */ WALL_HIT = 2,
+ /* 0x4 */ WALL_H_DIRECT = 4,
+ };
+
/* 80075EAC */ dBgS_AcchCir();
/* 80075F14 */ void ClrWallHit();
/* 80075F40 */ void SetWallR(f32);
/* 80075F48 */ void CalcWallRR();
/* 80075F58 */ void SetWall(f32, f32);
/* 80075F80 */ void SetWallHDirect(f32);
- /* 80077414 */ ~dBgS_AcchCir();
-private:
- /* 0x00 */ cBgS_PolyInfo mPolyInfo;
- /* 0x10 */ int mWallHit;
- /* 0x14 */ cM3dGCir m3DGCir;
- /* 0x28 */ float mWallRR;
- /* 0x2C */ float field_0x2c;
- /* 0x30 */ float mWallH;
- /* 0x34 */ float mWallR;
- /* 0x38 */ float mWallHDirect;
- /* 0x3C */ s16 mWallAngleY;
- /* 0x3E */ u8 padding[2];
+ /* 80077414 */ virtual ~dBgS_AcchCir();
+
+ f32 GetWallH() { return m_wall_h; }
+ f32 GetWallR() { return m_wall_r; }
+ void SetWallH(f32 h) { m_wall_h = h; }
+ void ClrWallHDirect() { m_flags &= ~WALL_H_DIRECT; }
+ bool ChkWallHit() { return m_flags & WALL_HIT; }
+
+ void SetCir(cXyz& pos) { m_cir.Set(pos.x, pos.z, pos.y + GetWallH(), m_wall_r); }
};
class dBgS;
-class dBgS_Acch {
+class dBgS_Acch : public cBgS_Chk, public dBgS_Chk {
public:
- /* 80075F94 */ ~dBgS_Acch();
+ enum {
+ /* 0x000002 */ GRND_NONE = (1 << 1),
+ /* 0x000004 */ WALL_NONE = (1 << 2),
+ /* 0x000008 */ ROOF_NONE = (1 << 3),
+ /* 0x000010 */ WALL_HIT = (1 << 4),
+ /* 0x000020 */ GROUND_HIT = (1 << 5),
+ /* 0x000040 */ GROUND_FIND = (1 << 6),
+ /* 0x000080 */ GROUND_LANDING = (1 << 7),
+ /* 0x000100 */ GROUND_AWAY = (1 << 8),
+ /* 0x000200 */ ROOF_HIT = (1 << 9),
+ /* 0x000800 */ WATER_HIT = (1 << 11),
+ /* 0x001000 */ WATER_IN = (1 << 12),
+ /* 0x002000 */ LINE_CHECK = (1 << 13),
+ /* 0x004000 */ LINE_CHECK_NONE = (1 << 14),
+ /* 0x008000 */ CLR_SPEED_Y = (1 << 15),
+ /* 0x010000 */ LINE_CHECK_HIT = (1 << 16),
+ /* 0x100000 */ MOVE_BG_ONLY = (1 << 20),
+ /* 0x200000 */ GND_THIN_CELLING_OFF = (1 << 21),
+ /* 0x400000 */ WALL_SORT = (1 << 22),
+ /* 0x800000 */ LINE_DOWN = (1 << 23),
+ };
+
/* 800760A0 */ dBgS_Acch();
/* 800761CC */ void Init();
/* 80076288 */ void Set(fopAc_ac_c*, int, dBgS_AcchCir*);
@@ -50,14 +83,14 @@ public:
/* 8007654C */ void GroundRoofProc(dBgS&);
/* 80076624 */ void LineCheck(dBgS&);
/* 80076AAC */ void CrrPos(dBgS&);
- /* 80076F84 */ void GetWallAllR();
+ /* 80076F84 */ f32 GetWallAllR();
/* 80076FC0 */ void SetWallCir();
/* 8007703C */ void CalcWallBmdCyl();
/* 80077114 */ void SetGroundUpY(f32);
- /* 80077128 */ void GetWallAllLowH();
- /* 80077178 */ void GetWallAllLowH_R();
- /* 800771E4 */ void GetSpeedY();
- /* 80077200 */ void GetWallAddY(Vec&);
+ /* 80077128 */ f32 GetWallAllLowH();
+ /* 80077178 */ f32 GetWallAllLowH_R();
+ /* 800771E4 */ f32 GetSpeedY();
+ /* 80077200 */ f32 GetWallAddY(Vec&);
/* 80077278 */ void SetNowActorInfo(int, void*, unsigned int);
/* 80077288 */ void SetWallPolyIndex(int, int);
/* 800772E8 */ void CalcMovePosWork();
@@ -66,56 +99,90 @@ public:
/* 800773A4 */ void ClrMoveBGOnly();
/* 800773C0 */ void SetGndThinCellingOff();
/* 800773D0 */ void ClrGndThinCellingOff();
- /* 800773E0 */ void ChkGndThinCellingOff();
+ /* 800773E0 */ bool ChkGndThinCellingOff();
/* 800773EC */ void OnWallSort();
- /* 800773FC */ void ChkWallSort();
- /* 80077408 */ void ChkLineDown();
- /* 800D00D0 */ void ChkRoofHit() const;
+ /* 800773FC */ bool ChkWallSort();
+ /* 80077408 */ bool ChkLineDown();
+ /* 800D00D0 */ bool ChkRoofHit() const;
/* 800D00DC */ void ClrGroundHit();
- /* 80141404 */ void ChkGroundHit() const;
+ /* 80141404 */ bool ChkGroundHit() const;
- float GetGroundH() const { return mGroundH; }
+ /* 80075F94 */ virtual ~dBgS_Acch();
-private:
- /* 0x000 */ cBgS_Chk field_0x000;
- /* 0x014 */ dBgS_Chk field_0x014;
- /* 0x02C */ int field_0x2c;
- /* 0x030 */ cXyz* mPos;
- /* 0x034 */ cXyz* mOldPos;
- /* 0x038 */ cXyz* mSpeed;
- /* 0x03C */ csXyz* mAngle;
- /* 0x040 */ csXyz* mShapeAngle;
- /* 0x044 */ cM3dGLin field_0x44;
- /* 0x060 */ cM3dGCyl mWallBmdCyl;
- /* 0x078 */ int field_0x78;
+ cXyz* GetPos() { return pm_pos; }
+ cXyz* GetOldPos() { return pm_old_pos; }
+ f32 GetGroundH() const { return m_ground_h; }
+ void SetLin() { m_lin.SetStartEnd(*pm_old_pos, *pm_pos); }
+ bool ChkGroundFind() { return m_flags & GROUND_FIND; }
+ bool ChkGroundHit() { return m_flags & GROUND_HIT; }
+ void ClrGroundLanding() { m_flags &= ~GROUND_LANDING; }
+ void ClrGroundAway() { m_flags &= ~GROUND_AWAY; }
+ void ClrWallHit() { m_flags &= ~WALL_HIT; }
+ void SetRoofNone() { m_flags |= ROOF_NONE; }
+ void SetRoofHit() { m_flags |= ROOF_HIT; }
+ bool ChkWallHit() { return m_flags & WALL_HIT; }
+ void OffLineCheckHit() { m_flags &= ~LINE_CHECK_HIT; }
+ bool ChkLineCheckNone() { return m_flags & LINE_CHECK_NONE; }
+ bool ChkLineCheck() { return m_flags & LINE_CHECK; }
+ void ClrRoofHit() { m_flags &= ~ROOF_HIT; }
+ void ClrWaterHit() { m_flags &= ~WATER_HIT; }
+ void SetWaterHit() { m_flags |= WATER_HIT; }
+ void ClrWaterIn() { m_flags &= ~WATER_IN; }
+ void SetWaterIn() { m_flags |= WATER_IN; }
+ void ClrGroundFind() { m_flags &= ~GROUND_FIND; }
+ u32 MaskRoofHit() { return m_flags & ROOF_HIT; }
+ bool ChkRoofHit() { return MaskRoofHit(); }
+ bool ChkClrSpeedY() { return m_flags & CLR_SPEED_Y; }
+ void SetGroundFind() { m_flags |= GROUND_FIND; }
+ void SetGroundHit() { m_flags |= GROUND_HIT; }
+ void SetGroundLanding() { m_flags |= GROUND_LANDING; }
+ void SetGroundAway() { m_flags |= GROUND_AWAY; }
+
+ // inline dupe
+ void i_ClrGroundHit() { m_flags &= ~GROUND_HIT; }
+
+public:
+ /* 0x02C */ u32 m_flags;
+ /* 0x030 */ cXyz* pm_pos;
+ /* 0x034 */ cXyz* pm_old_pos;
+ /* 0x038 */ cXyz* pm_speed;
+ /* 0x03C */ csXyz* pm_angle;
+ /* 0x040 */ csXyz* pm_shape_angle;
+ /* 0x044 */ cM3dGLin m_lin;
+ /* 0x060 */ cM3dGCyl m_wall_cyl;
+ /* 0x078 */ int m_bg_index;
/* 0x07C */ void* field_0x7c;
/* 0x080 */ u32 field_0x80;
- /* 0x084 */ fopAc_ac_c* mMyAc;
+ /* 0x084 */ fopAc_ac_c* m_my_ac;
/* 0x088 */ int m_tbl_size;
/* 0x08C */ dBgS_AcchCir* field_0x8c;
- /* 0x090 */ float field_0x90;
- /* 0x094 */ float field_0x94;
- /* 0x098 */ float mGroundH;
- /* 0x09C */ float field_0x9c;
+ /* 0x090 */ f32 field_0x90;
+ /* 0x094 */ f32 field_0x94;
+ /* 0x098 */ f32 m_ground_h;
+ /* 0x09C */ f32 field_0x9c;
/* 0x0A0 */ cM3dGPla field_0xa0;
- /* 0x0B4 */ u8 field_0xb4[4];
- /* 0x0B8 */ float field_0xb8;
- /* 0x0BC */ float field_0xbc;
- /* 0x0C0 */ u8 field_0xc0[4];
- /* 0x0C4 */ float mRoofHeight;
- /* 0x0C8 */ float mRoofCrrHeight;
- /* 0x0CC */ float field_0xcc;
- /* 0x0D0 */ float mWaterCheckOffset;
+ /* 0x0B4 */ u8 field_0xb4;
+ /* 0x0B8 */ f32 field_0xb8;
+ /* 0x0BC */ f32 field_0xbc;
+ /* 0x0C0 */ u8 field_0xc0;
+ /* 0x0C4 */ f32 m_roof_height;
+ /* 0x0C8 */ f32 m_roof_crr_height;
+ /* 0x0CC */ f32 field_0xcc;
+ /* 0x0D0 */ f32 m_wtr_chk_offset;
/* 0x0D4 */ int field_0xd4;
- /* 0x0D8 */ float field_0xd8;
- /* 0x0DC */ dBgS_GndChk mGndChk;
- /* 0x130 */ dBgS_RoofChk mRoofChk;
- /* 0x180 */ dBgS_WtrChk mWtrChk;
- /* 0x1D4 */ u8 mWtrChkMode;
+ /* 0x0D8 */ f32 field_0xd8;
+ /* 0x0DC */ dBgS_GndChk m_gnd;
+ /* 0x130 */ dBgS_RoofChk m_roof;
+ /* 0x180 */ dBgS_WtrChk m_wtr;
+ /* 0x1D4 */ u8 m_wtr_mode;
};
class dBgS_LinkAcch : public dBgS_Acch {
- /* 80140F30 */ ~dBgS_LinkAcch();
+ /* 80140F30 */ virtual ~dBgS_LinkAcch();
+};
+
+class dBgS_ObjAcch : public dBgS_Acch {
+ /* 80BB336C */ virtual ~dBgS_ObjAcch();
};
#endif /* D_BG_D_BG_S_ACCH_H */
diff --git a/include/d/bg/d_bg_s_chk.h b/include/d/bg/d_bg_s_chk.h
index 549b8c2eed..fb0a238abb 100644
--- a/include/d/bg/d_bg_s_chk.h
+++ b/include/d/bg/d_bg_s_chk.h
@@ -5,16 +5,13 @@
#include "d/bg/d_bg_s_poly_pass_chk.h"
#include "dolphin/types.h"
-class dBgS_Chk {
+class dBgS_Chk : public dBgS_PolyPassChk, public dBgS_GrpPassChk {
public:
/* 8007749C */ dBgS_Chk();
- /* 800774E8 */ ~dBgS_Chk();
- /* 80077560 */ void GetPolyPassChkInfo();
- /* 80077564 */ void GetGrpPassChkInfo();
+ /* 80077560 */ cBgS_PolyPassChk* GetPolyPassChkInfo();
+ /* 80077564 */ cBgS_GrpPassChk* GetGrpPassChkInfo();
-private:
- /* 0x000 */ dBgS_PolyPassChk mPolyPassChkInfo;
- /* 0x010 */ dBgS_GrpPassChk mGrpPassChkInfo;
-}; // Size = 0x18
+ /* 800774E8 */ virtual ~dBgS_Chk();
+}; // Size: 0x18
#endif /* D_BG_D_BG_S_CHK_H */
diff --git a/include/d/bg/d_bg_s_gnd_chk.h b/include/d/bg/d_bg_s_gnd_chk.h
index bdd5831102..5087082ca8 100644
--- a/include/d/bg/d_bg_s_gnd_chk.h
+++ b/include/d/bg/d_bg_s_gnd_chk.h
@@ -5,21 +5,55 @@
#include "d/bg/d_bg_s_chk.h"
#include "dolphin/types.h"
-class dBgS_GndChk : public cBgS_GndChk {
+class dBgS_GndChk : public cBgS_GndChk, public dBgS_Chk {
public:
/* 8007757C */ dBgS_GndChk();
- virtual void temp(); // temp to build OK
/* 800775F0 */ virtual ~dBgS_GndChk();
+}; // Size: 0x54
-private:
- /* 0x3C */ dBgS_Chk mChk;
-}; // Size = 0x54
-
-class dBgS_LinkGndChk : dBgS_GndChk {
- virtual void temp(); // temp to build OK
+class dBgS_LinkGndChk : public dBgS_GndChk {
+public:
/* 80140EB8 */ virtual ~dBgS_LinkGndChk();
};
-class dBgS_ObjGndChk : dBgS_GndChk {};
+class dBgS_ObjGndChk : public dBgS_GndChk {
+public:
+ dBgS_ObjGndChk() { SetObj(); }
+
+ /* 8001E020 */ virtual ~dBgS_ObjGndChk();
+};
+
+class dBgS_ObjGndChk_Wtr : public dBgS_ObjGndChk {
+public:
+ /* 80077678 */ dBgS_ObjGndChk_Wtr();
+
+ /* 80077710 */ virtual ~dBgS_ObjGndChk_Wtr();
+};
+
+class dBgS_ObjGndChk_Spl : public dBgS_ObjGndChk {
+public:
+ /* 800777B0 */ dBgS_ObjGndChk_Spl();
+
+ /* 80077848 */ virtual ~dBgS_ObjGndChk_Spl();
+};
+
+class dBgS_ObjGndChk_All : public dBgS_ObjGndChk {
+public:
+ /* 800778E8 */ virtual ~dBgS_ObjGndChk_All();
+};
+
+class dBgS_CamGndChk : public dBgS_GndChk {
+public:
+ dBgS_CamGndChk() { SetCam(); }
+
+ /* 80077988 */ virtual ~dBgS_CamGndChk();
+};
+
+class dBgS_CamGndChk_Wtr : public dBgS_CamGndChk {
+public:
+ /* 80077A00 */ dBgS_CamGndChk_Wtr();
+
+ /* 80077A98 */ virtual ~dBgS_CamGndChk_Wtr();
+};
#endif /* D_BG_D_BG_S_GND_CHK_H */
diff --git a/include/d/bg/d_bg_s_grp_pass_chk.h b/include/d/bg/d_bg_s_grp_pass_chk.h
index eb5e06d579..5d426af4cc 100644
--- a/include/d/bg/d_bg_s_grp_pass_chk.h
+++ b/include/d/bg/d_bg_s_grp_pass_chk.h
@@ -1,22 +1,27 @@
#ifndef D_BG_D_BG_S_GRP_PASS_CHK_H
#define D_BG_D_BG_S_GRP_PASS_CHK_H
+#include "SSystem/SComponent/c_bg_s_chk.h"
#include "dolphin/types.h"
-class cBgS_GrpPassChk {
-public:
- ~cBgS_GrpPassChk();
-
- void* vtable;
-};
-
class dBgS_GrpPassChk : public cBgS_GrpPassChk {
public:
+ enum {
+ /* 0x1 */ NORMAL_GRP = 1,
+ /* 0x2 */ WATER_GRP
+ };
+
/* 80077BA0 */ dBgS_GrpPassChk();
- /* 80077BC4 */ ~dBgS_GrpPassChk();
+
+ /* 80077BC4 */ virtual ~dBgS_GrpPassChk();
+
+ void OnWaterGrp() { mGrp |= WATER_GRP; }
+ void OnSpl() { mGrp |= WATER_GRP; }
+ void OnNormalGrp() { mGrp |= NORMAL_GRP; }
+ void OffNormalGrp() { mGrp &= ~NORMAL_GRP; }
private:
- u32 mGrp;
+ /* 0x4 */ u32 mGrp;
};
#endif /* D_BG_D_BG_S_GRP_PASS_CHK_H */
diff --git a/include/d/bg/d_bg_s_lin_chk.h b/include/d/bg/d_bg_s_lin_chk.h
index 33029a5acb..b154496772 100644
--- a/include/d/bg/d_bg_s_lin_chk.h
+++ b/include/d/bg/d_bg_s_lin_chk.h
@@ -6,46 +6,78 @@
#include "dolphin/types.h"
#include "f_op/f_op_actor.h"
-class dBgS_LinChk {
+class dBgS_LinChk : public cBgS_LinChk, public dBgS_Chk {
public:
/* 80077C68 */ dBgS_LinChk();
- /* 80077CDC */ ~dBgS_LinChk();
/* 80077D64 */ void Set(cXyz const*, cXyz const*, fopAc_ac_c const*);
-private:
- /* 0x00 */ cBgS_LinChk mLinChk;
- /* 0x58 */ dBgS_Chk mChk;
+ /* 80077CDC */ virtual ~dBgS_LinChk();
+
+ /* 0x00 cBgS_LinChk */;
+ /* 0x58 dBgS_Chk */;
};
-class dBgS_LinkLinChk : dBgS_LinChk {
+class dBgS_LinkLinChk : public dBgS_LinChk {
public:
/* 80078030 */ dBgS_LinkLinChk();
- /* 8007808C */ ~dBgS_LinkLinChk();
+
+ /* 8007808C */ virtual ~dBgS_LinkLinChk();
};
-class dBgS_RopeLinChk : dBgS_LinChk {
+class dBgS_RopeLinChk : public dBgS_LinChk {
+public:
/* 8007838C */ dBgS_RopeLinChk();
- /* 800783E8 */ ~dBgS_RopeLinChk();
+
+ /* 800783E8 */ virtual ~dBgS_RopeLinChk();
};
-class dBgS_BoomerangLinChk : dBgS_LinChk {
+class dBgS_BoomerangLinChk : public dBgS_LinChk {
+public:
/* 800782B8 */ dBgS_BoomerangLinChk();
- /* 80078314 */ ~dBgS_BoomerangLinChk();
+
+ /* 80078314 */ virtual ~dBgS_BoomerangLinChk();
};
-class dBgS_ArrowLinChk : dBgS_LinChk {
+class dBgS_ArrowLinChk : public dBgS_LinChk {
+public:
/* 800781D8 */ dBgS_ArrowLinChk();
- /* 80078240 */ ~dBgS_ArrowLinChk();
+
+ /* 80078240 */ virtual ~dBgS_ArrowLinChk();
};
-class dBgS_ObjLinChk : dBgS_LinChk {
+class dBgS_ObjLinChk : public dBgS_LinChk {
+public:
/* 80077F5C */ dBgS_ObjLinChk();
- /* 80077FB8 */ ~dBgS_ObjLinChk();
+
+ /* 80077FB8 */ virtual ~dBgS_ObjLinChk();
};
-class dBgS_BombLinChk : dBgS_LinChk {
+class dBgS_BombLinChk : public dBgS_LinChk {
+public:
/* 80078104 */ dBgS_BombLinChk();
- /* 80078160 */ ~dBgS_BombLinChk();
+
+ /* 80078160 */ virtual ~dBgS_BombLinChk();
+};
+
+class dBgS_HorseLinChk : public dBgS_LinChk {
+public:
+ /* 80078460 */ dBgS_HorseLinChk();
+
+ /* 800784BC */ virtual ~dBgS_HorseLinChk();
+};
+
+class dBgS_CamLinChk : public dBgS_LinChk {
+public:
+ /* 80077DA4 */ dBgS_CamLinChk();
+
+ /* 80077E00 */ virtual ~dBgS_CamLinChk();
+};
+
+class dBgS_CamLinChk_NorWtr : public dBgS_CamLinChk {
+public:
+ /* 80077E78 */ dBgS_CamLinChk_NorWtr();
+
+ /* 80077EE4 */ virtual ~dBgS_CamLinChk_NorWtr();
};
#endif /* D_BG_D_BG_S_LIN_CHK_H */
diff --git a/include/d/bg/d_bg_s_movebg_actor.h b/include/d/bg/d_bg_s_movebg_actor.h
index 3f588b15f3..2eacdec49e 100644
--- a/include/d/bg/d_bg_s_movebg_actor.h
+++ b/include/d/bg/d_bg_s_movebg_actor.h
@@ -1,6 +1,38 @@
#ifndef D_BG_D_BG_S_MOVEBG_ACTOR_H
#define D_BG_D_BG_S_MOVEBG_ACTOR_H
+#include "SSystem/SComponent/c_bg_s_poly_info.h"
+#include "d/bg/d_bg_w.h"
#include "dolphin/types.h"
+class dBgW;
+typedef void (*MoveBGActor_SetFunc)(dBgW*, void*, cBgS_PolyInfo const&, bool, cXyz*, csXyz*,
+ csXyz*);
+
+class dBgS_MoveBgActor : public fopAc_ac_c {
+private:
+ /* 0x568 */ dBgW* field_0x568;
+ /* 0x56C */ Mtx field_0x56c;
+
+public:
+ /* 80078624 */ dBgS_MoveBgActor();
+ /* 800786C8 */ int MoveBGCreateHeap();
+ /* 800787BC */ int MoveBGCreate(char const*, int, MoveBGActor_SetFunc, u32, Mtx*);
+ /* 800788DC */ bool MoveBGDelete();
+ /* 80078950 */ bool MoveBGExecute();
+
+ /* 80078688 */ virtual s32 CreateHeap();
+ /* 80078690 */ virtual bool Create();
+ /* 80078698 */ virtual bool Execute(f32 (**)[3][4]);
+ /* 800786A0 */ virtual bool Draw();
+ /* 800786A8 */ virtual bool Delete();
+ /* 800786B0 */ virtual bool IsDelete();
+ /* 800786B8 */ virtual bool ToFore();
+ /* 800786C0 */ virtual bool ToBack();
+
+ static const char* m_name;
+ static int m_dzb_id;
+ static MoveBGActor_SetFunc m_set_func;
+};
+
#endif /* D_BG_D_BG_S_MOVEBG_ACTOR_H */
diff --git a/include/d/bg/d_bg_s_poly_pass_chk.h b/include/d/bg/d_bg_s_poly_pass_chk.h
index 0fb5100aee..c5aff507f4 100644
--- a/include/d/bg/d_bg_s_poly_pass_chk.h
+++ b/include/d/bg/d_bg_s_poly_pass_chk.h
@@ -11,7 +11,6 @@ public:
class dBgS_PolyPassChk : public cBgS_PolyPassChk {
public:
dBgS_PolyPassChk();
- virtual void temp(); // temp to build OK, remove later
virtual ~dBgS_PolyPassChk();
bool ChkArrow() { return mArrow; }
diff --git a/include/d/bg/d_bg_s_roof_chk.h b/include/d/bg/d_bg_s_roof_chk.h
index 2fbdc6da07..78a4e64f33 100644
--- a/include/d/bg/d_bg_s_roof_chk.h
+++ b/include/d/bg/d_bg_s_roof_chk.h
@@ -7,25 +7,26 @@
#include "d/bg/d_bg_s_chk.h"
#include "dolphin/types.h"
-class dBgS_RoofChk {
+class dBgS_RoofChk : public cBgS_PolyInfo, public cBgS_Chk, public dBgS_Chk {
public:
/* 80078FF4 */ dBgS_RoofChk();
- /* 80079090 */ ~dBgS_RoofChk();
/* 80079124 */ void Init();
/* 800B146C */ void SetPos(cXyz const&);
+ /* 80079090 */ virtual ~dBgS_RoofChk();
+
+ void SetNowY(f32 y) { mNowY = y; }
+ void i_SetPos(cXyz const& pos) { m_pos = pos; }
+
private:
- /* 0x00 */ cBgS_PolyInfo field_0x00;
- /* 0x10 */ cBgS_Chk field_0x10;
- /* 0x24 */ dBgS_Chk field_0x24;
/* 0x3C */ cXyz m_pos;
/* 0x48 */ int field_0x48;
- /* 0x4C */ float mNowY;
-}; // Size = 0x50
+ /* 0x4C */ f32 mNowY;
+}; // Size: 0x50
class dBgS_LinkRoofChk : dBgS_RoofChk {
public:
- /* 80140E40 */ ~dBgS_LinkRoofChk();
+ /* 80140E40 */ virtual ~dBgS_LinkRoofChk();
};
#endif /* D_BG_D_BG_S_ROOF_CHK_H */
diff --git a/include/d/bg/d_bg_s_sph_chk.h b/include/d/bg/d_bg_s_sph_chk.h
index 07ede4cc1e..6a5225ace1 100644
--- a/include/d/bg/d_bg_s_sph_chk.h
+++ b/include/d/bg/d_bg_s_sph_chk.h
@@ -1,6 +1,25 @@
#ifndef D_BG_D_BG_S_SPH_CHK_H
#define D_BG_D_BG_S_SPH_CHK_H
+#include "SSystem/SComponent/c_bg_s_poly_info.h"
+#include "SSystem/SComponent/c_m3d_g_pla.h"
+#include "SSystem/SComponent/c_m3d_g_sph.h"
+#include "d/bg/d_bg_s_chk.h"
#include "dolphin/types.h"
+struct cBgD_Vtx_t;
+
+class dBgS_SphChk;
+typedef void* (*SphChk_Callback)(dBgS_SphChk*, cBgD_Vtx_t*, int, int, int, cM3dGPla*, void*);
+
+class dBgS_SphChk : public cM3dGSph, public cBgS_PolyInfo, public cBgS_Chk, public dBgS_Chk {
+public:
+ /* 80078A14 */ dBgS_SphChk();
+
+ /* 80078AC0 */ virtual ~dBgS_SphChk();
+
+private:
+ /* 0x50 */ SphChk_Callback mCallback;
+};
+
#endif /* D_BG_D_BG_S_SPH_CHK_H */
diff --git a/include/d/bg/d_bg_s_spl_grp_chk.h b/include/d/bg/d_bg_s_spl_grp_chk.h
index 4fb3645b49..76d4f0212e 100644
--- a/include/d/bg/d_bg_s_spl_grp_chk.h
+++ b/include/d/bg/d_bg_s_spl_grp_chk.h
@@ -7,21 +7,33 @@
#include "d/bg/d_bg_s_chk.h"
#include "dolphin/types.h"
-class dBgS_SplGrpChk {
+class dBgS_SplGrpChk : public cBgS_PolyInfo, public cBgS_Chk, public dBgS_Chk {
public:
+ enum {
+ /* 0x1 */ FIND = 1,
+ /* 0x2 */ IN = 2,
+ /* 0x4 */ MOVE_BG_ONLY = 4
+ };
+
/* 80078B90 */ void Set(cXyz&, f32);
/* 80078BB0 */ dBgS_SplGrpChk();
- /* 80078C78 */ ~dBgS_SplGrpChk();
/* 80078D0C */ void Init();
+ /* 80078C78 */ virtual ~dBgS_SplGrpChk();
+
+ void OffFind() { m_flags &= ~FIND; }
+ void OffIn() { m_flags &= ~IN; }
+ void OffMoveBGOnly() { m_flags &= ~MOVE_BG_ONLY; }
+ void OnMoveBGOnly() { m_flags |= MOVE_BG_ONLY; }
+ void SetHeight(f32 height) { m_height = height; }
+ f32 GetHeight() { return m_height; }
+ cXyz& GetPosP() { return m_ground; }
+
private:
- /* 0x00 */ cBgS_PolyInfo field_0x00;
- /* 0x10 */ cBgS_Chk field_0x10;
- /* 0x24 */ dBgS_Chk field_0x24;
/* 0x3C */ cXyz m_ground;
- /* 0x48 */ float mRoof;
- /* 0x4C */ float mHeight;
- /* 0x50 */ int field_0x50;
-}; // Size = 0x54
+ /* 0x48 */ f32 m_roof;
+ /* 0x4C */ f32 m_height;
+ /* 0x50 */ u32 m_flags;
+}; // Size: 0x54
#endif /* D_BG_D_BG_S_SPL_GRP_CHK_H */
diff --git a/include/d/bg/d_bg_s_wtr_chk.h b/include/d/bg/d_bg_s_wtr_chk.h
index 79a6806bab..2ea0f5e51c 100644
--- a/include/d/bg/d_bg_s_wtr_chk.h
+++ b/include/d/bg/d_bg_s_wtr_chk.h
@@ -4,12 +4,11 @@
#include "d/bg/d_bg_s_spl_grp_chk.h"
#include "dolphin/types.h"
-class dBgS_WtrChk {
+class dBgS_WtrChk : public dBgS_SplGrpChk {
public:
/* 80079164 */ dBgS_WtrChk();
-private:
- /* 0x00 */ dBgS_SplGrpChk mSplGrp;
-}; // Size = 0x54
+ /* 8001DF30 */ virtual ~dBgS_WtrChk();
+}; // Size: 0x54
#endif /* D_BG_D_BG_S_WTR_CHK_H */
diff --git a/include/d/bg/d_bg_w.h b/include/d/bg/d_bg_w.h
index 8580ef0f94..121895ba9e 100644
--- a/include/d/bg/d_bg_w.h
+++ b/include/d/bg/d_bg_w.h
@@ -1,6 +1,7 @@
#ifndef D_BG_D_BG_W_H
#define D_BG_D_BG_W_H
+#include "JSystem/J3DGraphBase/J3DVertex.h"
#include "SSystem/SComponent/c_bg_s_gnd_chk.h"
#include "SSystem/SComponent/c_bg_s_lin_chk.h"
#include "SSystem/SComponent/c_bg_s_poly_info.h"
@@ -8,81 +9,74 @@
#include "d/bg/d_bg_s_acch.h"
#include "d/bg/d_bg_s_grp_pass_chk.h"
#include "d/bg/d_bg_s_poly_pass_chk.h"
+#include "d/bg/d_bg_w_base.h"
#include "dolphin/types.h"
#include "f_op/f_op_actor.h"
struct dBgS_CaptPoly {};
-struct dBgS_SphChk {};
-
-struct cBgW_TriElm {
- /* 800796F8 */ ~cBgW_TriElm();
+class cBgW_TriElm : public cM3dGPla {
+public:
/* 80079754 */ cBgW_TriElm();
+
+ /* 800796F8 */ virtual ~cBgW_TriElm();
};
-struct cBgW_RwgElm {
+class cBgW_RwgElm {
+private:
+ /* 0x0 */ u8 field_0x0[4];
+
+public:
/* 800791C4 */ cBgW_RwgElm();
- /* 800791D4 */ ~cBgW_RwgElm();
+
+ /* 800791D4 */ virtual ~cBgW_RwgElm();
};
-struct cBgW_NodeTree {
+class cBgW_NodeTree : public cM3dGAab {
+public:
/* 8007921C */ cBgW_NodeTree();
- /* 80079238 */ ~cBgW_NodeTree();
+
+ /* 80079238 */ virtual ~cBgW_NodeTree();
};
-struct cBgW_GrpElm {
- /* 8007A184 */ ~cBgW_GrpElm();
+class cBgW_GrpElm : public cM3dGAab {
+public:
/* 8007A1E4 */ cBgW_GrpElm();
-};
-struct cBgS_ShdwDraw {};
+ /* 8007A184 */ virtual ~cBgW_GrpElm();
+};
struct cBgD_t {};
-struct cBgW {
+class cBgW : public dBgW_Base {
+public:
/* 80079294 */ cBgW();
- /* 8007933C */ ~cBgW();
/* 800793A4 */ void FreeArea();
/* 800793C4 */ void GlobalVtx();
/* 80079484 */ void SetVtx();
- /* 80079564 */ void CalcPlane();
/* 80079668 */ void SetTri();
/* 80079770 */ void BlckConnect(u16*, int*, int);
- /* 800797BC */ void ClassifyPlane();
/* 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();
- /* 80079EEC */ void ChkMemoryError();
- /* 80079F38 */ void Set(cBgD_t*, u32, f32 (*)[3][4]);
+ /* 80079F38 */ bool Set(cBgD_t*, u32, f32 (*)[3][4]);
/* 8007A200 */ void RwgLineCheck(u16, cBgS_LinChk*);
/* 8007A3A0 */ void LineCheckRp(cBgS_LinChk*, int);
/* 8007A52C */ void LineCheckGrpRp(cBgS_LinChk*, int, int);
- /* 8007A658 */ void LineCheck(cBgS_LinChk*);
/* 8007A680 */ void RwgGroundCheckCommon(f32, u16, cBgS_GndChk*);
/* 8007A774 */ void RwgGroundCheckGnd(u16, cBgS_GndChk*);
/* 8007A824 */ void RwgGroundCheckWall(u16, cBgS_GndChk*);
/* 8007A8F4 */ void GroundCrossRp(cBgS_GndChk*, int);
/* 8007AA50 */ void GroundCrossGrpRp(cBgS_GndChk*, int, int);
- /* 8007AB9C */ void GroundCross(cBgS_GndChk*);
/* 8007ABC4 */ void CopyOldMtx();
/* 8007AC10 */ void Move();
/* 8007ADF0 */ void RwgShdwDraw(int, cBgS_ShdwDraw*);
/* 8007AEA4 */ void ShdwDrawRp(cBgS_ShdwDraw*, int);
/* 8007AFC0 */ void ShdwDrawGrpRp(cBgS_ShdwDraw*, int);
- /* 8007B084 */ void ShdwDraw(cBgS_ShdwDraw*);
- /* 8007B0A8 */ bool ChkPolyThrough(int, cBgS_PolyPassChk*);
- /* 8007B0B0 */ void ChkShdwDrawThrough(int, cBgS_PolyPassChk*);
- /* 8007B0DC */ bool ChkGrpThrough(int, cBgS_GrpPassChk*, int);
- /* 8007B0E4 */ void GetGrpRoomIndex(cBgS_PolyInfo const&) const;
- /* 8007B164 */ void GetBnd() const;
/* 8007B17C */ void GetTrans(cXyz*) const;
- /* 8007B1B4 */ void GetTriPnt(cBgS_PolyInfo const&, cXyz*, cXyz*, cXyz*) const;
- /* 8007B240 */ void GetTopUnder(f32*, f32*) const;
- /* 8007B270 */ void GetTriPla(cBgS_PolyInfo const&) const;
- /* 8007B2B0 */ void GetGrpInf(cBgS_PolyInfo const&) const;
/* 8007B2F4 */ void GetPolyInfId(int) const;
/* 8007B30C */ void GetPolyInf0(int, u32, u32) const;
/* 8007B360 */ void GetMaskPolyInf0_NoShift(int, u32) const;
@@ -90,104 +84,177 @@ struct cBgW {
/* 8007B78C */ void GetMaskPolyInf1_NoShift(int, u32) const;
/* 8007B824 */ void GetPolyInf2(int, u32, u32) const;
/* 8007B930 */ void GetTriGrp(int) const;
- /* 8007B948 */ void ChkNotReady() const;
- /* 8007B958 */ void ChkLock() const;
- /* 8007B964 */ void ChkMoveBg() const;
-};
-class dBgW_Base {
-public:
- enum PushPullLabel {};
+ /* 8007933C */ virtual ~cBgW();
+ /* 80079EEC */ virtual void ChkMemoryError();
+ /* 8007B948 */ virtual void ChkNotReady() const;
+ /* 8007B958 */ virtual bool ChkLock() const;
+ /* 8007B964 */ virtual bool ChkMoveBg() const;
+ virtual u32 ChkMoveFlag() const = 0;
+ /* 8007B270 */ virtual void GetTriPla(cBgS_PolyInfo const&) const;
+ /* 8007B1B4 */ virtual bool GetTriPnt(cBgS_PolyInfo const&, cXyz*, cXyz*, cXyz*) const;
+ /* 8007B164 */ virtual void 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 void GroundCross(cBgS_GndChk*);
+ /* 8007B084 */ virtual void ShdwDraw(cBgS_ShdwDraw*);
+ virtual void CaptPoly(dBgS_CaptPoly&) = 0;
+ virtual void WallCorrect(dBgS_Acch*) = 0;
+ virtual void WallCorrectSort(dBgS_Acch*) = 0;
+ virtual void RoofChk(dBgS_RoofChk*) = 0;
+ virtual void SplGrpChk(dBgS_SplGrpChk*) = 0;
+ virtual void 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 bool GetSpecialCode(cBgS_PolyInfo const&) = 0;
+ virtual void GetSpecialCode(int) = 0;
+ virtual bool GetMagnetCode(cBgS_PolyInfo const&) = 0;
+ virtual void GetPolyObjThrough(int) = 0;
+ virtual void GetPolyCamThrough(int) = 0;
+ virtual void GetPolyLinkThrough(int) = 0;
+ virtual void GetPolyArrowThrough(int) = 0;
+ virtual bool GetPolyHSStick(int) = 0;
+ virtual void GetPolyBoomerangThrough(int) = 0;
+ virtual void GetPolyRopeThrough(int) = 0;
+ virtual void GetPolyBombThrough(int) = 0;
+ virtual void GetShdwThrough(int) = 0;
+ virtual bool GetUnderwaterRoofCode(int) = 0;
+ virtual bool GetMonkeyBarsCode(cBgS_PolyInfo const&) = 0;
+ virtual bool GetWallCode(cBgS_PolyInfo const&) = 0;
+ virtual bool GetPolyAtt0(cBgS_PolyInfo const&) = 0;
+ virtual bool GetPolyAtt1(cBgS_PolyInfo const&) = 0;
+ virtual bool GetGroundCode(cBgS_PolyInfo const&) = 0;
+ virtual void 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 void GetPolyGrpRoomInfId(cBgS_PolyInfo const&) = 0;
+ virtual s32 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 void ChkShdwDrawThrough(int, cBgS_PolyPassChk*);
+ /* 8007B0DC */ virtual bool ChkGrpThrough(int, cBgS_GrpPassChk*, int);
- /* 8007E5A8 */ dBgW_Base();
- /* 8007E640 */ ~dBgW_Base();
- /* 8007E6D8 */ void CallRideCallBack(fopAc_ac_c*, fopAc_ac_c*);
- /* 8007E6DC */ void CallArrowStickCallBack(fopAc_ac_c*, fopAc_ac_c*, cXyz&);
- /* 80074AB4 */ void SetOldShapeAngleY(s16);
- /* 8007E6E0 */ void CalcDiffShapeAngleY(s16);
+ u32 GetOldInvMtx(Mtx m) { return PSMTXInverse(m_inv_mtx, m); }
+ MtxP GetBaseMtxP() { return pm_base_mtx; }
-private:
- u16 field_0x0;
- u8 field_0x2[2];
- void* field_0x4;
- u8 field_0x8;
- u8 field_0x9;
- u8 field_0xa;
- u8 field_0xb;
- s16 field_0xc;
- s16 field_0xe;
+public:
+ /* 0x18 */ MtxP pm_base_mtx;
+ /* 0x1C */ Mtx m_inv_mtx;
+ /* 0x4C */ Mtx field_0x4c;
+ /* 0x7C */ cXyz field_0x7c;
+ /* 0x88 */ u8 field_0x88;
+ /* 0x89 */ u8 field_0x89;
+ /* 0x8A */ u8 field_0x8a[6];
+ /* 0x90 */ u8 field_0x90;
+ /* 0x91 */ u8 field_0x91;
+ /* 0x92 */ u16 field_0x92;
+ /* 0x94 */ cBgW_TriElm* pm_tri;
+ /* 0x98 */ cBgW_RwgElm* pm_rwg;
+ /* 0x9C */ VertexPosition* pm_vtx_tbl; // type not confirmed
+ /* 0xA0 */ void* pm_bgd;
+ /* 0xA4 */ void* field_0xa4;
+ /* 0xA8 */ cBgW_GrpElm* pm_grp;
+ /* 0xAC */ cBgW_NodeTree* pm_node_tree;
};
-class dBgW {
+class dBgW;
+typedef void (*dBgW_RideCallback)(dBgW*, fopAc_ac_c*, fopAc_ac_c*);
+typedef void (*dBgW_ArrowStickCallback)(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:
- /* 8007B3AC */ void GetExitId(cBgS_PolyInfo const&);
- /* 8007B3D8 */ void GetPolyColor(cBgS_PolyInfo const&);
- /* 8007B404 */ void GetHorseNoEntry(cBgS_PolyInfo const&);
- /* 8007B430 */ void GetSpecialCode(cBgS_PolyInfo const&);
- /* 8007B460 */ void GetSpecialCode(int);
- /* 8007B488 */ void GetMagnetCode(cBgS_PolyInfo const&);
- /* 8007B4B4 */ void GetMonkeyBarsCode(cBgS_PolyInfo const&);
- /* 8007B4E0 */ void GetPolyObjThrough(int);
- /* 8007B504 */ void GetPolyCamThrough(int);
- /* 8007B52C */ void GetPolyLinkThrough(int);
- /* 8007B550 */ void GetPolyArrowThrough(int);
- /* 8007B574 */ void GetPolyHSStick(int);
- /* 8007B598 */ void GetPolyBoomerangThrough(int);
- /* 8007B5BC */ void GetPolyRopeThrough(int);
- /* 8007B5E0 */ void GetPolyBombThrough(int);
- /* 8007B604 */ void GetShdwThrough(int);
- /* 8007B630 */ void GetUnderwaterRoofCode(int);
- /* 8007B6AC */ void GetLinkNo(cBgS_PolyInfo const&);
- /* 8007B6D8 */ void GetWallCode(cBgS_PolyInfo const&);
- /* 8007B704 */ void GetPolyAtt0(cBgS_PolyInfo const&);
- /* 8007B734 */ void GetPolyAtt1(cBgS_PolyInfo const&);
- /* 8007B760 */ void GetGroundCode(cBgS_PolyInfo const&);
- /* 8007B7DC */ void GetIronBallThrough(int);
- /* 8007B800 */ void GetAttackThrough(int);
- /* 8007B87C */ void GetCamMoveBG(cBgS_PolyInfo const&);
- /* 8007B8A8 */ void GetRoomCamId(cBgS_PolyInfo const&);
- /* 8007B8D8 */ void GetRoomPathId(cBgS_PolyInfo const&);
- /* 8007B904 */ void GetRoomPathPntNo(cBgS_PolyInfo const&);
/* 8007B970 */ dBgW();
/* 8007B9C0 */ void Move();
/* 8007B9EC */ void positionWallCorrect(dBgS_Acch*, f32, cM3dGPla&, cXyz*, f32);
/* 8007BA40 */ void RwgWallCorrect(dBgS_Acch*, u16);
/* 8007C234 */ void WallCorrectRp(dBgS_Acch*, int);
/* 8007C360 */ void WallCorrectGrpRp(dBgS_Acch*, int, int);
- /* 8007C484 */ void WallCorrect(dBgS_Acch*);
/* 8007C4AC */ void RwgWallCorrectSort(dBgS_Acch*, u16);
/* 8007C714 */ void WallCorrectRpSort(dBgS_Acch*, int);
/* 8007C808 */ void WallCorrectGrpRpSort(dBgS_Acch*, int, int);
- /* 8007C910 */ void WallCorrectSort(dBgS_Acch*);
/* 8007D0DC */ void RwgRoofChk(u16, dBgS_RoofChk*);
/* 8007D208 */ void RoofChkRp(dBgS_RoofChk*, int);
/* 8007D330 */ void RoofChkGrpRp(dBgS_RoofChk*, int, int);
- /* 8007D470 */ void RoofChk(dBgS_RoofChk*);
/* 8007D498 */ void RwgSplGrpChk(u16, dBgS_SplGrpChk*);
/* 8007D5C4 */ void SplGrpChkRp(dBgS_SplGrpChk*, int);
/* 8007D6F0 */ void SplGrpChkGrpRp(dBgS_SplGrpChk*, int, int);
- /* 8007D830 */ void SplGrpChk(dBgS_SplGrpChk*);
/* 8007D858 */ void RwgCaptPoly(int, dBgS_CaptPoly&);
/* 8007D8E8 */ void CaptPolyRp(dBgS_CaptPoly&, int);
/* 8007DA04 */ void CaptPolyGrpRp(dBgS_CaptPoly&, int, int);
- /* 8007DAF8 */ void CaptPoly(dBgS_CaptPoly&);
/* 8007DB20 */ void RwgSphChk(u16, dBgS_SphChk*, void*);
/* 8007DC70 */ void SphChkRp(dBgS_SphChk*, void*, int);
/* 8007DDE0 */ void SphChkGrpRp(dBgS_SphChk*, void*, int, int);
- /* 8007DF00 */ void SphChk(dBgS_SphChk*, void*);
- /* 8007DF28 */ void GetPolyGrpRoomInfId(cBgS_PolyInfo const&);
- /* 8007DF58 */ void GetGrpSoundId(cBgS_PolyInfo const&);
- /* 8007DF88 */ void CrrPos(cBgS_PolyInfo const&, void*, bool, cXyz*, csXyz*, csXyz*);
- /* 8007DFC4 */ void TransPos(cBgS_PolyInfo const&, void*, bool, cXyz*, csXyz*, csXyz*);
- /* 8007E000 */ void MatrixCrrPos(cBgS_PolyInfo const&, void*, bool, cXyz*, csXyz*, csXyz*);
- /* 8007E02C */ void ChkPolyThrough(int, cBgS_PolyPassChk*);
- /* 8007E360 */ void ChkShdwDrawThrough(int, cBgS_PolyPassChk*);
- /* 8007E3D8 */ void ChkGrpThrough(int, cBgS_GrpPassChk*, int);
- /* 8007E444 */ void CallRideCallBack(fopAc_ac_c*, fopAc_ac_c*);
- /* 8007E474 */ void CallArrowStickCallBack(fopAc_ac_c*, fopAc_ac_c*, cXyz&);
- /* 8007E4A4 */ void OffMoveFlag();
- /* 8007E4B4 */ void ChkMoveFlag() const;
- /* 8007E548 */ ~dBgW();
+
+ /* 8007E548 */ virtual ~dBgW();
+ /* 8007E4B4 */ virtual u32 ChkMoveFlag() const;
+ /* 8007E4A4 */ virtual void OffMoveFlag();
+ /* 8007DAF8 */ virtual void CaptPoly(dBgS_CaptPoly&);
+ /* 8007C484 */ virtual void WallCorrect(dBgS_Acch*);
+ /* 8007C910 */ virtual void WallCorrectSort(dBgS_Acch*);
+ /* 8007D470 */ virtual void RoofChk(dBgS_RoofChk*);
+ /* 8007D830 */ virtual void SplGrpChk(dBgS_SplGrpChk*);
+ /* 8007DF00 */ virtual void SphChk(dBgS_SphChk*, virtual void*);
+ /* 8007B3AC */ virtual s32 GetExitId(cBgS_PolyInfo const&);
+ /* 8007B3D8 */ virtual s32 GetPolyColor(cBgS_PolyInfo const&);
+ /* 8007B404 */ virtual bool GetHorseNoEntry(cBgS_PolyInfo const&);
+ /* 8007B430 */ virtual bool GetSpecialCode(cBgS_PolyInfo const&);
+ /* 8007B460 */ virtual void GetSpecialCode(int);
+ /* 8007B488 */ virtual bool GetMagnetCode(cBgS_PolyInfo const&);
+ /* 8007B4E0 */ virtual void GetPolyObjThrough(int);
+ /* 8007B504 */ virtual void GetPolyCamThrough(int);
+ /* 8007B52C */ virtual void GetPolyLinkThrough(int);
+ /* 8007B550 */ virtual void GetPolyArrowThrough(int);
+ /* 8007B574 */ virtual bool GetPolyHSStick(int);
+ /* 8007B598 */ virtual void GetPolyBoomerangThrough(int);
+ /* 8007B5BC */ virtual void GetPolyRopeThrough(int);
+ /* 8007B5E0 */ virtual void GetPolyBombThrough(int);
+ /* 8007B604 */ virtual void GetShdwThrough(int);
+ /* 8007B630 */ virtual bool GetUnderwaterRoofCode(int);
+ /* 8007B4B4 */ virtual bool GetMonkeyBarsCode(cBgS_PolyInfo const&);
+ /* 8007B6AC */ virtual void GetLinkNo(cBgS_PolyInfo const&);
+ /* 8007B6D8 */ virtual bool GetWallCode(cBgS_PolyInfo const&);
+ /* 8007B704 */ virtual bool GetPolyAtt0(cBgS_PolyInfo const&);
+ /* 8007B734 */ virtual bool GetPolyAtt1(cBgS_PolyInfo const&);
+ /* 8007B760 */ virtual bool GetGroundCode(cBgS_PolyInfo const&);
+ /* 8007B7DC */ virtual void 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 void GetPolyGrpRoomInfId(cBgS_PolyInfo const&);
+ /* 8007DF58 */ virtual s32 GetGrpSoundId(cBgS_PolyInfo const&);
+ /* 8007DF88 */ virtual void CrrPos(cBgS_PolyInfo const&, virtual void*, bool, cXyz*, csXyz*,
+ csXyz*);
+ /* 8007DFC4 */ virtual void TransPos(cBgS_PolyInfo const&, virtual void*, bool, cXyz*, csXyz*,
+ csXyz*);
+ /* 8007E000 */ virtual void MatrixCrrPos(cBgS_PolyInfo const&, virtual 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 void ChkPolyThrough(int, cBgS_PolyPassChk*);
+ /* 8007E360 */ virtual void ChkShdwDrawThrough(int, cBgS_PolyPassChk*);
+ /* 8007E3D8 */ virtual void ChkGrpThrough(int, cBgS_GrpPassChk*, int);
+
+ void SetCrrFunc(dBgW_CrrFunc func) { m_crr_func = func; }
+
+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 */
diff --git a/include/d/bg/d_bg_w_base.h b/include/d/bg/d_bg_w_base.h
index c361a4a17e..2b67b17c5a 100644
--- a/include/d/bg/d_bg_w_base.h
+++ b/include/d/bg/d_bg_w_base.h
@@ -1,6 +1,103 @@
#ifndef D_BG_D_BG_W_BASE_H
#define D_BG_D_BG_W_BASE_H
+#include "SSystem/SComponent/c_bg_s_gnd_chk.h"
+#include "SSystem/SComponent/c_bg_s_lin_chk.h"
+#include "SSystem/SComponent/c_bg_s_poly_info.h"
+#include "SSystem/SComponent/c_bg_s_shdw_draw.h"
+#include "SSystem/SComponent/c_bg_w.h"
+#include "d/bg/d_bg_s_acch.h"
+#include "d/bg/d_bg_s_sph_chk.h"
#include "dolphin/types.h"
+#include "f_op/f_op_actor.h"
+
+struct dBgS_CaptPoly;
+
+class dBgW_Base : public cBgW_BgId {
+public:
+ enum PushPullLabel {};
+
+ typedef s32 (*PushPull_CallBack)(cBgS_PolyInfo const&, fopAc_ac_c*, s16,
+ dBgW_Base::PushPullLabel);
+
+ /* 8007E5A8 */ dBgW_Base();
+ /* 8007E69C */ void ClrDBgWBase();
+ /* 8007E6E0 */ void CalcDiffShapeAngleY(s16);
+
+ /* 8007E640 */ virtual ~dBgW_Base();
+ /* 8007E6D0 */ virtual bool ChkMemoryError();
+ virtual void ChkNotReady() const = 0;
+ virtual bool ChkLock() const = 0;
+ virtual bool ChkMoveBg() const = 0;
+ virtual u32 ChkMoveFlag() const = 0;
+ virtual void GetTriPla(cBgS_PolyInfo const&) const = 0;
+ virtual bool GetTriPnt(cBgS_PolyInfo const&, cXyz*, cXyz*, cXyz*) const = 0;
+ virtual void GetBnd() const = 0;
+ virtual u32 GetGrpInf(cBgS_PolyInfo const&) const = 0;
+ virtual void OffMoveFlag() = 0;
+ virtual void GetTopUnder(f32*, f32*) const = 0;
+ /* 80074AB4 */ virtual void SetOldShapeAngleY(s16);
+ virtual bool LineCheck(cBgS_LinChk*) = 0;
+ virtual void GroundCross(cBgS_GndChk*) = 0;
+ virtual void ShdwDraw(cBgS_ShdwDraw*) = 0;
+ virtual void CaptPoly(dBgS_CaptPoly&) = 0;
+ virtual void WallCorrect(dBgS_Acch*) = 0;
+ virtual void WallCorrectSort(dBgS_Acch*) = 0;
+ virtual void RoofChk(dBgS_RoofChk*) = 0;
+ virtual void SplGrpChk(dBgS_SplGrpChk*) = 0;
+ virtual void SphChk(dBgS_SphChk*, void*) = 0;
+ virtual s32 GetGrpRoomIndex(cBgS_PolyInfo const&) const = 0;
+ virtual s32 GetExitId(cBgS_PolyInfo const&) = 0;
+ virtual s32 GetPolyColor(cBgS_PolyInfo const&) = 0;
+ virtual bool GetHorseNoEntry(cBgS_PolyInfo const&) = 0;
+ virtual bool GetSpecialCode(cBgS_PolyInfo const&) = 0;
+ virtual void GetSpecialCode(int) = 0;
+ virtual bool GetMagnetCode(cBgS_PolyInfo const&) = 0;
+ virtual void GetPolyObjThrough(int) = 0;
+ virtual void GetPolyCamThrough(int) = 0;
+ virtual void GetPolyLinkThrough(int) = 0;
+ virtual void GetPolyArrowThrough(int) = 0;
+ virtual bool GetPolyHSStick(int) = 0;
+ virtual void GetPolyBoomerangThrough(int) = 0;
+ virtual void GetPolyRopeThrough(int) = 0;
+ virtual void GetPolyBombThrough(int) = 0;
+ virtual void GetShdwThrough(int) = 0;
+ virtual bool GetUnderwaterRoofCode(int) = 0;
+ virtual bool GetMonkeyBarsCode(cBgS_PolyInfo const&) = 0;
+ virtual void GetLinkNo(cBgS_PolyInfo const&) = 0;
+ virtual bool GetWallCode(cBgS_PolyInfo const&) = 0;
+ virtual bool GetPolyAtt0(cBgS_PolyInfo const&) = 0;
+ virtual bool GetPolyAtt1(cBgS_PolyInfo const&) = 0;
+ virtual bool GetGroundCode(cBgS_PolyInfo const&) = 0;
+ virtual void 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 void GetPolyGrpRoomInfId(cBgS_PolyInfo const&) = 0;
+ virtual s32 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;
+ /* 8007E6D8 */ virtual void CallRideCallBack(fopAc_ac_c*, fopAc_ac_c*);
+ /* 8007E6DC */ virtual void CallArrowStickCallBack(fopAc_ac_c*, fopAc_ac_c*, cXyz&);
+
+ PushPull_CallBack GetPushPullCallback() const { return m_pushPull_Callback; }
+ s16 GetDiffShapeAngleY() { return m_diff_ShapeAngleY; }
+ u8 GetRoomId() { return m_roomId; }
+ bool chkStickWall() { return field_0xb & 1; }
+ bool chkStickRoof() { return field_0xb & 2; }
+
+private:
+ /* 0x08 */ u8 m_priority;
+ /* 0x09 */ u8 m_roomId;
+ /* 0x0A */ u8 field_0xa;
+ /* 0x0B */ u8 field_0xb;
+ /* 0x0C */ s16 m_old_ShapeAngleY;
+ /* 0x0E */ s16 m_diff_ShapeAngleY;
+ /* 0x10 */ PushPull_CallBack m_pushPull_Callback;
+ /* 0x14 */ bool m_pushPull_Ok;
+}; // Size: 0x18
#endif /* D_BG_D_BG_W_BASE_H */
diff --git a/include/d/bg/d_bg_w_kcol.h b/include/d/bg/d_bg_w_kcol.h
index 9ec288792b..f46686e157 100644
--- a/include/d/bg/d_bg_w_kcol.h
+++ b/include/d/bg/d_bg_w_kcol.h
@@ -1,6 +1,89 @@
#ifndef D_BG_D_BG_W_KCOL_H
#define D_BG_D_BG_W_KCOL_H
+#include "d/bg/d_bg_plc.h"
+#include "d/bg/d_bg_w_base.h"
#include "dolphin/types.h"
+struct dBgS_CaptPoly;
+
+struct KC_PrismData {};
+
+class dBgWKCol : public dBgW_Base {
+public:
+ /* 8007E6F4 */ dBgWKCol();
+ /* 8007E7D0 */ void initKCollision(void*);
+ /* 8007E804 */ void create(void*, void*);
+ /* 8007E850 */ void getTriNrm(KC_PrismData*, Vec**) const;
+ /* 8007E8C0 */ void GetTriPla(int) const;
+ /* 8007E9A4 */ void GetTriPnt(int, Vec*, Vec*, Vec*) const;
+ /* 8007E9D4 */ void GetTriPnt(KC_PrismData const*, Vec*, Vec*, Vec*) const;
+ /* 8007EB70 */ void getPolyCode(int, dBgPc*) const;
+ /* 8007EBC4 */ void chkPolyThrough(dBgPc*, cBgS_PolyPassChk*, cBgS_GrpPassChk*, cXyz&) const;
+ /* 8007FF00 */ void ChkShdwDrawThrough(dBgPc*);
+
+ /* 8007E74C */ virtual ~dBgWKCol();
+ /* 8007E86C */ virtual void ChkNotReady() const;
+ /* 8007E87C */ virtual bool ChkLock() const;
+ /* 8007E884 */ virtual bool ChkMoveBg() const;
+ /* 8007E88C */ virtual bool ChkMoveFlag() const;
+ /* 8007E894 */ virtual void GetTriPla(cBgS_PolyInfo const&) const;
+ /* 8007E980 */ virtual void GetTriPnt(cBgS_PolyInfo const&, cXyz*, cXyz*, cXyz*) const;
+ /* 8007EB28 */ virtual void GetBnd() const;
+ /* 8007EB30 */ virtual void GetGrpInf(cBgS_PolyInfo const&) const;
+ /* 8007EB6C */ virtual void OffMoveFlag();
+ /* 800829AC */ virtual void GetTopUnder(f32*, f32*) const;
+ /* 8007EE34 */ virtual void LineCheck(cBgS_LinChk*);
+ /* 8007F628 */ virtual void GroundCross(cBgS_GndChk*);
+ /* 8007F9A4 */ virtual void ShdwDraw(cBgS_ShdwDraw*);
+ /* 8007FF1C */ virtual void CaptPoly(dBgS_CaptPoly&);
+ /* 800811A0 */ virtual void WallCorrect(dBgS_Acch*);
+ /* 80080330 */ virtual void WallCorrectSort(dBgS_Acch*);
+ /* 80081E18 */ virtual void RoofChk(dBgS_RoofChk*);
+ /* 80082184 */ virtual void SplGrpChk(dBgS_SplGrpChk*);
+ /* 800824EC */ virtual void SphChk(dBgS_SphChk*, virtual void*);
+ /* 800829F0 */ virtual void GetGrpRoomIndex(cBgS_PolyInfo const&) const;
+ /* 80082A20 */ virtual void GetExitId(cBgS_PolyInfo const&);
+ /* 80082A50 */ virtual void GetPolyColor(cBgS_PolyInfo const&);
+ /* 80082A80 */ virtual void GetHorseNoEntry(cBgS_PolyInfo const&);
+ /* 80082AB0 */ virtual void GetSpecialCode(cBgS_PolyInfo const&);
+ /* 80082AE0 */ virtual void GetSpecialCode(int);
+ /* 80082B0C */ virtual void GetMagnetCode(cBgS_PolyInfo const&);
+ /* 80082B6C */ virtual void GetPolyObjThrough(int);
+ /* 80082B98 */ virtual void GetPolyCamThrough(int);
+ /* 80082BC4 */ virtual void GetPolyLinkThrough(int);
+ /* 80082BF0 */ virtual void GetPolyArrowThrough(int);
+ /* 80082C1C */ virtual void GetPolyHSStick(int);
+ /* 80082C48 */ virtual void GetPolyBoomerangThrough(int);
+ /* 80082C74 */ virtual void GetPolyRopeThrough(int);
+ /* 80082CA0 */ virtual void GetPolyBombThrough(int);
+ /* 80082CF8 */ virtual void GetShdwThrough(int);
+ /* 80082CCC */ virtual void GetUnderwaterRoofCode(int);
+ /* 80082B3C */ virtual void GetMonkeyBarsCode(cBgS_PolyInfo const&);
+ /* 80082D24 */ virtual void GetLinkNo(cBgS_PolyInfo const&);
+ /* 80082D54 */ virtual void GetWallCode(cBgS_PolyInfo const&);
+ /* 80082D84 */ virtual void GetPolyAtt0(cBgS_PolyInfo const&);
+ /* 80082DB4 */ virtual void GetPolyAtt1(cBgS_PolyInfo const&);
+ /* 80082DE4 */ virtual void GetGroundCode(cBgS_PolyInfo const&);
+ /* 80082E14 */ virtual void GetIronBallThrough(int);
+ /* 80082E40 */ virtual void GetAttackThrough(int);
+ /* 80082E6C */ virtual void GetCamMoveBG(cBgS_PolyInfo const&);
+ /* 80082E9C */ virtual void GetRoomCamId(cBgS_PolyInfo const&);
+ /* 80082ECC */ virtual void GetRoomPathId(cBgS_PolyInfo const&);
+ /* 80082EFC */ virtual void GetRoomPathPntNo(cBgS_PolyInfo const&);
+ /* 80082F2C */ virtual void GetPolyGrpRoomInfId(cBgS_PolyInfo const&);
+ /* 80082F5C */ virtual void GetGrpSoundId(cBgS_PolyInfo const&);
+ /* 80082F8C */ virtual void CrrPos(cBgS_PolyInfo const&, virtual void*, bool, cXyz*, csXyz*,
+ csXyz*);
+ /* 80082F90 */ virtual void TransPos(cBgS_PolyInfo const&, virtual void*, bool, cXyz*, csXyz*,
+ csXyz*);
+ /* 80082F94 */ virtual void MatrixCrrPos(cBgS_PolyInfo const&, virtual void*, bool, cXyz*,
+ csXyz*, csXyz*);
+
+private:
+ /* 0x18 */ void* m_pkc_head;
+ /* 0x1C */ dBgPlc m_code;
+ /* 0x20 */ cM3dGAab m_bnd;
+};
+
#endif /* D_BG_D_BG_W_KCOL_H */
diff --git a/include/d/com/d_com_inf_game.h b/include/d/com/d_com_inf_game.h
index 15bf9bea67..058e907b88 100644
--- a/include/d/com/d_com_inf_game.h
+++ b/include/d/com/d_com_inf_game.h
@@ -995,6 +995,10 @@ inline void* dComIfG_getObjectRes(const char* arcName, const char* resName) {
return g_dComIfG_gameInfo.mResControl.getObjectRes(arcName, resName);
}
+inline void* dComIfG_getObjectRes(const char* arcName, int param_1) {
+ return g_dComIfG_gameInfo.mResControl.getObjectRes(arcName, param_1);
+}
+
inline daPy_py_c* dComIfGp_getLinkPlayer() {
return (daPy_py_c*)g_dComIfG_gameInfo.play.getPlayerPtr(LINK_PTR);
}
@@ -1011,4 +1015,8 @@ inline J2DGrafContext* dComIfGp_getCurrentGrafPort() {
return g_dComIfG_gameInfo.play.getCurrentGrafPort();
}
+inline dBgS& dComIfG_Bgsp() {
+ return g_dComIfG_gameInfo.play.mDBgS;
+}
+
#endif /* D_COM_D_COM_INF_GAME_H */
diff --git a/include/d/d_resorce.h b/include/d/d_resorce.h
index b19e2993c8..8c038fcdfb 100644
--- a/include/d/d_resorce.h
+++ b/include/d/d_resorce.h
@@ -75,6 +75,10 @@ public:
return getRes(arcName, resName, &mObjectInfo[0], ARRAY_SIZE(mObjectInfo));
}
+ void* getObjectRes(const char* arcName, s32 param_1) {
+ return getRes(arcName, param_1, &mObjectInfo[0], ARRAY_SIZE(mObjectInfo));
+ }
+
int syncObjectRes(const char* name) {
return syncRes(name, &mObjectInfo[0], ARRAY_SIZE(mObjectInfo));
}
diff --git a/include/f_op/f_op_actor_mng.h b/include/f_op/f_op_actor_mng.h
index efc46b8ca4..ac29bdf894 100644
--- a/include/f_op/f_op_actor_mng.h
+++ b/include/f_op/f_op_actor_mng.h
@@ -112,6 +112,26 @@ inline fopAc_ac_c* fopAcM_SearchByID(unsigned int id) {
return (fopAc_ac_c*)fopAcIt_Judge((fopAcIt_JudgeFunc)fpcSch_JudgeByID, &id);
}
+inline cXyz& fopAcM_GetPosition_p(fopAc_ac_c* pActor) {
+ return pActor->mCurrent.mPosition;
+}
+
+inline cXyz& fopAcM_GetOldPosition_p(fopAc_ac_c* pActor) {
+ return pActor->mNext.mPosition;
+}
+
+inline cXyz& fopAcM_GetSpeed_p(fopAc_ac_c* pActor) {
+ return pActor->mSpeed;
+}
+
+inline csXyz& fopAcM_GetAngle_p(fopAc_ac_c* pActor) {
+ return pActor->mCurrent.mAngle;
+}
+
+inline csXyz& fopAcM_GetShapeAngle_p(fopAc_ac_c* pActor) {
+ return pActor->mCollisionRot;
+}
+
void* fopAcM_FastCreate(s16 pProcTypeID, FastCreateReqFunc param_2, void* param_3, void* pData);
void fopAcM_setStageLayer(void*);
int fopAcM_setRoomLayer(void*, int);
@@ -143,9 +163,6 @@ void fopAcM_setCullSizeBox(fopAc_ac_c*, f32, f32, f32, f32, f32, f32);
void fopAcM_setCullSizeSphere(fopAc_ac_c*, f32, f32, f32, f32);
void fopAcM_setCullSizeBox2(fopAc_ac_c*, J3DModelData*);
bool fopAcM_addAngleY(fopAc_ac_c*, s16, s16);
-inline csXyz& fopAcM_GetAngle_p(fopAc_ac_c* pActor) {
- return pActor->mCurrent.mAngle;
-}
void fopAcM_calcSpeed(fopAc_ac_c*);
void fopAcM_posMove(fopAc_ac_c*, const cXyz*);
void fopAcM_posMoveF(fopAc_ac_c*, const cXyz*);
diff --git a/include/m_Do/m_Do_mtx.h b/include/m_Do/m_Do_mtx.h
index c091ec9af6..7eaa3aa2e2 100644
--- a/include/m_Do/m_Do_mtx.h
+++ b/include/m_Do/m_Do_mtx.h
@@ -14,6 +14,7 @@ void mDoMtx_ZXYrotM(Mtx, s16, s16, s16);
void mDoMtx_ZrotS(Mtx, s16);
void mDoMtx_YrotS(Mtx, s16);
void mDoMtx_XrotS(Mtx, s16);
+void mDoMtx_YrotM(Mtx, s16);
class mDoMtx_stack_c {
public:
@@ -32,13 +33,14 @@ public:
/* 8000CF7C */ static void quatM(Quaternion const*);
/* 8000D070 */ ~mDoMtx_stack_c(); // inline
- Mtx* get() { return &now; }
+ static Mtx* get() { return &now; }
static void transS(f32 x, f32 y, f32 z) { PSMTXTrans(now, x, y, z); }
static void scaleS(f32 x, f32 y, f32 z) { PSMTXScale(now, x, y, z); }
static void XYZrotS(s16 x, s16 y, s16 z) { mDoMtx_XYZrotS(now, x, y, z); }
static void XYZrotM(s16 x, s16 y, s16 z) { mDoMtx_XYZrotM(now, x, y, z); }
static void ZXYrotS(s16 x, s16 y, s16 z) { mDoMtx_ZXYrotS(now, x, y, z); }
static void ZXYrotM(s16 x, s16 y, s16 z) { mDoMtx_ZXYrotM(now, x, y, z); }
+ static void YrotM(s16 y) { mDoMtx_YrotM(now, y); }
static Mtx now;
static Mtx buffer[16];