mirror of
https://github.com/zeldaret/tp
synced 2026-07-08 14:36:36 -04:00
d_bg_s (#159)
* wip * d_bg_s * most of d_bg_s * small cleanup * clang * fixes
This commit is contained in:
@@ -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 */
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -4,14 +4,19 @@
|
||||
#include "dolphin/types.h"
|
||||
|
||||
class cBgW_BgId {
|
||||
public:
|
||||
void Regist(int a1);
|
||||
void Release();
|
||||
|
||||
unsigned int ChkUsed() const;
|
||||
|
||||
private:
|
||||
unsigned short mId;
|
||||
/* 0x0 */ u16 m_id;
|
||||
/* 0x4 vtable */
|
||||
|
||||
public:
|
||||
/* 802681C8 */ void Release();
|
||||
/* 802681D4 */ bool ChkUsed() const;
|
||||
/* 802681C0 */ void Regist(int);
|
||||
|
||||
/* 8007E5F8 */ virtual ~cBgW_BgId();
|
||||
|
||||
cBgW_BgId() { Ct(); }
|
||||
void Ct() { m_id = 0x100; }
|
||||
};
|
||||
|
||||
bool cBgW_CheckBGround(float a1);
|
||||
|
||||
@@ -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(); }
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user