summaryrefslogtreecommitdiff
path: root/include/SSystem/SComponent
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/SSystem/SComponent
parent901b222eb877be81bb9043d65b6616bd21152a12 (diff)
d_bg_s (#159)
* wip * d_bg_s * most of d_bg_s * small cleanup * clang * fixes
Diffstat (limited to 'include/SSystem/SComponent')
-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
6 files changed, 62 insertions, 26 deletions
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(); }
};