Merge remote-tracking branch 'origin/main' into pjb-audio

This commit is contained in:
PJB3005
2026-03-19 20:16:57 +01:00
205 changed files with 5689 additions and 2051 deletions
+1 -1
+1
View File
@@ -117,6 +117,7 @@ set(DOLZEL_FILES
src/d/d_bg_plc.cpp
src/d/d_bg_s.cpp
src/d/d_bg_s_acch.cpp
src/d/d_bg_s_capt_poly.cpp
src/d/d_bg_s_chk.cpp
src/d/d_bg_s_gnd_chk.cpp
src/d/d_bg_s_grp_pass_chk.cpp
+4
View File
@@ -10,7 +10,11 @@
#define S2RAD_CONSTANT (M_PI / 0x8000)
#define RAD2S_CONSTANT (0x8000 / M_PI)
#if TARGET_PC
#define DEG2S(x) cAngle_degreeToS16((x))
#else
#define DEG2S(x) ((s16)((x) * DEG2S_CONSTANT))
#endif
#define S2DEG(x) ((x) * S2DEG_CONSTANT)
#define S2RAD(x) ((x) * S2RAD_CONSTANT)
#define RAD2S(x) ((x) * RAD2S_CONSTANT)
+6 -2
View File
@@ -36,7 +36,7 @@ public:
void SetHit() { mStts |= STTS_HIT; }
u32 ChkHit() const { return mStts & STTS_HIT; }
void SetCross(const cXyz& pos) { mLin.SetEnd(pos); }
cXyz* GetCrossP() { return &mLin.GetEndP(); }
cXyz* GetCrossP() { return mLin.GetEndP(); }
cM3dGLin* GetLinP() { return &mLin; }
bool ChkBackFlag() const { return mBackFlag; }
void OnBackFlag() { mBackFlag = true; }
@@ -45,13 +45,17 @@ public:
bool GetPreWallChk() const { return mPreWallChk; }
bool GetPreGroundChk() const { return mPreGroundChk; }
bool GetPreRoofChk() const { return mPreRoofChk; }
cXyz* GetStartP() { return &mLin.GetStartP(); }
cXyz* GetStartP() { return mLin.GetStartP(); }
void ClrSttsRoofOff() { mStts &= ~STTS_ROOF_OFF; }
void SetSttsRoofOff() { mStts |= STTS_ROOF_OFF; }
void ClrSttsWallOff() { mStts &= ~STTS_WALL_OFF; }
void SetSttsWallOff() { mStts |= STTS_WALL_OFF; }
void ClrSttsGroundOff() { mStts &= ~STTS_GROUND_OFF; }
void SetSttsGroundOff() { mStts |= STTS_GROUND_OFF; }
void ClearCheckIndex() { ClearPi(); }
bool ChkSttsWallOff() const { return (mStts & STTS_WALL_OFF); }
bool ChkSttsGroundOff() const { return (mStts & STTS_GROUND_OFF); }
bool ChkSttsRoofOff() const { return (mStts & STTS_ROOF_OFF); }
};
#endif /* C_BG_S_LIN_CHK_H */
@@ -20,6 +20,9 @@ public:
/* 0x14 */ cM3dGAab mM3dGAab;
/* 0x30 */ cBgS_ShdwDraw_Callback mCallbackFun;
#if DEBUG
/* 0x34 */ int field_0x34;
#endif
};
#endif /* C_BG_S_SHDW_DRAW_H */
+1 -1
View File
@@ -18,7 +18,7 @@ public:
cBgW_BgId() { Ct(); }
void Ct() { m_id = 0x100; }
u16 GetId() const { return m_id; }
int GetId() const { return m_id; }
};
bool cBgW_CheckBGround(float a1);
+15 -12
View File
@@ -188,6 +188,7 @@ public:
cXyz* GetCCMoveP() { return &m_cc_move; }
fpc_ProcID GetApid() const { return m_apid; }
u8 GetDmg() const { return m_dmg; }
void ClrCo() { ClrCcMove(); }
}; // Size = 0x1C
STATIC_ASSERT(0x1C == sizeof(cCcD_Stts));
@@ -213,7 +214,7 @@ public:
void ct();
void SetSPrm(u32 sprm) { mSPrm = sprm; }
s32 getSPrm() const { return mSPrm; }
void setRPrm(s32 rprm) { mRPrm = rprm; }
void SetRPrm(u32 rprm) { mRPrm = rprm; }
s32 getRPrm() const { return mRPrm; }
cCcD_Obj* GetHitObj() { return mHitObj; }
const cCcD_Obj* GetHitObj() const { return mHitObj; }
@@ -222,6 +223,9 @@ public:
void OnSPrmBit(u32 flag) { mSPrm |= flag; }
void OffSPrmBit(u32 flag) { mSPrm &= ~flag; }
u32 ChkSPrm(u32 prm) const { return MskSPrm(prm) != 0; }
void SetHitObj(cCcD_Obj* pobj) { mHitObj = pobj; }
void ClrRPrm(u32 prm) { mRPrm &= ~prm; }
void ClrObj() { mHitObj = NULL; }
void Set(cCcD_SrcObjCommonBase const& src) { mSPrm = src.mSPrm; }
};
@@ -240,7 +244,7 @@ public:
void ClrHit();
int GetType() const { return mType; }
u32 GetGrp() const { return MskSPrm(0x1E); }
bool ChkSet() const { return MskSPrm(1); }
BOOL ChkSet() const { return MskSPrm(1); }
u8 GetAtp() const { return mAtp; }
u32 MskType(u32 msk) const { return mType & msk; }
void SetType(u32 type) { mType = type; }
@@ -269,7 +273,7 @@ public:
int GetType() const { return mType; }
void SetType(u32 type) { mType = type; }
u32 GetGrp() const { return MskSPrm(0x1E); }
bool ChkSet() const { return MskSPrm(1); }
BOOL ChkSet() const { return MskSPrm(1); }
void ClrSet() { OffSPrmBit(1); }
u32 ChkHit() const { return MskRPrm(1); }
@@ -289,7 +293,7 @@ public:
void SetIGrp(u32);
void SetVsGrp(u32);
u32 GetGrp() const { return MskSPrm(0x1E); }
bool ChkSet() const { return MskSPrm(1); }
BOOL ChkSet() const { return MskSPrm(1); }
u32 GetVsGrp() const { return MskSPrm(0x70); }
u32 GetIGrp() const { return MskSPrm(0xE); }
u32 ChkNoCrr() const { return MskSPrm(0x100); }
@@ -323,10 +327,10 @@ public:
u32 GetCoGrp() const { return mObjCo.GetGrp(); }
int GetTgType() const { return mObjTg.GetType(); }
u32 GetAtType() const { return mObjAt.GetType(); }
bool ChkTgSet() const { return mObjTg.ChkSet(); }
bool ChkAtSet() const { return mObjAt.ChkSet(); }
bool ChkCoSet() const { return mObjCo.ChkSet(); }
u32 ChkCoSameActorHit() const { return mObjCo.ChkCoSameActorHit(); }
BOOL ChkTgSet() const { return mObjTg.ChkSet(); }
BOOL ChkAtSet() const { return mObjAt.ChkSet(); }
BOOL ChkCoSet() const { return mObjCo.ChkSet(); }
u32 ChkCoSameActorHit() { return mObjCo.MskSPrm(0x400); }
void OnCoSameActorHit() { mObjCo.OnCoSameActorHit(); }
void OffCoSameActorHit() { mObjCo.OffCoSameActorHit(); }
u32 GetCoVsGrp() const { return mObjCo.GetVsGrp(); }
@@ -334,8 +338,8 @@ public:
u8 GetAtAtp() const { return mObjAt.GetAtp(); }
u32 ChkAtNoTgHitInfSet() const { return mObjAt.MskSPrm(0x20); }
u32 ChkTgNoAtHitInfSet() const { return mObjTg.MskSPrm(0x20); }
u32 ChkCoNoCoHitInfSet() const { return mObjCo.MskSPrm(0x200); }
bool ChkTgNoSlingHitInfSet() const { return mObjTg.MskSPrm(0x40); }
u32 ChkCoNoCoHitInfSet() { return mObjCo.MskSPrm(0x200); }
BOOL ChkTgNoSlingHitInfSet() { return mObjTg.MskSPrm(0x40); }
void SetAtHit(cCcD_Obj* obj) { mObjAt.SetHit(obj); }
void SetTgHit(cCcD_Obj* obj) { mObjTg.SetHit(obj); }
void SetCoHit(cCcD_Obj* obj) { mObjCo.SetHit(obj); }
@@ -430,7 +434,6 @@ public:
/* vt[21]*/ virtual void getShapeAccess(cCcD_ShapeAttr::Shape*) const;
cM3dGAab& GetWorkAab() { return mAab; }
cM3dGAab const& GetWorkAab() const { return mAab; }
static cXyz m_virtual_center;
};
@@ -456,7 +459,7 @@ public:
void SetStts(cCcD_Stts* stts) { mStts = stts; }
cCcD_DivideInfo& GetDivideInfo() { return mDivideInfo; }
cCcD_DivideInfo* GetPDivideInfo() { return &mDivideInfo; }
int ChkBsRevHit() const { return mFlags & 2; }
int ChkBsRevHit() { return mFlags & 2; }
private:
/* 0x040 */ int mFlags;
+1 -3
View File
@@ -16,18 +16,16 @@ public:
/* 0x1000 */ cCcD_Obj* mpObjCo[0x100];
/* 0x1400 */ cCcD_Obj* mpObj[0x500];
#if DEBUG
/* 0x2800 */ int m_debug_code;
/* 0x2800 */ u32 m_debug_code;
#endif
/* 0x2800 */ u16 mObjAtCount;
/* 0x2802 */ u16 mObjTgCount;
/* 0x2804 */ u16 mObjCoCount;
/* 0x2806 */ u16 mObjCount;
#if DEBUG
/* 0x280C */ u16 field_0x280c;
/* 0x280E */ u16 field_0x280e;
/* 0x2810 */ u16 field_0x2810;
/* 0x2812 */ u16 field_0x2812;
#endif
/* 0x2808 */ cCcD_DivideArea mDivideArea;
/* 0x2848 vtable */
+16 -16
View File
@@ -18,33 +18,33 @@ public:
bool CrossY(const cXyz*) const;
bool UnderPlaneYUnder(f32) const;
bool TopPlaneYUnder(f32) const;
void ClearForMinMax(void);
void ClearForMinMax();
void SetMinMax(const cXyz&);
void SetMinMax(const cM3dGAab&);
void SetMin(const cXyz&);
void SetMax(const cXyz&);
void CalcCenter(cXyz*) const;
void PlusR(f32);
const cXyz* GetMaxP(void) const { return &mMax; }
cXyz* GetMaxP(void) { return &mMax; }
const cXyz* GetMinP(void) const { return &mMin; }
cXyz* GetMinP(void) { return &mMin; }
const f32 GetMaxX(void) const { return mMax.x; }
const f32 GetMaxY(void) const { return mMax.y; }
const f32 GetMaxZ(void) const { return mMax.z; }
const f32 GetMinX(void) const { return mMin.x; }
const f32 GetMinY(void) const { return mMin.y; }
const f32 GetMinZ(void) const { return mMin.z; }
bool Cross(const cM3dGLin *param_1) {
return cM3d_Cross_MinMaxBoxLine(GetMinP(), GetMaxP(), (Vec*)&param_1->GetStartP(), (Vec*)&param_1->GetEndP());
const cXyz* GetMaxP() const { return &mMax; }
cXyz* GetMaxP() { return &mMax; }
const cXyz* GetMinP() const { return &mMin; }
cXyz* GetMinP() { return &mMin; }
const f32 GetMaxX() const { return mMax.x; }
const f32 GetMaxY() const { return mMax.y; }
const f32 GetMaxZ() const { return mMax.z; }
const f32 GetMinX() const { return mMin.x; }
const f32 GetMinY() const { return mMin.y; }
const f32 GetMinZ() const { return mMin.z; }
bool Cross(const cM3dGLin *param_1) const {
return cM3d_Cross_MinMaxBoxLine(GetMinP(), GetMaxP(), param_1->GetStartP(), param_1->GetEndP());
}
bool Cross(const cM3dGAab *param_1) {
bool Cross(const cM3dGAab *param_1) const {
return cM3d_Cross_AabAab(this, param_1);
}
bool Cross(const cM3dGCyl *param_1) {
bool Cross(const cM3dGCyl *param_1) const {
return cM3d_Cross_AabCyl(this, param_1);
}
bool Cross(const cM3dGSph *param_1) {
bool Cross(const cM3dGSph *param_1) const {
return cM3d_Cross_AabSph(this, param_1);
}
}; // Size = 0x1C
+2
View File
@@ -30,6 +30,8 @@ public:
cM3dGCir(void);
virtual ~cM3dGCir(void);
void Set(f32, f32, f32, f32);
f32 GetHeight() const { return mPosZ; }
};
#endif /* C_M3D_G_CIR_H */
+4 -2
View File
@@ -3,6 +3,7 @@
#include "SSystem/SComponent/c_m3d.h"
#include "SSystem/SComponent/c_m3d_g_lin.h"
#include "SSystem/SComponent/c_m3d_g_tri.h"
struct cM3dGCpsS {
/* 0x00 */ Vec mStart;
@@ -14,8 +15,8 @@ class cM3dGCps : public cM3dGLin {
public:
/* 0x1C */ f32 mRadius;
cM3dGCps(void);
virtual ~cM3dGCps(void);
cM3dGCps();
virtual ~cM3dGCps();
void Set(const cXyz&, const cXyz&, f32);
void Set(const cM3dGCpsS&);
void SetCps(const cM3dGCps&);
@@ -24,6 +25,7 @@ public:
}
bool Cross(cM3dGCyl const* cyl, cXyz* xyz) const { return cM3d_Cross_CpsCyl(*this, *cyl, xyz); }
bool Cross(cM3dGSph const* sph, cXyz* xyz) const { return cM3d_Cross_CpsSph(*this, *sph, xyz); }
bool Cross(cM3dGTri const& tri, cXyz* xyz) const { return cM3d_Cross_CpsTri(*this, tri, xyz); }
void SetR(f32 r) { mRadius = r; }
f32 GetR() const { return mRadius; }
+2 -2
View File
@@ -40,8 +40,8 @@ public:
bool Cross(const cM3dGCps* cps, cXyz* xyz) const { return cM3d_Cross_CpsCyl(*cps, *this, xyz); }
bool Cross(const cM3dGTri& tri, cXyz* xyz) const { return cM3d_Cross_CylTri(this, &tri, xyz); }
bool Cross(const cM3dGCyl* other, f32* f) const { return cM3d_Cross_CylCyl(this, other, f); }
bool Cross(const cM3dGSph* sph, f32* f) const { return cM3d_Cross_CylSph(this, sph, f); }
bool cross(const cM3dGCyl* other, f32* f) const { return cM3d_Cross_CylCyl(this, other, f); }
bool cross(const cM3dGSph* sph, f32* f) const { return cM3d_Cross_CylSph(this, sph, f); }
}; // Size = 0x18
STATIC_ASSERT(0x18 == sizeof(cM3dGCyl));
+4 -4
View File
@@ -22,13 +22,13 @@ public:
void SetEnd(const cXyz&);
void set(const Vec& i_start, const Vec& i_end) { SetStartEnd(i_start, i_end); }
const cXyz& GetStartP(void) const { return mStart; }
cXyz& GetStartP(void) { return mStart; }
const cXyz* GetStartP() const { return &mStart; }
cXyz* GetStartP() { return &mStart; }
cXyz& GetStart() { return mStart; }
const cXyz& GetStart() const { return mStart; }
const cXyz& GetEndP(void) const { return mEnd; }
cXyz& GetEndP(void) { return mEnd; }
const cXyz* GetEndP() const { return &mEnd; }
cXyz* GetEndP() { return &mEnd; }
cXyz& GetEnd() { return mEnd; }
const cXyz& GetEnd() const { return mEnd; }
f32 GetLen() const { return PSVECDistance(&mStart, &mEnd); }
+2 -2
View File
@@ -31,8 +31,8 @@ public:
cM3d_CalcPla(v1, v2, v3, &mNormal, &mD);
}
f32 getCrossY_NonIsZero(const cXyz *param_1) {
return ((-mNormal.x * param_1->x - mNormal.z * param_1->z) - mD) / mNormal.y;
f32 getCrossY_NonIsZero(const cXyz& param_1) const {
return ((-mNormal.x * param_1.x - mNormal.z * param_1.z) - mD) / mNormal.y;
}
bool cross(cM3dGLin const& line, Vec& point) {
+3 -2
View File
@@ -39,9 +39,10 @@ public:
f32 GetCY(void) const { return mCenter.y; }
f32 GetCZ(void) const { return mCenter.z; }
bool Cross(const cM3dGSph* other, f32* f) const { return cM3d_Cross_SphSph(this, other, f); }
bool cross(const cM3dGSph* other, f32* f) const { return cM3d_Cross_SphSph(this, other, f); }
bool Cross(const cM3dGCps* cps, cXyz* xyz) const { return cM3d_Cross_CpsSph(*cps, *this, xyz); }
bool Cross(const cM3dGCyl* cyl, f32* f) const { return cM3d_Cross_CylSph(cyl, this, f); }
bool cross(const cM3dGCyl* cyl, f32* f) const { return cM3d_Cross_CylSph(cyl, this, f); }
bool Cross(const cM3dGTri& tri, cXyz* xyz) const { return cM3d_Cross_SphTri(this, &tri, xyz); }
}; // Size = 0x14
STATIC_ASSERT(0x14 == sizeof(cM3dGSph));
+4 -4
View File
@@ -26,10 +26,10 @@ public:
void setPos(const Vec*, const Vec*, const Vec*);
void setBg(const Vec*, const Vec*, const Vec*, const cM3dGPla*);
void set(const Vec*, const Vec*, const Vec*, const Vec*);
bool Cross(cM3dGCps const& cps, cXyz* xyz) const { return cM3d_Cross_CpsTri(cps, *this, xyz); }
bool Cross(cM3dGCyl const& cyl, cXyz* xyz) const { return this->cross(&cyl, xyz); }
bool Cross(cM3dGSph const& sph, cXyz* xyz) const { return cM3d_Cross_SphTri(&sph, this, xyz); }
bool Cross(cM3dGTri const& other, cXyz* xyz) const {
bool Cross(cM3dGCps const& cps, Vec* xyz) const { return cM3d_Cross_CpsTri(cps, *this, xyz); }
bool Cross(cM3dGCyl const& cyl, Vec* xyz) const { return this->cross(&cyl, xyz); }
bool Cross(cM3dGSph const& sph, Vec* xyz) const { return cM3d_Cross_SphTri(&sph, this, xyz); }
bool Cross(cM3dGTri const& other, Vec* xyz) const {
return cM3d_Cross_TriTri(*this, other, xyz);
}
bool cross(const cM3dGLin* lin, Vec* xyz, bool param_2, bool param_3) const {
+7
View File
@@ -2,6 +2,9 @@
#define C_MATH_H
#include "JSystem/JMath/JMATrigonometric.h"
#if TARGET_PC
#include "angle_utils.h"
#endif
#ifndef __MWERKS__
#include <limits>
@@ -32,7 +35,11 @@ inline f32 cM_ssin(s16 x) {
}
inline s16 cM_deg2s(f32 deg) {
#if TARGET_PC
return cAngle_degreeToS16(deg);
#else
return deg * 182.04445f;
#endif
}
inline s16 i_cM_deg2s(f32 deg) {
+11
View File
@@ -85,4 +85,15 @@
#define ANGLE_SUB_2 S16_SUB_2
#define ANGLE_MULT_2 S16_MULT_2
#if TARGET_PC
static inline s16 cAngle_degreeToS16(f32 deg) {
s32 angle = (s32)(deg * (0x8000 / 180.0f));
angle &= 0xFFFF;
if (angle >= 0x8000) {
angle -= 0x10000;
}
return (s16)angle;
}
#endif
#endif // !_ANGLE_UTILS_H_
+1 -1
View File
@@ -87,7 +87,7 @@ private:
/* 0x6B4 */ s16 field_0x6b4;
/* 0x6B6 */ s16 field_0x6b6;
/* 0x6B8 */ u8 field_0x6B8[0x6BC - 0x6B8];
/* 0x6BC */ char* mpName;
/* 0x6BC */ const char* mpName;
/* 0x6C0 */ s32 mAction;
/* 0x6C4 */ s32 mPrevAction;
/* 0x6C8 */ s32 mMode; // That's just a guess. Might need a better name for it's usage
+1 -1
View File
@@ -134,7 +134,7 @@ public:
/* 0x842 */ u16 field_0x842;
/* 0x844 */ u8 field_0x844;
/* 0x845 */ u8 field_0x845[0x848 - 0x845];
/* 0x848 */ s32 field_0x848;
/* 0x848 */ s32 mFlowID;
/* 0x84C */ dMsgFlow_c mMsgFlow;
/* 0x898 */ u8 field_0x898[0x89A - 0x898];
/* 0x89A */ s16 mEvtIdx;
+1 -1
View File
@@ -72,7 +72,7 @@ public:
void setExpression(int, f32);
bool talk(void*);
bool demo(void*);
inline fopAc_ac_c* searchInstructionTag();
inline fopAc_ac_c* searchInstructionTag();
bool instruction(void*);
bool checkIntroDemoStart();
int EvCut_BousIntroSumo1(int);
+13 -13
View File
@@ -58,8 +58,8 @@ struct daNpcCd_HIO_Jnt_c : public JORReflexible {
void genMessage(JORMContext*);
#endif
/* 0x04 */ Vec jntT;
/* 0x10 */ SVec jntR;
/* 0x04 */ BE(Vec) jntT;
/* 0x10 */ struct { BE(s16) x, y, z; } jntR;
};
struct daNpcCd_HIO_Child_c : public JORReflexible {
@@ -71,17 +71,17 @@ struct daNpcCd_HIO_Child_c : public JORReflexible {
#endif
/* 0x004 */ daNpcCd_HIO_Jnt_c field_0x4[12];
/* 0x124 */ s16 field_0x124[0x0C];
/* 0x13C */ f32 mObjScale;
/* 0x140 */ s16 mAtn;
/* 0x144 */ f32 mAnmPlaySpeed;
/* 0x148 */ f32 mWalkAnmPlaySpeed;
/* 0x14C */ f32 mMaxSpeed;
/* 0x150 */ f32 mWalkMaxSpeed;
/* 0x154 */ f32 mCylH;
/* 0x158 */ f32 mCylR;
/* 0x15C */ f32 mChkWallH;
/* 0x160 */ f32 mChkWallR;
/* 0x124 */ BE(s16) field_0x124[0x0C];
/* 0x13C */ BE(f32) mObjScale;
/* 0x140 */ BE(s16) mAtn;
/* 0x144 */ BE(f32) mAnmPlaySpeed;
/* 0x148 */ BE(f32) mWalkAnmPlaySpeed;
/* 0x14C */ BE(f32) mMaxSpeed;
/* 0x150 */ BE(f32) mWalkMaxSpeed;
/* 0x154 */ BE(f32) mCylH;
/* 0x158 */ BE(f32) mCylR;
/* 0x15C */ BE(f32) mChkWallH;
/* 0x160 */ BE(f32) mChkWallR;
};
STATIC_ASSERT(sizeof(daNpcCd_HIO_Child_c) == 0x164);
+1 -1
View File
@@ -160,7 +160,7 @@ private:
/* 0x14B0 */ int field_0x1460;
/* 0x1464 */ int field_0x1464;
/* 0x1468 */ int field_0x1468;
/* 0x146C */ int field_0x146C;
/* 0x146C */ int mFlowID;
/* 0x1470 */ s16 mLookMode;
/* 0x1472 */ u16 field_0x1472;
/* 0x1474 */ u8 mType;
+1 -1
View File
@@ -103,7 +103,7 @@ private:
/* 0xE00 */ int field_0xe00;
/* 0xE04 */ int field_0xe04;
/* 0xE08 */ int field_0xe08;
/* 0xE0C */ int field_0xe0c;
/* 0xE0C */ int mFlowID;
/* 0xE10 */ s16 mLookMode;
/* 0xE12 */ u16 mActionState;
/* 0xE14 */ u8 mType;
+1 -1
View File
@@ -121,7 +121,7 @@ private:
/* 0xDFC */ int field_0xdfc;
/* 0xE00 */ int field_0xe00;
/* 0xE04 */ int field_0xe04;
/* 0xE08 */ int field_0xe08;
/* 0xE08 */ int mFlowID;
/* 0xE0C */ s16 mLookMode;
/* 0xE0E */ u16 mMode;
/* 0xE10 */ u8 mType;
+2 -1
View File
@@ -182,7 +182,8 @@ public:
s16 getMessageNo() { return s16(home.angle.x); }
s8 getType() {
s8 rv = fopAcM_GetParam(this) & 0xFF;
// !@bug Comparison of s8 with 0xFF will always evaluate to false
if (rv == 0xFF) {
rv = 0;
}
+2 -1
View File
@@ -98,7 +98,8 @@ public:
s8 getType() {
s8 rv = fopAcM_GetParam(this) & 0xFF;
// !@bug Comparison of s8 with 0xFF will always evaluate to false
if (rv == 0xFF) {
rv = 0;
}
+2 -1
View File
@@ -99,7 +99,8 @@ public:
s8 getType() {
s8 rv = fopAcM_GetParam(this) & 0xFF;
// !@bug Comparison of s8 with 0xFF will always evaluate to false
if (rv == 0xFF) {
rv = 0;
}
+1 -1
View File
@@ -77,7 +77,7 @@ public:
class daNpc_Kn_prtclMngr_c {
public:
/* 0x00 */ bool mpModel;
/* 0x00 */ bool field_0x00;
/* 0x04 */ cXyz mPos;
/* 0x10 */ csXyz mAngle;
/* 0x18 */ cXyz mScale;
+1 -1
View File
@@ -89,7 +89,7 @@ public:
/* 0x5B7 */ u8 field_0x5b7;
/* 0x5B8 */ int order;
/* 0x5BC */ int bitTRB;
/* 0x5C0 */ char* res_name;
/* 0x5C0 */ const char* res_name;
/* 0x5C4 */ f32 dis;
/* 0x5C8 */ s16 target_angle;
/* 0x5CC */ mDoExt_McaMorfSO* model;
+1 -1
View File
@@ -104,7 +104,7 @@ public:
/* 0xDF8 */ int field_0xdf8;
/* 0xDFC */ int field_0xdfc;
/* 0xE00 */ int field_0xe00;
/* 0xE04 */ int field_0xe04;
/* 0xE04 */ int mFlowID;
/* 0xE08 */ s16 mLookMode;
/* 0xE0A */ u16 mMode;
/* 0xE0C */ u8 mType;
+1 -1
View File
@@ -95,7 +95,7 @@ public:
/* 0x5D8 */ f32 mDistToTarget;
/* 0x5DC */ s16 mAngleToPlayer;
/* 0x5E0 */ f32 mDistScale;
/* 0x5E4 */ char* mResName;
/* 0x5E4 */ const char* mResName;
/* 0x5E8 */ mDoExt_McaMorf* mpMorf;
/* 0x5EC */ mDoExt_btkAnm* mpBtkAnm;
/* 0x5F0 */ mDoExt_btpAnm* mpBtpAnm;
+1 -1
View File
@@ -37,7 +37,7 @@ public:
ACTION_DEAD_e,
};
static void PPCallBack(fopAc_ac_c*, fopAc_ac_c*, s16, dBgW_Base::PushPullLabel);
static fopAc_ac_c* PPCallBack(fopAc_ac_c*, fopAc_ac_c*, s16, dBgW_Base::PushPullLabel);
void initBaseMtx();
void setBaseMtx();
u16 getPointNo();
+2 -1
View File
@@ -251,12 +251,13 @@ public:
return paramLow << 8;
}
// SizedGroup in d_a_passer_mng.cpp relies on this layout, any changes here should also be changed there
struct Group {
u8 field_0x00;
int field_0x04[0];
};
static Group* mGroupTbl[4];
static const Group* mGroupTbl[4];
private:
/* 0x568 */ fpc_ProcID* childProcIds;
+3
View File
@@ -24,6 +24,9 @@ public:
u8 getBitSW2() { return (fopAcM_GetParam(this) & 0xFF00) >> 8; }
u32 getFlowNodeNo() {
// !@bug home.angle.x is promoted to a 32-bit signed integer prior
// to being compared, so the compared value can never exceed
// SHORT_MAX and the condition always passes.
if (home.angle.x != 0xFFFF) {
return (u16)home.angle.x;
}
+4
View File
@@ -19,6 +19,10 @@ public:
u32 getProcessID() { return mProcessID; }
int getFlowNodeNum() {
return (u16)home.angle.x == 0xFFFF ? -1 : (u16)home.angle.x;
}
/* 0x56C */ u32 mProcessID;
/* 0x570 */ s16 mCreateTimer;
/* 0x572 */ u8 field_0x572;
+117 -62
View File
@@ -13,7 +13,7 @@ class cBgS_ChkElm {
public:
/* 0x00 */ dBgW_Base* m_bgw_base_ptr;
/* 0x04 */ bool m_used;
/* 0x08 */ u32 m_actor_id;
/* 0x08 */ fpc_ProcID m_actor_id;
/* 0x0C */ fopAc_ac_c* m_actor_ptr;
/* 0x10 vtable */
@@ -50,6 +50,7 @@ public:
bool GetTriPnt(cBgS_PolyInfo const&, cXyz*, cXyz*, cXyz*) const;
void ShdwDraw(cBgS_ShdwDraw*);
u32 GetGrpInf(cBgS_PolyInfo const&) const;
void Draw();
virtual ~cBgS() {}
virtual void Ct();
@@ -66,41 +67,121 @@ u8 dKy_pol_sound_get(cBgS_PolyInfo const* param_0);
class dBgS_HIO : public JORReflexible {
public:
#if DEBUG
enum flags_e {
FLAG_ACCH_WALL_OFF_e = 0x2,
FLAG_CHECK_COUNTER_e = 0x4,
FLAG_ACCH_WALL_TIMER_e = 0x8,
FLAG_OBJ_LINE_CHECK_e = 0x10,
FLAG_ACCH_DRAW_WALL_e = 0x400,
FLAG_ROOF_TIMER_e = 0x2000,
FLAG_ROOF_OFF_e = 0x4000,
FLAG2_GND_CHK_e = 0x1,
FLAG2_SHAPE_DISP_e = 0x2,
FLAG2_GROUND_CHECK_TIMER_e = 0x4,
FLAG2_SPL_OFF_e = 0x8,
FLAG2_SPL_TIMER_e = 0x10,
FLAG2_LINE_OFF_e = 0x40,
FLAG2_LINE_TIMER_e = 0x80,
FLAG2_SHDW_DRAW_OFF_e = 0x100,
FLAG2_SHDW_DRAW_TIMER_e = 0x200,
FLAG2_CAPTPOLY_OFF_e = 0x800,
FLAG2_CAPTPOLY_TIMER_e = 0x1000,
FLAG2_SPH_CHK_OFF_e = 0x2000,
FLAG2_SPH_CHK_TIMER_e = 0x4000,
};
dBgS_HIO() {
field_0x6 = 0;
field_0x8 = 0;
m_flags = 0;
m_flags2 = 0;
field_0xc.x = field_0xc.y = field_0xc.z = 0.0f;
field_0x18.x = field_0x18.y = field_0x18.z = 0.0f;
field_0x24.x = field_0x24.y = field_0x24.z = 0.0f;
m_linecheck_start.x = m_linecheck_start.y = m_linecheck_start.z = 0.0f;
m_linecheck_end.x = m_linecheck_end.y = m_linecheck_end.z = 0.0f;
m_gndcheck_pos.x = m_gndcheck_pos.y = m_gndcheck_pos.z = 0.0f;
field_0x30 = -1;
m_errorCheck_actor_num = -1;
}
virtual void genMessage(JORMContext*);
virtual ~dBgS_HIO();
virtual ~dBgS_HIO() {}
BOOL ChkLineOff();
BOOL ChkCheckCounter();
BOOL ChkLineTimer();
BOOL ChkGroundCheckTimer();
bool ChkLineOff() { return m_flags2 & FLAG2_LINE_OFF_e; }
bool ChkCheckCounter() { return m_flags & FLAG_CHECK_COUNTER_e; }
bool ChkLineTimer() { return m_flags2 & FLAG2_LINE_TIMER_e; }
bool ChkGroundCheckTimer() { return m_flags2 & FLAG2_GROUND_CHECK_TIMER_e; }
bool ChkObjLineCheck() { return m_flags & FLAG_OBJ_LINE_CHECK_e; }
bool ChkGndCheck() { return m_flags2 & FLAG2_GND_CHK_e; }
bool ChkCaptPolyTimer() { return m_flags2 & FLAG2_CAPTPOLY_TIMER_e; }
bool ChkCaptPolyOff() { return m_flags2 & FLAG2_CAPTPOLY_OFF_e; }
bool ChkShdwDrawOff() { return m_flags2 & FLAG2_SHDW_DRAW_OFF_e; }
bool ChkShdwDrawTimer() { return m_flags2 & FLAG2_SHDW_DRAW_TIMER_e; }
bool ChkAcchWallOff() { return m_flags & FLAG_ACCH_WALL_OFF_e; }
bool ChkAcchWallTimer() { return m_flags & FLAG_ACCH_WALL_TIMER_e; }
bool ChkRoofTimer() { return m_flags & FLAG_ROOF_TIMER_e; }
bool ChkRoofOff() { return m_flags & FLAG_ROOF_OFF_e; }
bool ChkSplOff() { return m_flags2 & FLAG2_SPL_OFF_e; }
bool ChkSplTimer() { return m_flags2 & FLAG2_SPL_TIMER_e; }
bool ChkSphChkOff() { return m_flags2 & FLAG2_SPH_CHK_OFF_e; }
bool ChkSphChkTimer() { return m_flags2 & FLAG2_SPH_CHK_TIMER_e; }
bool ChkShapeDisp() { return m_flags2 & FLAG2_SHAPE_DISP_e; }
bool ChkAcchDrawWall() { return m_flags & FLAG_ACCH_DRAW_WALL_e; }
/* 0x04 */ u8 field_0x4[0x6 - 0x4];
/* 0x06 */ u16 field_0x6;
/* 0x08 */ u16 field_0x8;
/* 0x0C */ cXyz field_0xc;
/* 0x18 */ cXyz field_0x18;
/* 0x24 */ cXyz field_0x24;
/* 0x30 */ int field_0x30;
#endif
/* 0x04 */ s8 id;
/* 0x06 */ u16 m_flags;
/* 0x08 */ u16 m_flags2;
/* 0x0C */ cXyz m_linecheck_start;
/* 0x18 */ cXyz m_linecheck_end;
/* 0x24 */ cXyz m_gndcheck_pos;
/* 0x30 */ s32 m_errorCheck_actor_num;
};
extern int g_line_counter;
extern OSStopwatch s_line_sw;
class dBgS_InsideHIO : public JORReflexible {
public:
enum flags_e {
FLAG_DISP_POLY_e = 0x1,
FLAG_DISP_DP_AREA_e = 0x2,
FLAG_WHITE_WIRE_e = 0x4,
FLAG_PLAYER_AROUND_e = 0x8,
FLAG_DISP_WATER_POLY_e = 0x10,
FLAG_GROUND_OFF_e = 0x20,
FLAG_WALL_OFF_e = 0x40,
FLAG_ROOF_OFF_e = 0x80,
FLAG_GNDCHK_PLAYER_UNDER_e = 0x100,
};
extern int g_ground_counter;
extern OSStopwatch s_ground_sw;
dBgS_InsideHIO() {
m_flags = FLAG_PLAYER_AROUND_e;
m_raise_amount = 1.0f;
m_p0.x = 100.0f;
m_p0.y = 0.0f;
m_p0.z = 0.0f;
m_p1.x = 0.0f;
m_p1.y = 0.0f;
m_p1.z = 0.0f;
}
virtual void genMessage(JORMContext*);
virtual ~dBgS_InsideHIO();
BOOL ChkWallOff() { return m_flags & FLAG_WALL_OFF_e; }
BOOL ChkRoofOff() { return m_flags & FLAG_ROOF_OFF_e; }
BOOL ChkGroundOff() { return m_flags & FLAG_GROUND_OFF_e; }
BOOL ChkGndChkPlayerUnder() { return m_flags & FLAG_GNDCHK_PLAYER_UNDER_e; }
BOOL ChkWhiteWire() { return m_flags & FLAG_WHITE_WIRE_e; }
BOOL ChkDispWaterPoly() { return m_flags & FLAG_DISP_WATER_POLY_e; }
BOOL ChkDispDpArea() { return m_flags & FLAG_DISP_DP_AREA_e; }
BOOL ChkPlayerAround() { return m_flags & FLAG_PLAYER_AROUND_e; }
BOOL ChkDispPoly() { return m_flags & FLAG_DISP_POLY_e; }
/* 0x04 */ s8 id;
/* 0x06 */ u16 m_flags;
/* 0x08 */ f32 m_raise_amount;
/* 0x0C */ cXyz m_p0;
/* 0x18 */ cXyz m_p1;
};
class dBgS : public cBgS {
public:
@@ -149,58 +230,32 @@ public:
bool WaterChk(dBgS_SplGrpChk* chk) { return SplGrpChk(chk); }
u32 GetMtrlSndId(const cBgS_PolyInfo& param_0) { return dKy_pol_sound_get(&param_0); }
void DebugDrawPoly(dBgW_Base *param_1) {}
void DebugDrawPoly(dBgW_Base const& param_1) {}
void DrawPoly(cBgS_PolyInfo const& param_0, GXColor const& param_1);
fopAc_ac_c* GetActorPointer(cBgS_PolyInfo const& param_0) const { return cBgS::GetActorPointer(param_0); }
void DebugDrawPoly(const dBgW_Base& param_1);
#if DEBUG
bool LineCross(cBgS_LinChk* i_linChk);
f32 GroundCross(cBgS_GndChk* i_gndChk);
void ShdwDraw(cBgS_ShdwDraw*);
#else
bool LineCross(cBgS_LinChk* i_linChk) {
#if DEBUG
if (m_hio.ChkLineOff()) {
return false;
}
if (m_hio.ChkCheckCounter()) {
g_line_counter++;
}
if (m_hio.ChkLineTimer()) {
OSStartStopwatch(&s_line_sw);
}
bool rt = cBgS::LineCross(i_linChk);
if (m_hio.ChkLineTimer()) {
OSStopStopwatch(&s_line_sw);
OSDumpStopwatch(&s_line_sw);
}
return rt;
#else
return cBgS::LineCross(i_linChk);
#endif
}
f32 GroundCross(cBgS_GndChk* i_gndChk) {
#if DEBUG
if (m_hio.ChkCheckCounter()) {
g_ground_counter++;
}
if (m_hio.ChkGroundCheckTimer()) {
OSStartStopwatch(&s_ground_sw);
}
f32 rt = cBgS::GroundCross(i_gndChk);
if (m_hio.ChkGroundCheckTimer()) {
OSStopStopwatch(&s_ground_sw);
OSDumpStopwatch(&s_ground_sw);
}
return rt;
#else
return cBgS::GroundCross(i_gndChk);
#endif
}
#endif
void ChkDeleteActorRegist(fopAc_ac_c*);
void Draw();
void CaptPoly(dBgS_CaptPoly&);
#if DEBUG
/* 0x1404 */ u8 field_0x1404[0x1408 - 0x1404];
/* 0x1408 */ dBgS_HIO m_hio;
#endif
}; // Size: 0x1404
bool dBgS_CheckBGroundPoly(cBgS_PolyInfo const&);
+71 -69
View File
@@ -25,7 +25,7 @@ private:
public:
enum {
/* 0x2 */ WALL_HIT = 2,
/* 0x2 */ FLAG_WALL_HIT = 2,
/* 0x4 */ WALL_H_DIRECT = 4,
};
@@ -42,16 +42,18 @@ public:
virtual ~dBgS_AcchCir() {}
#endif
void SetWallPolyIndex(int index) { SetPolyIndex(index); }
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) != 0; }
bool ChkWallHit() { return (m_flags & FLAG_WALL_HIT) != 0; }
s16 GetWallAngleY() { return m_wall_angle_y; }
bool ChkWallHDirect() { return (m_flags & WALL_H_DIRECT) != 0; }
BOOL ChkWallHDirect() { return (m_flags & WALL_H_DIRECT); }
f32 GetWallHDirect() { return m_wall_h_direct; }
f32 GetWallRR() { return m_wall_rr; }
void SetWallHit() { m_flags |= WALL_HIT; }
void SetWallHit() { m_flags |= FLAG_WALL_HIT; }
void SetWallAngleY(s16 i_angle) { m_wall_angle_y = i_angle; }
cM3dGCir* GetCirP() { return &m_cir; }
@@ -62,26 +64,26 @@ class dBgS;
class dBgS_Acch : public cBgS_Chk, public dBgS_Chk {
public:
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),
/* 0x000400 */ WATER_NONE = (1 << 10),
/* 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),
/* 0x000002 */ FLAG_GRND_NONE = (1 << 1),
/* 0x000004 */ FLAG_WALL_NONE = (1 << 2),
/* 0x000008 */ FLAG_ROOF_NONE = (1 << 3),
/* 0x000010 */ FLAG_WALL_HIT = (1 << 4),
/* 0x000020 */ FLAG_GROUND_HIT = (1 << 5),
/* 0x000040 */ FLAG_GROUND_FIND = (1 << 6),
/* 0x000080 */ FLAG_GROUND_LANDING = (1 << 7),
/* 0x000100 */ FLAG_GROUND_AWAY = (1 << 8),
/* 0x000200 */ FLAG_ROOF_HIT = (1 << 9),
/* 0x000400 */ FLAG_WATER_NONE = (1 << 10),
/* 0x000800 */ FLAG_WATER_HIT = (1 << 11),
/* 0x001000 */ FLAG_WATER_IN = (1 << 12),
/* 0x002000 */ FLAG_LINE_CHECK = (1 << 13),
/* 0x004000 */ FLAG_LINE_CHECK_NONE = (1 << 14),
/* 0x008000 */ FLAG_CLR_SPEED_Y = (1 << 15),
/* 0x010000 */ FLAG_LINE_CHECK_HIT = (1 << 16),
/* 0x100000 */ FLAG_MOVE_BG_ONLY = (1 << 20),
/* 0x200000 */ FLAG_GND_THIN_CELLING_OFF = (1 << 21),
/* 0x400000 */ FLAG_WALL_SORT = (1 << 22),
/* 0x800000 */ FLAG_LINE_DOWN = (1 << 23),
};
dBgS_Acch();
@@ -124,56 +126,56 @@ public:
f32 GetRoofHeight() const { return m_roof_height; }
int GetTblSize() { return m_tbl_size; }
void SetLin() { m_lin.SetStartEnd(*pm_old_pos, *pm_pos); }
bool ChkGroundFind() { return (m_flags & GROUND_FIND) != 0; }
bool ChkGroundHit() const { return (m_flags & GROUND_HIT) != 0; }
bool ChkGroundLanding() const { return (m_flags & GROUND_LANDING) != 0; }
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; }
void SetWaterNone() { m_flags |= WATER_NONE; }
u32 ChkWallHit() const { return m_flags & WALL_HIT; }
void OffLineCheckHit() { m_flags &= ~LINE_CHECK_HIT; }
void OffLineCheck() { m_flags &= ~LINE_CHECK; }
u32 ChkLineCheckNone() const { return (m_flags & LINE_CHECK_NONE) != 0; }
u32 ChkLineCheck() const { return (m_flags & LINE_CHECK) != 0; }
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; }
const u32 MaskWaterIn() const { return m_flags & WATER_IN; }
bool ChkGroundFind() { return (m_flags & FLAG_GROUND_FIND) != 0; }
bool ChkGroundHit() const { return (m_flags & FLAG_GROUND_HIT) != 0; }
bool ChkGroundLanding() const { return (m_flags & FLAG_GROUND_LANDING) != 0; }
void ClrGroundLanding() { m_flags &= ~FLAG_GROUND_LANDING; }
void ClrGroundAway() { m_flags &= ~FLAG_GROUND_AWAY; }
void ClrWallHit() { m_flags &= ~FLAG_WALL_HIT; }
void SetRoofNone() { m_flags |= FLAG_ROOF_NONE; }
void SetRoofHit() { m_flags |= FLAG_ROOF_HIT; }
void SetWaterNone() { m_flags |= FLAG_WATER_NONE; }
u32 ChkWallHit() const { return m_flags & FLAG_WALL_HIT; }
void OffLineCheckHit() { m_flags &= ~FLAG_LINE_CHECK_HIT; }
void OffLineCheck() { m_flags &= ~FLAG_LINE_CHECK; }
u32 ChkLineCheckNone() const { return (m_flags & FLAG_LINE_CHECK_NONE); }
u32 ChkLineCheck() const { return (m_flags & FLAG_LINE_CHECK); }
void ClrRoofHit() { m_flags &= ~FLAG_ROOF_HIT; }
void ClrWaterHit() { m_flags &= ~FLAG_WATER_HIT; }
void SetWaterHit() { m_flags |= FLAG_WATER_HIT; }
void ClrWaterIn() { m_flags &= ~FLAG_WATER_IN; }
void SetWaterIn() { m_flags |= FLAG_WATER_IN; }
const u32 MaskWaterIn() const { return m_flags & FLAG_WATER_IN; }
const bool ChkWaterIn() const { return MaskWaterIn() != 0; }
void ClrGroundFind() { m_flags &= ~GROUND_FIND; }
u32 MaskRoofHit() const { return m_flags & ROOF_HIT; }
void ClrGroundFind() { m_flags &= ~FLAG_GROUND_FIND; }
u32 MaskRoofHit() const { return m_flags & FLAG_ROOF_HIT; }
bool ChkRoofHit() const { return MaskRoofHit() != 0; }
void OffClrSpeedY() { m_flags |= CLR_SPEED_Y; }
void OnClrSpeedY() { m_flags &= ~CLR_SPEED_Y; }
bool ChkClrSpeedY() const { 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; }
const u32 MaskWaterHit() const { return m_flags & WATER_HIT; }
void OffClrSpeedY() { m_flags |= FLAG_CLR_SPEED_Y; }
void OnClrSpeedY() { m_flags &= ~FLAG_CLR_SPEED_Y; }
bool ChkClrSpeedY() const { return !(m_flags & FLAG_CLR_SPEED_Y); }
void SetGroundFind() { m_flags |= FLAG_GROUND_FIND; }
void SetGroundHit() { m_flags |= FLAG_GROUND_HIT; }
void SetGroundLanding() { m_flags |= FLAG_GROUND_LANDING; }
void SetGroundAway() { m_flags |= FLAG_GROUND_AWAY; }
const u32 MaskWaterHit() const { return m_flags & FLAG_WATER_HIT; }
const bool ChkWaterHit() const { return MaskWaterHit() != 0; }
void ClrWaterNone() { m_flags &= ~WATER_NONE; }
void ClrWaterNone() { m_flags &= ~FLAG_WATER_NONE; }
void SetWaterCheckOffset(f32 offset) { m_wtr_chk_offset = offset; }
void OnLineCheck() { m_flags |= LINE_CHECK; }
void ClrRoofNone() { m_flags &= ~ROOF_NONE; }
void OnLineCheck() { m_flags |= FLAG_LINE_CHECK; }
void ClrRoofNone() { m_flags &= ~FLAG_ROOF_NONE; }
void SetRoofCrrHeight(f32 height) { m_roof_crr_height = height; }
void SetWtrChkMode(int mode) { m_wtr_mode = mode; }
void SetGrndNone() { m_flags |= GRND_NONE; }
void ClrGrndNone() { m_flags &= ~GRND_NONE; }
bool ChkMoveBGOnly() const { return (m_flags & MOVE_BG_ONLY) != 0; }
void SetWallHit() { m_flags |= WALL_HIT; }
void ClrWallNone() { m_flags &= ~WALL_NONE; }
void OnLineCheckNone() { m_flags |= LINE_CHECK_NONE; }
void OffLineCheckNone() { m_flags &= ~LINE_CHECK_NONE; }
void SetWallNone() { m_flags |= WALL_NONE; }
void OnLineCheckHit() { m_flags |= LINE_CHECK_HIT; }
bool ChkGroundAway() const { return (m_flags & GROUND_AWAY) != 0; }
void ClrGroundHit() { m_flags &= ~GROUND_HIT; }
void SetGrndNone() { m_flags |= FLAG_GRND_NONE; }
void ClrGrndNone() { m_flags &= ~FLAG_GRND_NONE; }
bool ChkMoveBGOnly() const { return (m_flags & FLAG_MOVE_BG_ONLY) != 0; }
void SetWallHit() { m_flags |= FLAG_WALL_HIT; }
void ClrWallNone() { m_flags &= ~FLAG_WALL_NONE; }
void OnLineCheckNone() { m_flags |= FLAG_LINE_CHECK_NONE; }
void OffLineCheckNone() { m_flags &= ~FLAG_LINE_CHECK_NONE; }
void SetWallNone() { m_flags |= FLAG_WALL_NONE; }
void OnLineCheckHit() { m_flags |= FLAG_LINE_CHECK_HIT; }
bool ChkGroundAway() const { return (m_flags & FLAG_GROUND_AWAY) != 0; }
void ClrGroundHit() { m_flags &= ~FLAG_GROUND_HIT; }
void SetGroundCheckOffset(f32 offset) { m_gnd_chk_offset = offset; }
cM3dGCyl* GetWallBmdCylP() { return &m_wall_cyl; }
@@ -186,7 +188,7 @@ public:
f32 GetWallH(int i_no) { return pm_acch_cir[i_no].GetWallH(); }
f32 GetWallR(int i_no) { return pm_acch_cir[i_no].GetWallR(); }
bool ChkWallHDirect(int i_no) { return pm_acch_cir[i_no].ChkWallHDirect(); }
BOOL ChkWallHDirect(int i_no) { return pm_acch_cir[i_no].ChkWallHDirect(); }
f32 GetWallHDirect(int i_no) { return pm_acch_cir[i_no].GetWallHDirect(); }
f32 GetWallRR(int i_no) { return pm_acch_cir[i_no].GetWallRR(); }
void SetWallCirHit(int i_no) { pm_acch_cir[i_no].SetWallHit(); }
-19
View File
@@ -1,19 +0,0 @@
#ifndef D_BG_D_BG_S_CAPT_POLY_H
#define D_BG_D_BG_S_CAPT_POLY_H
#include "d/d_bg_s_chk.h"
#include "SSystem/SComponent/c_m3d_g_aab.h"
struct dBgS_CaptPoly;
typedef void (*CaptPolyCallback)(dBgS_CaptPoly&, cBgD_Vtx_t*, u16, u16, u16, cM3dGPla*);
struct dBgS_CaptPoly : public cBgS_Chk, public dBgS_Chk {
public:
cM3dGAab* GetBndP() { return &m_pos;}
/* 0x2C */ cM3dGAab m_pos;
/* 0x48 */ CaptPolyCallback m_callback;
};
#endif
+13 -7
View File
@@ -1,18 +1,24 @@
#ifndef _D_BG_S_CAPT_POLY_H
#define _D_BG_S_CAPT_POLY_H
#ifndef D_BG_D_BG_S_CAPT_POLY_H
#define D_BG_D_BG_S_CAPT_POLY_H
#include "d/d_bg_s_chk.h"
#include "SSystem/SComponent/c_m3d_g_aab.h"
#include "SSystem/SComponent/c_xyz.h"
class dBgS_CaptPoly : public cBgS_Chk, public dBgS_Chk {
struct dBgS_CaptPoly;
typedef int (*CaptPolyCallback)(dBgS_CaptPoly*, cBgD_Vtx_t*, int, int, int, cM3dGPla*);
struct dBgS_CaptPoly : public cBgS_Chk, public dBgS_Chk {
public:
dBgS_CaptPoly();
~dBgS_CaptPoly() {}
void Set(cXyz&, cXyz&);
/* 0x24 */ cM3dGAab aab;
/* 0x48 */ int field_0x48;
void SetCallback(CaptPolyCallback callback) { m_callback = callback; }
cM3dGAab* GetBndP() { return &m_bnd;}
/* 0x2C */ cM3dGAab m_bnd;
/* 0x48 */ CaptPolyCallback m_callback;
};
#endif /* _D_BG_S_CAPT_POLY_H */
#endif
+1
View File
@@ -20,6 +20,7 @@ public:
void OffWaterGrp() { mGrp &= ~WATER_GRP; }
void OnNormalGrp() { mGrp |= NORMAL_GRP; }
void OffNormalGrp() { mGrp &= ~NORMAL_GRP; }
void OnFullGrp() { mGrp |= FULL_GRP; }
void OffFullGrp() { mGrp &= ~FULL_GRP; }
void OnAll() { mGrp |= FULL_GRP; }
u32 MaskNormalGrp() { return mGrp & NORMAL_GRP; }
+1
View File
@@ -15,6 +15,7 @@ public:
dBgS_SphChk();
virtual ~dBgS_SphChk();
void Init() { ClearPi(); }
void SetCallback(SphChk_Callback i_callback) { mCallback = i_callback; }
/* 0x50 */ SphChk_Callback mCallback;
+1 -1
View File
@@ -24,7 +24,7 @@ public:
void OffMoveBGOnly() { m_flags &= ~MOVE_BG_ONLY; }
void OnMoveBGOnly() { m_flags |= MOVE_BG_ONLY; }
void OnFind() { m_flags |= FIND; }
bool ChkMoveBGOnly() { return m_flags & MOVE_BG_ONLY; }
BOOL ChkMoveBGOnly() { return m_flags & MOVE_BG_ONLY; }
void SetHeight(f32 height) { m_height = height; }
f32 GetHeight() { return m_height; }
cXyz& GetPosP() { return m_ground; }
+20 -8
View File
@@ -156,6 +156,10 @@ public:
u32 GetMaskPolyInf1_NoShift(int, u32) const;
u32 GetPolyInf2(int, u32, u32) const;
int GetTriGrp(int) const;
#if DEBUG
void DebugLocalPos();
#endif
virtual ~cBgW();
virtual bool ChkMemoryError();
@@ -218,23 +222,23 @@ public:
virtual bool ChkShdwDrawThrough(int, cBgS_PolyPassChk*);
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; }
u32 GetOldInvMtx(Mtx m) const { return PSMTXInverse(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 |= (u8)LOCK_e; }
void OffRoofRegist() { field_0x91 |= (u8)0x4; }
void OnRoofRegist() { field_0x91 &= ~0x04; }
bool ChkRoofRegist() { return field_0x91 & 4;}
bool ChkRoofRegist() { return (field_0x91 & 4) == 0;}
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 SetBaseMtxP(Mtx* mtx) { pm_base = mtx; }
void SetNoCalcVtx() { mFlags |= NO_CALC_VTX_e; }
cBgD_t* GetBgd() const { return pm_bgd; }
public:
/* 0x18 */ MtxP pm_base; // Model Matrix
/* 0x18 */ Mtx* pm_base; // Model Matrix
/* 0x1C */ Mtx m_inv_mtx;
/* 0x4C */ Mtx m_mtx;
/* 0x7C */ cXyz mTransVel;
@@ -333,10 +337,14 @@ public:
virtual bool ChkShdwDrawThrough(int, cBgS_PolyPassChk*);
virtual bool ChkGrpThrough(int, cBgS_GrpPassChk*, int);
void DrawBox() const;
void DebugDraw() const;
void DrawPoly(const cBgS_PolyInfo&, const GXColor&) const;
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; }
void OnMoveFlag() { m_flags |= (u8)1; }
private:
/* 0xB0 */ dBgW_CrrFunc m_crr_func;
@@ -347,4 +355,8 @@ private:
dBgW* dBgW_NewSet(cBgD_t* pbgd, u32 flags, Mtx* pbase_mtx);
#if DEBUG
extern u8 lbl_8074C7F0;
#endif
#endif /* D_BG_D_BG_W_H */
+5 -7
View File
@@ -105,17 +105,15 @@ public:
virtual void CallRideCallBack(fopAc_ac_c*, fopAc_ac_c*);
virtual void CallArrowStickCallBack(fopAc_ac_c*, fopAc_ac_c*, cXyz&);
#if DEBUG
virtual void DebugDraw() {}
virtual void DrawPoly(cBgS_PolyInfo const& param_0, GXColor const& param_1) {}
virtual void DebugBox() {}
#endif
virtual void DebugDraw() const {}
virtual void DrawPoly(cBgS_PolyInfo const& param_0, GXColor const& param_1) const {}
virtual void DrawBox() const {}
PushPull_CallBack GetPushPullCallback() const { return m_pushPull_Callback; }
s16 GetDiffShapeAngleY() { return m_diff_ShapeAngleY; }
int GetRoomId() { return m_roomId; }
bool chkStickWall() { return field_0xb & 1; }
bool chkStickRoof() { return field_0xb & 2; }
BOOL chkStickWall() { return field_0xb & 1; }
BOOL chkStickRoof() { return field_0xb & 2; }
bool ChkPushPullOk() const { return m_pushPull_Ok; }
void SetPushPullCallback(PushPull_CallBack i_callBack) { m_pushPull_Callback = i_callBack; }
void SetRoomId(int id) { m_roomId = id; }
+5 -13
View File
@@ -144,7 +144,7 @@ public:
void ClrEffCounter() { mEffCounter = 0; }
u32 GetGFlag() const { return mGFlag; }
u32 GetRPrm() const { return mRPrm; }
u32 MskSPrm(u32 mask) const { return mGFlag & mask; }
u32 MskSPrm(u32 mask) { return mGFlag & mask; }
u32 MskRPrm(u32 mask) const { return mRPrm & mask; }
bool ChkSPrm(u32 mask) { return MskSPrm(mask); }
void OnSPrm(u32 flag) { mGFlag |= flag; }
@@ -173,7 +173,7 @@ public:
u8 GetSe() { return mSe; }
dCcG_At_Spl GetSpl() { return (dCcG_At_Spl)mSpl; }
u8 GetMtrl() { return mMtrl; }
u8 GetHitMark() { return mHitMark; }
int GetHitMark() { return mHitMark; }
void SetRVec(cXyz& vec) { mRVec = vec; }
void SetHitPos(cXyz& pos) { mHitPos = pos; }
cXyz* GetHitPosP() { return &mHitPos; }
@@ -203,10 +203,10 @@ public:
void SetHitMark(CcG_Tg_HitMark mark) { mHitMark = mark; }
s16* GetShieldFrontRangeYAngle() { return mShieldFrontRangeYAngle; }
s16 GetShieldRange() { return mShieldRange; }
u8 GetSpl() { return mSpl; }
int GetSpl() { return mSpl; }
void SetSpl(dCcG_Tg_Spl tg_spl) { mSpl = tg_spl; }
void SetSpl(u8 tg_spl) { mSpl = tg_spl; }
u8 GetHitMark() { return mHitMark; }
int GetHitMark() { return mHitMark; }
void SetRVec(cXyz& vec) { mRVec = vec; }
cXyz* GetVecP() { return &mVec; }
cXyz* GetRVecP() { return &mRVec; }
@@ -250,7 +250,7 @@ public:
void SetRoomId(int id) { mRoomId = id; }
fpc_ProcID GetAtOldApid() { return mAtOldApid; }
fpc_ProcID GetTgOldApid() { return mTgOldApid; }
bool ChkNoActor() { return field_0x1C & 1;}
BOOL ChkNoActor() { return field_0x1C & 1;}
bool ChkNoneActorPerfTblId() { return field_0x08 == 0xFFFF; }
dCcG_At_Spl GetAtSpl() { return (dCcG_At_Spl)mAt; }
void SetAtSpl(dCcG_At_Spl spl) { mAt = spl; }
@@ -451,9 +451,7 @@ public:
void CalcTgVec();
virtual ~dCcD_Cps() {}
dCcD_Cps() {}
#if DEBUG
virtual void Draw(const GXColor& color);
#endif
}; // Size = 0x144
// Triangle
@@ -463,9 +461,7 @@ public:
cCcD_ShapeAttr* GetShapeAttr();
virtual ~dCcD_Tri() {}
dCcD_Tri() {}
#if DEBUG
virtual void Draw(const GXColor& color);
#endif
};
// Cylinder
@@ -478,9 +474,7 @@ public:
void MoveCTg(cXyz&);
virtual ~dCcD_Cyl() {}
dCcD_Cyl() {}
#if DEBUG
virtual void Draw(const GXColor& color);
#endif
}; // Size = 0x13C
// Sphere
@@ -492,9 +486,7 @@ public:
void MoveCAt(cXyz&);
virtual cCcD_ShapeAttr* GetShapeAttr();
virtual ~dCcD_Sph() {}
#if DEBUG
virtual void Draw(const GXColor& color);
#endif
}; // Size = 0x138
dCcD_GObjInf* dCcD_GetGObjInf(cCcD_Obj* param_0);
+4 -4
View File
@@ -9,7 +9,7 @@ class dCcMassS_Obj {
private:
/* 0x00 */ cCcD_Obj* mpObj;
/* 0x04 */ u8 mPriority;
/* 0x08 */ dCcMassS_ObjCallback mpCallback;
/* 0x08 */ dCcMassS_ObjCallback mpAreaCheckFunc;
/* 0x0C */ cCcD_DivideInfo mDivideInfo;
/* 0x1C vtable */
@@ -19,10 +19,10 @@ public:
void Set(cCcD_Obj* p_obj, u8 priority, dCcMassS_ObjCallback callback);
void Clear();
cCcD_Obj* GetObj() { return mpObj; }
cCcD_Obj* GetObj() const { return mpObj; }
u8 GetPriority() const { return mPriority; }
dCcMassS_ObjCallback GetCallback() const { return mpCallback; }
cCcD_DivideInfo& GetDivideInfo() { return mDivideInfo; }
dCcMassS_ObjCallback GetAreaCheckFunc() const { return mpAreaCheckFunc; }
cCcD_DivideInfo* GetPDivideInfo() { return &mDivideInfo; }
}; // Size = 0x20
STATIC_ASSERT(0x20 == sizeof(dCcMassS_Obj));
+11 -1
View File
@@ -44,6 +44,16 @@ public:
virtual void MoveAfterCheck();
virtual void CalcParticleAngle(dCcD_GObjInf*, cCcD_Stts*, cCcD_Stts*, csXyz*);
#if DEBUG
void OnMassAllTimer() {
m_is_mass_all_timer = 1;
}
void OffMassAllTimer() {
m_is_mass_all_timer = 0;
}
#endif
void SetMass(cCcD_Obj* i_obj, u8 i_priority) { mMass_Mng.Set(i_obj, i_priority); }
void SetMassCam(cM3dGCps& i_cps) { mMass_Mng.SetCam(i_cps); }
u32 GetMassResultCam() { return mMass_Mng.GetResultCam(); }
@@ -70,7 +80,7 @@ public:
// /* 0x0000 */ cCcS mCCcS;
/* 0x284C */ dCcMassS_Mng mMass_Mng;
#if DEBUG
/* 0x2AD0 */ u8 field_0x2ad0;
/* 0x2AD0 */ u8 m_is_mass_all_timer;
#endif
}; // Size = 0x2AC4
+59 -1
View File
@@ -616,6 +616,7 @@ public:
void setItemMaxMagicCount(s16 max) { mItemInfo.mItemMaxMagicCount += max; }
s32 getItemOilCount() { return mItemInfo.mItemOilCount; }
void setItemOilCount(s32 oil) { mItemInfo.mItemOilCount += oil; }
void setItemMaxOilCount(s32 oil) { mItemInfo.mItemMaxOilCount += oil; }
void clearItemOilCount() { mItemInfo.mItemOilCount = 0; }
s32 getItemNowOil() { return mItemInfo.mItemNowOil; }
void setItemNowOil(s32 oil) { mItemInfo.mItemNowOil = oil; }
@@ -630,6 +631,7 @@ public:
s32 getOxygenCount() { return mItemInfo.mOxygenCount; }
void setOxygenCount(s32 oxygen) { mItemInfo.mOxygenCount += oxygen; }
void clearOxygenCount() { mItemInfo.mOxygenCount = 0; }
void setMaxOxygenCount(s32 oxygen) { mItemInfo.mMaxOxygenCount += oxygen; }
s32 getMaxOxygenCount() { return mItemInfo.mMaxOxygenCount; }
void clearMaxOxygenCount() { mItemInfo.mMaxOxygenCount = 0; }
s16 getItemArrowNumCount() { return mItemInfo.mItemArrowNumCount; }
@@ -1084,7 +1086,11 @@ s32 dComIfGs_isDungeonItemWarp(int i_stageNo);
void dComIfGs_BossLife_public_Set(s8);
s8 dComIfGs_sense_type_change_Get();
void dComIfGs_sense_type_change_Set(s8);
#if TARGET_PC
cXyz dComIfGs_getWarpPlayerPos();
#else
cXyz& dComIfGs_getWarpPlayerPos();
#endif
const char* dComIfGs_getWarpStageName();
s16 dComIfGs_getWarpPlayerAngleY();
s8 dComIfGs_getWarpRoomNo();
@@ -1174,7 +1180,11 @@ void dComIfGs_setWarpItemData(char const* stage, cXyz pos, s16 angle, s8 roomNo,
u8 param_5);
void dComIfGs_setLastWarpMarkItemData(const char* stage, cXyz pos, s16 angle, s8 roomNo, u8, u8);
const char* dComIfGs_getWarpStageName();
#if TARGET_PC
cXyz dComIfGs_getWarpPlayerPos();
#else
cXyz& dComIfGs_getWarpPlayerPos();
#endif
s16 dComIfGs_getWarpPlayerAngleY();
s8 dComIfGs_getWarpRoomNo();
u8 dComIfGs_getWarpMarkFlag();
@@ -1420,7 +1430,11 @@ inline BOOL dComIfGs_isTransformLV(int i_no) {
return g_dComIfG_gameInfo.info.getPlayer().getPlayerStatusB().isTransformLV(i_no);
}
#if TARGET_PC
inline cXyz dComIfGs_getHorseRestartPos() {
#else
inline cXyz& dComIfGs_getHorseRestartPos() {
#endif
return g_dComIfG_gameInfo.info.getPlayer().getHorsePlace().getPos();
}
@@ -1441,7 +1455,11 @@ inline void dComIfGs_setHorseRestart(const char* i_stageName, cXyz& i_pos, s16 i
g_dComIfG_gameInfo.info.getPlayer().getHorsePlace().set(i_stageName, i_pos, i_angle, i_roomNo);
}
#if TARGET_PC
inline cXyz dComIfGs_getPlayerFieldLastStayPos() {
#else
inline cXyz& dComIfGs_getPlayerFieldLastStayPos() {
#endif
return g_dComIfG_gameInfo.info.getPlayer().getPlayerFieldLastStayInfo().getPos();
}
@@ -1483,7 +1501,11 @@ inline void dComIfGs_setPlayerFieldLastStayInfo(const char* i_stage, cXyz& i_pos
i_point, i_region);
}
#if TARGET_PC
inline cXyz dComIfGs_getLastWarpMarkPlayerPos() {
#else
inline cXyz& dComIfGs_getLastWarpMarkPlayerPos() {
#endif
return g_dComIfG_gameInfo.info.getPlayer().getPlayerLastMarkInfo().getPos();
}
@@ -1676,6 +1698,10 @@ inline u8 dComIfGs_getBombMax(u8 i_bombType) {
return g_dComIfG_gameInfo.info.getPlayer().getItemMax().getBombNum(i_bombType);
}
inline void dComIfGs_setPohSpiritNum(u8 i_num) {
g_dComIfG_gameInfo.info.getPlayer().getCollect().setPohNum(i_num);
}
inline u8 dComIfGs_getPohSpiritNum() {
return g_dComIfG_gameInfo.info.getPlayer().getCollect().getPohNum();
}
@@ -1684,6 +1710,10 @@ inline void dComIfGs_addPohSpiritNum() {
g_dComIfG_gameInfo.info.getPlayer().getCollect().addPohNum();
}
inline BOOL dComIfGs_isCollectClothes(u8 i_clothesNo) {
return g_dComIfG_gameInfo.info.getPlayer().getCollect().isCollect(COLLECT_CLOTHING, i_clothesNo);
}
inline void dComIfGs_setCollectClothes(u8 i_clothesNo) {
g_dComIfG_gameInfo.info.getPlayer().getCollect().setCollect(COLLECT_CLOTHING, i_clothesNo);
}
@@ -1701,18 +1731,34 @@ inline BOOL dComIfGs_isCollectClothing(u8 i_clothesNo) {
i_clothesNo);
}
inline void dComIfGs_offCollectClothes(u8 i_clothesNo) {
g_dComIfG_gameInfo.info.getPlayer().getCollect().offCollect(COLLECT_CLOTHING, i_clothesNo);
}
inline BOOL dComIfGs_isCollectSword(u8 i_swordNo) {
return g_dComIfG_gameInfo.info.getPlayer().getCollect().isCollect(COLLECT_SWORD, i_swordNo);
}
inline void dComIfGs_offCollectSword(u8 i_swordNo) {
g_dComIfG_gameInfo.info.getPlayer().getCollect().offCollect(COLLECT_SWORD, i_swordNo);
}
inline BOOL dComIfGs_isCollectShield(u8 i_item) {
return g_dComIfG_gameInfo.info.getPlayer().getCollect().isCollect(COLLECT_SHIELD, i_item);
}
inline void dComIfGs_offCollectShield(u8 i_shieldNo) {
g_dComIfG_gameInfo.info.getPlayer().getCollect().offCollect(COLLECT_SHIELD, i_shieldNo);
}
inline void dComIfGs_onCollectCrystal(u8 i_item) {
g_dComIfG_gameInfo.info.getPlayer().getCollect().onCollectCrystal(i_item);
}
inline void dComIfGs_offCollectCrystal(u8 i_item) {
g_dComIfG_gameInfo.info.getPlayer().getCollect().offCollectCrystal(i_item);
}
inline bool dComIfGs_isCollectCrystal(u8 i_item) {
return g_dComIfG_gameInfo.info.getPlayer().getCollect().isCollectCrystal(i_item);
}
@@ -1721,6 +1767,10 @@ inline void dComIfGs_onCollectMirror(u8 i_item) {
g_dComIfG_gameInfo.info.getPlayer().getCollect().onCollectMirror(i_item);
}
inline void dComIfGs_offCollectMirror(u8 i_item) {
g_dComIfG_gameInfo.info.getPlayer().getCollect().offCollectMirror(i_item);
}
inline bool dComIfGs_isCollectMirror(u8 i_item) {
return g_dComIfG_gameInfo.info.getPlayer().getCollect().isCollectMirror(i_item);
}
@@ -3518,7 +3568,7 @@ inline u8 dComIfGp_getItemLifeCountType() {
return g_dComIfG_gameInfo.play.getItemLifeCountType();
}
inline void dComIfGp_setItemLifeCount(float amount, u8 type) {
inline void dComIfGp_setItemLifeCount(f32 amount, u8 type) {
g_dComIfG_gameInfo.play.setItemLifeCount(amount, type);
}
@@ -3582,6 +3632,10 @@ inline void dComIfGp_setItemOilCount(s32 oil) {
g_dComIfG_gameInfo.play.setItemOilCount(oil);
}
inline void dComIfGp_setItemMaxOilCount(s32 oil) {
g_dComIfG_gameInfo.play.setItemMaxOilCount(oil);
}
inline void dComIfGp_clearItemOilCount() {
g_dComIfG_gameInfo.play.clearItemOilCount();
}
@@ -3638,6 +3692,10 @@ inline void dComIfGp_clearOxygenCount() {
g_dComIfG_gameInfo.play.clearOxygenCount();
}
inline void dComIfGp_setMaxOxygenCount(s32 oxygen) {
g_dComIfG_gameInfo.play.setMaxOxygenCount(oxygen);
}
inline s32 dComIfGp_getMaxOxygenCount() {
return g_dComIfG_gameInfo.play.getMaxOxygenCount();
}
+1 -22
View File
@@ -340,27 +340,6 @@ public:
virtual JPABaseEmitter* emitter_create(u32);
};
namespace {
class jstudio_tAdaptor_message : public JStudio::TAdaptor_message {
public:
typedef JStudio::TObject_message ObjectType;
jstudio_tAdaptor_message() {}
virtual ~jstudio_tAdaptor_message();
virtual void adaptor_do_MESSAGE(JStudio::data::TEOperationData, const void*, u32);
};
class jstudio_tCreateObject_message : public JStudio::TCreateObject {
public:
jstudio_tCreateObject_message() {}
virtual ~jstudio_tCreateObject_message();
virtual bool create(JStudio::TObject**, const JStudio::stb::data::TParse_TBlock_object&);
};
}; // namespace
int dDemo_setDemoData(fopAc_ac_c*, u8, mDoExt_McaMorf*, char const*, int, u16*, u32, s8);
class dDemo_c {
@@ -409,7 +388,7 @@ public:
static JStudio_JStage::TCreateObject* m_stage;
static JStudio_JAudio2::TCreateObject* m_audio;
static dDemo_particle_c* m_particle;
static jstudio_tCreateObject_message* m_message;
static JStudio::TCreateObject* m_message;
static JStudio::TFactory* m_factory;
static jmessage_tControl* m_mesgControl;
static dDemo_object_c* m_object;
+6 -1
View File
@@ -33,7 +33,7 @@ public:
void offPassNum(int num) { field_0xc &= ~(1 << num); }
bool checkShieldType(int i) { return getType(i) == 3; }
s8 getType(int i) { return mData[i].mType; }
int getType(int i) { return mData[i].mType; }
int getJntNum(int i) { return (s16)mData[i].mJntNum; }
/* 0x00 */ const dJntColData_c* mData;
@@ -64,4 +64,9 @@ public:
};
#if DEBUG
void dJntCol_setDebugHIO();
void dJntCol_deleteDebugHIO();
#endif
#endif /* D_D_JNT_COL_H */
+1 -1
View File
@@ -190,7 +190,7 @@ public:
bool isPauseWindow() { return mPauseWindow != false; }
void onShowFlag() { mShowFlag |= 1; }
void offShowFlag() { mShowFlag &= ~1; }
bool isShowFlag() { return mShowFlag & 1 != 0; }
bool isShowFlag() { return (mShowFlag & 1) != 0; }
bool isFadeNowCheck() { return mDoGph_gInf_c::getFader()->getStatus() == 1; }
private:
+58 -50
View File
@@ -1,75 +1,83 @@
#ifndef D_MENU_D_MENU_WINDOW_HIO_H
#define D_MENU_D_MENU_WINDOW_HIO_H
#include <types.h>
#include "JSystem/JHostIO/JORReflexible.h"
class dMw_DHIO_c {
class dMw_DHIO_c : public JORReflexible {
public:
dMw_DHIO_c();
virtual ~dMw_DHIO_c() {}
void genMessage(JORMContext*);
void bitCheck();
/* 0x004 */ s8 field_0x4;
/* 0x005 */ bool mMap[32];
/* 0x025 */ bool mCompass[32];
/* 0x045 */ bool mBossKey[32];
/* 0x065 */ bool mBossClear[32];
/* 0x085 */ bool mHeartContainer[32];
/* 0x0A5 */ bool mBossDemo[32];
/* 0x0C5 */ bool mPortal[32];
/* 0x0E5 */ bool mMidBossClear[32];
/* 0x105 */ bool mMapCopy[32];
/* 0x125 */ bool mCompassCopy[32];
/* 0x145 */ bool mBossKeyCopy[32];
/* 0x165 */ bool mBossClearCopy[32];
/* 0x185 */ bool mHeartContainerCopy[32];
/* 0x1A5 */ bool mBossDemoCopy[32];
/* 0x1C5 */ bool mPortalCopy[32];
/* 0x1E5 */ bool mMidBossClearCopy[32];
/* 0x005 */ u8 mMap[32];
/* 0x025 */ u8 mCompass[32];
/* 0x045 */ u8 mBossKey[32];
/* 0x065 */ u8 mBossClear[32];
/* 0x085 */ u8 mHeartContainer[32];
/* 0x0A5 */ u8 mBossDemo[32];
/* 0x0C5 */ u8 mPortal[32];
/* 0x0E5 */ u8 mMidBossClear[32];
/* 0x105 */ u8 mMapCopy[32];
/* 0x125 */ u8 mCompassCopy[32];
/* 0x145 */ u8 mBossKeyCopy[32];
/* 0x165 */ u8 mBossClearCopy[32];
/* 0x185 */ u8 mHeartContainerCopy[32];
/* 0x1A5 */ u8 mBossDemoCopy[32];
/* 0x1C5 */ u8 mPortalCopy[32];
/* 0x1E5 */ u8 mMidBossClearCopy[32];
};
extern dMw_DHIO_c g_mwDHIO;
class dMw_HIO_c {
class dMw_HIO_c : public JORReflexible {
public:
dMw_HIO_c();
void init();
bool getBombFlag();
bool getArrowFlag();
bool getPachinkoFlag();
u8 getBombFlag();
u8 getArrowFlag();
u8 getPachinkoFlag();
void update();
void playerStatusHIO();
void itemBitCheck();
void itemNumHIO();
void itemHIO();
void setArrowFlag(u8 i_flag) { mArrowFlag = i_flag; }
void setPachinkoFlag(u8 i_flag) { mPachinkoFlag = i_flag; }
void setBombFlag(u8 i_flag) { mBombFlag = i_flag; }
virtual ~dMw_HIO_c() {}
void genMessage(JORMContext*);
/* 0x004 */ s8 field_0x4;
/* 0x006 */ u16 mLife;
/* 0x008 */ u16 mMaxLife;
/* 0x006 */ s16 mLife;
/* 0x008 */ s16 mMaxLife;
/* 0x00A */ u8 mMagic;
/* 0x00B */ u8 mMaxMagic;
/* 0x00C */ s32 mOil;
/* 0x010 */ s32 mMaxOil;
/* 0x014 */ s32 mOxygen;
/* 0x018 */ s32 mMaxOxygen;
/* 0x01C */ bool mEnableMagic;
/* 0x01D */ bool mEnableArrowDrops;
/* 0x01C */ u8 mEnableMagic;
/* 0x01D */ u8 mEnableArrowDrops;
/* 0x01E */ s16 mRupees;
/* 0x020 */ s16 mWalletSize;
/* 0x022 */ u8 mKeys;
/* 0x023 */ u8 field_0x23;
/* 0x024 */ u16 mLifeCopy;
/* 0x026 */ u16 mMaxLifeCopy;
/* 0x024 */ s16 mLifeCopy;
/* 0x026 */ s16 mMaxLifeCopy;
/* 0x028 */ u8 mMagicCopy;
/* 0x029 */ u8 mMaxMagicCopy;
/* 0x02C */ s32 mOilCopy;
/* 0x030 */ s32 mMaxOilCopy;
/* 0x034 */ s32 mOxygenCopy;
/* 0x038 */ s32 mMaxOxygenCopy;
/* 0x03C */ bool mEnableMagicCopy;
/* 0x03D */ bool mEnableArrowDropsCopy;
/* 0x03C */ u8 mEnableMagicCopy;
/* 0x03D */ u8 mEnableArrowDropsCopy;
/* 0x03E */ s16 mRupeesCopy;
/* 0x040 */ s16 mWalletSizeCopy;
/* 0x042 */ s16 mDonationAmount;
@@ -81,23 +89,23 @@ public:
/* 0x04A */ u8 mItems[24];
/* 0x062 */ u8 mItemsCopy[24];
/* 0x07A */ u8 field_0x7a[24];
/* 0x092 */ bool mSwords[4];
/* 0x096 */ bool mShields[3];
/* 0x099 */ bool mClothes[3];
/* 0x09C */ bool mSwordsCopy[4];
/* 0x0A0 */ bool mShieldsCopy[3];
/* 0x0A3 */ bool mClothesCopy[3];
/* 0x092 */ u8 mSwords[4];
/* 0x096 */ u8 mShields[3];
/* 0x099 */ u8 mClothes[3];
/* 0x09C */ u8 mSwordsCopy[4];
/* 0x0A0 */ u8 mShieldsCopy[3];
/* 0x0A3 */ u8 mClothesCopy[3];
/* 0x0A6 */ u8 mScent;
/* 0x0A7 */ u8 mScentCopy;
/* 0x0A8 */ u8 field_0xa8;
/* 0x0A9 */ bool mBombBagLV2;
/* 0x0AA */ bool mBombBagLV2Copy;
/* 0x0AB */ bool mLV2KeyShards[3];
/* 0x0AE */ bool mLV2KeyShardsCopy[3];
/* 0x0B1 */ bool mLV5Item[2];
/* 0x0B3 */ bool mLV5ItemCopy[2];
/* 0x0B5 */ bool mGoldBug[24];
/* 0x0CD */ bool mGoldBugCopy[24];
/* 0x0A9 */ u8 mBombBagLV2;
/* 0x0AA */ u8 mBombBagLV2Copy;
/* 0x0AB */ u8 mLV2KeyShards[3];
/* 0x0AE */ u8 mLV2KeyShardsCopy[3];
/* 0x0B1 */ u8 mLV5Item[2];
/* 0x0B3 */ u8 mLV5ItemCopy[2];
/* 0x0B5 */ u8 mGoldBug[24];
/* 0x0CD */ u8 mGoldBugCopy[24];
/* 0x0E5 */ u8 mArrowNum;
/* 0x0E6 */ u8 mSeedNum;
/* 0x0E7 */ u8 mBombNum[3];
@@ -112,15 +120,15 @@ public:
/* 0x101 */ u8 field_0x101[8];
/* 0x109 */ u8 field_0x109[8];
/* 0x111 */ u8 field_0x111[8];
/* 0x119 */ bool mEnableOxygenMeter;
/* 0x11A */ bool mEnableOxygenMeterCopy;
/* 0x119 */ u8 mEnableOxygenMeter;
/* 0x11A */ u8 mEnableOxygenMeterCopy;
/* 0x11B */ u8 mArrowFlag;
/* 0x11C */ u8 mPachinkoFlag;
/* 0x11D */ u8 mBombFlag;
/* 0x11E */ bool mFusedShadow[4];
/* 0x122 */ bool mFusedShadowCopy[4];
/* 0x126 */ bool mMirrorShard[4];
/* 0x12A */ bool mMirrorShardCopy[4];
/* 0x11E */ u8 mFusedShadow[4];
/* 0x122 */ u8 mFusedShadowCopy[4];
/* 0x126 */ u8 mMirrorShard[4];
/* 0x12A */ u8 mMirrorShardCopy[4];
}; // Size: 0x130
extern dMw_HIO_c g_mwHIO;
+5
View File
@@ -557,6 +557,11 @@ inline bool dMsgObject_isSelectTalkNowCheck() {
return dMsgObject_getMsgObjectClass()->getStatus() != 8 || (dMsgObject_getMsgObjectClass()->getStatus() != 9 && dMsgObject_getMsgObjectClass()->getStatus() != 20);
}
inline void dMsgObject_setOffering(u16 i_num) {
dComIfGs_setEventReg(0xF7FF, i_num >> 8);
dComIfGs_setEventReg(0xF8FF, i_num & 0xFF);
}
class dMsgObject_HowlHIO_c {
public:
dMsgObject_HowlHIO_c();
-3
View File
@@ -112,7 +112,4 @@ struct dMsgScrnHowl_c : public dMsgScrnBase_c {
/* 0x27A8 */ f32 field_0x27a8;
};
#define LINE_MAX 30
#define PLOT_BUFFER_MAX_e 0x300
#endif /* MSG_SCRN_D_MSG_SCRN_HOWL_H */
+27 -1
View File
@@ -219,13 +219,21 @@ public:
void init();
void set(const char* i_name, const cXyz& i_pos, s16 i_angle, s8 i_roomNo);
#if TARGET_PC
cXyz getPos() { return cXyz(mPos); }
#else
cXyz& getPos() { return mPos; }
#endif
s16 getAngleY() const { return mAngleY; }
const char* getStageName() const { return mName; }
s8 getRoomNo() const { return mRoomNo; }
private:
#if TARGET_PC
/* 0x00 */ BE(Vec) mPos;
#else
/* 0x00 */ cXyz mPos;
#endif
/* 0x0C */ BE(s16) mAngleY;
/* 0x0E */ char mName[8];
/* 0x16 */ u8 mSpawnId;
@@ -257,7 +265,11 @@ public:
void onRegionBit(int i_region);
void set(const char* i_name, const cXyz& i_pos, s16 i_angle, s8 i_spawn, u8 i_regionNo);
#if TARGET_PC
cXyz getPos() { return cXyz(mPos); }
#else
cXyz& getPos() { return mPos; }
#endif
s16 getAngleY() { return mAngleY; }
char* getName() { return mName; }
u8 getRegionNo() const { return mRegionNo; }
@@ -267,7 +279,11 @@ public:
private:
#if TARGET_PC
/* 0x00 */ BE(Vec) mPos;
#else
/* 0x00 */ cXyz mPos;
#endif
/* 0x0C */ BE(s16) mAngleY;
/* 0x0E */ char mName[8];
/* 0x16 */ s8 mLastSpawnId;
@@ -284,7 +300,11 @@ public:
void init();
void setWarpItemData(const char* i_name, const cXyz& i_pos, s16 i_angle, s8 i_roomNo, u8, u8);
#if TARGET_PC
cXyz getPos() { return cXyz(mPos); }
#else
cXyz& getPos() { return mPos; }
#endif
s16 getAngleY() const { return mAngleY; }
const char* getName() { return mName; }
s8 getRoomNo() const { return mRoomNo; }
@@ -293,7 +313,11 @@ public:
void resetWarpAcceptStage() { mWarpAcceptStage = -1; }
private:
#if TARGET_PC
/* 0x00 */ BE(Vec) mPos;
#else
/* 0x00 */ cXyz mPos;
#endif
/* 0x0C */ BE(s16) mAngleY;
/* 0x0E */ char mName[8];
/* 0x16 */ u8 mSpawnId;
@@ -396,12 +420,14 @@ public:
void offCollectMirror(u8 i_item);
BOOL isCollectMirror(u8 i_item) const;
void setPohNum(u8 i_num) { mPohNum = i_num; }
u8 getPohNum() const { return mPohNum; }
void addPohNum() {
if (mPohNum < 0xFF) {
mPohNum++;
}
};
}
private:
/* 0x0 */ u8 mItem[8];
+9 -9
View File
@@ -437,11 +437,11 @@ inline void fopAcM_SetAngle(fopAc_ac_c* i_actor, s16 x, s16 y, s16 z) {
i_actor->current.angle.set(x, y, z);
}
inline void dComIfGs_onSwitch(int i_no, int i_roomNo);
inline void dComIfGs_offSwitch(int i_no, int i_roomNo);
inline void dComIfGs_revSwitch(int i_no, int i_roomNo);
inline BOOL dComIfGs_isSwitch(int i_no, int i_roomNo);
inline void dComIfGs_offActor(int i_no, int i_roomNo);
void dComIfGs_onSwitch(int i_no, int i_roomNo);
void dComIfGs_offSwitch(int i_no, int i_roomNo);
void dComIfGs_revSwitch(int i_no, int i_roomNo);
BOOL dComIfGs_isSwitch(int i_no, int i_roomNo);
void dComIfGs_offActor(int i_no, int i_roomNo);
inline void fopAcM_onSwitch(const fopAc_ac_c* i_actor, int sw) {
return dComIfGs_onSwitch(sw, fopAcM_GetHomeRoomNo(i_actor));
@@ -463,12 +463,12 @@ inline fopAc_ac_c* fopAcM_SearchByName(s16 proc_id) {
return (fopAc_ac_c*)fopAcIt_Judge(fpcSch_JudgeForPName, &proc_id);
}
inline void dComIfGs_onItem(int bitNo, int roomNo);
void dComIfGs_onItem(int bitNo, int roomNo);
inline void fopAcM_onItem(const fopAc_ac_c* item, int bitNo) {
dComIfGs_onItem(bitNo, fopAcM_GetHomeRoomNo(item));
}
inline bool dComIfGs_isItem(int bitNo, int roomNo);
bool dComIfGs_isItem(int bitNo, int roomNo);
inline bool fopAcM_isItem(const fopAc_ac_c* item, int bitNo) {
return dComIfGs_isItem(bitNo, fopAcM_GetHomeRoomNo(item));
}
@@ -481,7 +481,7 @@ inline int fopAcM_GetSetId(const fopAc_ac_c* i_actor) {
return i_actor->setID;
}
inline void dComIfGs_onActor(int bitNo, int roomNo);
void dComIfGs_onActor(int bitNo, int roomNo);
inline void fopAcM_onActor(const fopAc_ac_c* i_actor) {
dComIfGs_onActor(fopAcM_GetSetId(i_actor), fopAcM_GetHomeRoomNo(i_actor));
@@ -716,7 +716,7 @@ inline void make_prm_warp_hole(u32* o_params, u8 prm1, u8 prm2, u8 prm3) {
*o_params = pprm2 | pprm3 | pprm1;
}
inline fopAc_ac_c* dComIfGp_getPlayer(int);
fopAc_ac_c* dComIfGp_getPlayer(int);
inline s16 fopAcM_searchPlayerAngleY(const fopAc_ac_c* actor) {
return fopAcM_searchActorAngleY(actor, dComIfGp_getPlayer(0));
+12 -1
View File
@@ -133,7 +133,7 @@ static const float INF = 2000000000.0f;
#define NO_INLINE
#endif
#endif
// Hack to trick the compiler into not inlining functions that use this macro.
#define FORCE_DONT_INLINE \
(void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; \
@@ -203,6 +203,17 @@ static const float INF = 2000000000.0f;
using std::isnan;
#endif
// Comparing a non-volatile reference type to NULL is tautological
// and triggers a warning on modern compilers, but in some cases is
// required to match the original assembly.
#if defined(__MWERKS__) || defined(DECOMPCTX)
#define IS_REF_NULL(r) (&(r) == NULL)
#define IS_REF_NONNULL(r) (&(r) != NULL)
#else
#define IS_REF_NULL(r) (0)
#define IS_REF_NONNULL(r) (1)
#endif
#define CRASH(msg, ...) OSPanic(__FILE__, __LINE__, msg, __VA_ARGS__)
#endif
@@ -650,13 +650,13 @@ public:
*/
class J3DAnmCluster : public J3DAnmBase {
public:
J3DAnmCluster(s16 frameMax, f32* pWeight) : J3DAnmBase(frameMax) { mWeight = pWeight; }
J3DAnmCluster(s16 frameMax, BE(f32)* pWeight) : J3DAnmBase(frameMax) { mWeight = pWeight; }
virtual ~J3DAnmCluster() {}
virtual s32 getKind() const { return 3; }
virtual f32 getWeight(u16) const { return 1.0f; }
/* 0x0C */ f32* mWeight;
/* 0x0C */ BE(f32)* mWeight;
}; // Size: 0x10
/**
@@ -108,8 +108,8 @@ public:
J3D_ASSERT_RANGE(199, (i < mClusterKeyNum));
return &mClusterKeyPointer[i];
}
f32* getVtxPos() { return mVtxPos; }
f32* getVtxNrm() { return mVtxNrm; }
BE(f32)* getVtxPos() { return mVtxPos; }
BE(f32)* getVtxNrm() { return mVtxNrm; }
/* 0x00 */ u16 mClusterNum;
/* 0x02 */ u16 mClusterKeyNum;
@@ -119,8 +119,8 @@ public:
/* 0x10 */ J3DClusterVertex* mClusterVertex;
/* 0x14 */ u16 mVtxPosNum;
/* 0x16 */ u16 mVtxNrmNum;
/* 0x18 */ f32* mVtxPos;
/* 0x1C */ f32* mVtxNrm;
/* 0x18 */ BE(f32)* mVtxPos;
/* 0x1C */ BE(f32)* mVtxNrm;
/* 0x20 */ JUTNameTab* mClusterName;
/* 0x24 */ JUTNameTab* mClusterKeyName;
@@ -3,6 +3,8 @@
#include "JSystem/J3DGraphAnimator/J3DAnimation.h"
class J3DMaterial;
/**
* @ingroup jsystem-j3d
*
@@ -116,7 +116,13 @@ public:
// same logic but without the bug.
// See J3DMaterialFactory::newColorChan - both the bugged and correct behavior are present there, as it calls
// both constructors.
#if TARGET_PC
// The faulty comparison is EXTREMELY noisy in the build due to warnings being emitted for
// every TU that includes it - best to just remove it since it doesn't do anything anyway.
u32 ambSrc = info.mAmbSrc;
#else
u32 ambSrc = info.mAmbSrc == 0xFFFF ? 0 : info.mAmbSrc;
#endif
mColorChanID = calcColorChanID(info.mEnable, info.mMatSrc, info.mLightMask,
info.mDiffuseFn, info.mAttnFn, ambSrc);
}
@@ -99,7 +99,12 @@ public:
static JHIComPortManager<T>* getInstance() { return instance; }
#ifdef __MWERKS__
static JHIComPortManager<T>* instance;
#else
// C++17 allows in-class instantiation
static inline JHIComPortManager<T>* instance = nullptr;
#endif
/* 0x00000 */ T port;
/* 0x0000C */ JHIpvector<JHITag<T>*, 10> field_0xc;
@@ -104,8 +104,8 @@ void J3DDeformer::deform_VtxPosF32(J3DVertexBuffer* i_buffer, J3DCluster* i_clus
int posNum = i_cluster->mPosNum;
int keyNum = i_cluster->mKeyNum;
f32* vtxPosArray = (f32*)i_buffer->getVtxPosArrayPointer(0);
f32* deformVtxPos = mDeformData->getVtxPos();
u16* iVar9 = CALC_OFFSET(i_cluster->field_0x18, u16, mBlockBase);
BE(f32)* deformVtxPos = mDeformData->getVtxPos();
BE(u16)* iVar9 = CALC_OFFSET(i_cluster->field_0x18, BE(u16), mBlockBase);
for (int i = 0; i < posNum; i++) {
int index = iVar9[i] * 3;
@@ -117,12 +117,12 @@ void J3DDeformer::deform_VtxPosF32(J3DVertexBuffer* i_buffer, J3DCluster* i_clus
f32 local_58[2] = {1.0f, -1.0f};
for (u16 i = 0; i < posNum; i++) {
int index = CALC_OFFSET(i_cluster->field_0x18, u16, mBlockBase)[i] * 3;
int index = CALC_OFFSET(i_cluster->field_0x18, BE(u16), mBlockBase)[i] * 3;
for (u16 j = 0; j < keyNum; j++) {
int uVar8;
int uVar7;
key = &i_key[j];
uVar8 = uVar7 = CALC_OFFSET(key->field_0x4, u16, mBlockBase)[i];
uVar8 = uVar7 = CALC_OFFSET(key->field_0x4, BE(u16), mBlockBase)[i];
uVar7 &= ~0xE000;
uVar7 *= 3;
f32 deform0 = deformVtxPos[uVar7];
@@ -142,7 +142,7 @@ void J3DDeformer::deform_VtxPosF32(J3DVertexBuffer* i_buffer, J3DCluster* i_clus
void J3DDeformer::deform_VtxNrmF32(J3DVertexBuffer* i_buffer, J3DCluster* i_cluster,
J3DClusterKey* i_key, f32* i_weights) {
f32* vtxNrmArray = (f32*)i_buffer->getVtxNrmArrayPointer(0);
f32* deformVtxNrm = mDeformData->getVtxNrm();
BE(f32)* deformVtxNrm = mDeformData->getVtxNrm();
f32* iVar13 = field_0xc;
u16 keyNum = i_cluster->mKeyNum;
int uVar2 = i_cluster->field_0x16;
@@ -154,7 +154,7 @@ void J3DDeformer::deform_VtxNrmF32(J3DVertexBuffer* i_buffer, J3DCluster* i_clus
iVar13[index + 2] = 0.0f;
for (u16 j = 0; j < keyNum; j++) {
J3DClusterKey* key = &i_key[j];
int uVar3 = CALC_OFFSET(key->field_0x8, u16, mBlockBase)[i];
int uVar3 = CALC_OFFSET(key->field_0x8, BE(u16), mBlockBase)[i];
int uVar4 = uVar3;
uVar3 &= ~0xE000;
uVar3 *= 3;
@@ -189,7 +189,7 @@ void J3DDeformer::deform_VtxNrmF32(J3DVertexBuffer* i_buffer, J3DCluster* i_clus
vec.z = 0.0f;
f32 scale = 1.0f / clusterVtx->mNum;
for (u16 j = 0; j < clusterVtx->mNum; j++) {
int index = CALC_OFFSET(clusterVtx->field_0x4, u16, mBlockBase)[j] * 3;
int index = CALC_OFFSET(clusterVtx->field_0x4, BE(u16), mBlockBase)[j] * 3;
vec.x += scale * iVar13[index];
vec.y += scale * iVar13[index + 1];
vec.z += scale * iVar13[index + 2];
@@ -197,12 +197,12 @@ void J3DDeformer::deform_VtxNrmF32(J3DVertexBuffer* i_buffer, J3DCluster* i_clus
normalize((f32*)&vec);
for (u16 j = 0; j < clusterVtx->mNum; j++) {
u16 tmp = CALC_OFFSET(clusterVtx->field_0x8, u16, mBlockBase)[j];
u16 tmp = CALC_OFFSET(clusterVtx->field_0x8, BE(u16), mBlockBase)[j];
if (tmp == 0xffff) {
continue;
}
int index = tmp * 3;
u16 iVar4 = CALC_OFFSET(clusterVtx->field_0x4, u16, mBlockBase)[j];
u16 iVar4 = CALC_OFFSET(clusterVtx->field_0x4, BE(u16), mBlockBase)[j];
int index2 = iVar4 * 3;
f32 dot = vec.x * iVar13[index2] + vec.y * iVar13[index2 + 1]
@@ -354,7 +354,7 @@ void J3DAnmFullLoader_v15::setAnmCluster(J3DAnmClusterFull* param_1,
param_1->mFrame = 0.0f;
param_1->mAnmTable =
JSUConvertOffsetToPtr<J3DAnmClusterFullTable>(param_2, param_2->mTableOffset);
param_1->mWeight = JSUConvertOffsetToPtr<f32>(param_2, param_2->mWeightOffset);
param_1->mWeight = JSUConvertOffsetToPtr<BE(f32)>(param_2, param_2->mWeightOffset);
}
void J3DAnmFullLoader_v15::readAnmVtxColor(const J3DAnmVtxColorFullData* param_1) {
@@ -618,7 +618,7 @@ void J3DAnmKeyLoader_v15::setAnmCluster(J3DAnmClusterKey* param_1,
param_1->mFrame = 0.0f;
param_1->mAnmTable =
JSUConvertOffsetToPtr<J3DAnmClusterKeyTable>(param_2, param_2->mTableOffset);
param_1->mWeight = JSUConvertOffsetToPtr<f32>(param_2, param_2->mWeightOffset);
param_1->mWeight = JSUConvertOffsetToPtr<BE(f32)>(param_2, param_2->mWeightOffset);
}
@@ -56,21 +56,21 @@ void J3DClusterLoader_v15::readCluster(const J3DClusterBlock* block) {
mpDeformData->mVtxNrmNum = block->mVtxNrmNum;
mpDeformData->mClusterVertexNum = block->mClusterVertexNum;
if (block->mClusterName != NULL) {
if ((uintptr_t)block->mClusterName != (uintptr_t)NULL) {
mpDeformData->mClusterName =
JKR_NEW JUTNameTab(JSUConvertOffsetToPtr<ResNTAB>(block, block->mClusterName));
} else {
mpDeformData->mClusterName = NULL;
}
if (block->mClusterKeyName != NULL) {
if ((uintptr_t)block->mClusterKeyName != (uintptr_t)NULL) {
mpDeformData->mClusterKeyName =
JKR_NEW JUTNameTab(JSUConvertOffsetToPtr<ResNTAB>(block, block->mClusterKeyName));
} else {
mpDeformData->mClusterKeyName = NULL;
}
mpDeformData->mVtxPos = JSUConvertOffsetToPtr<f32>(block, block->mVtxPos);
mpDeformData->mVtxNrm = JSUConvertOffsetToPtr<f32>(block, block->mVtxNrm);
mpDeformData->mVtxPos = JSUConvertOffsetToPtr<BE(f32)>(block, block->mVtxPos);
mpDeformData->mVtxNrm = JSUConvertOffsetToPtr<BE(f32)>(block, block->mVtxNrm);
intptr_t clusterPointer = (intptr_t) block->mClusterPointer;
int clusterKeyPointerSize = (intptr_t)block->mClusterKeyPointer - (intptr_t)block->mClusterPointer;
@@ -14,7 +14,7 @@ J3DMaterialFactory::J3DMaterialFactory(J3DMaterialBlock const& i_block) {
mMaterialNum = i_block.mMaterialNum;
mpMaterialInitData = JSUConvertOffsetToPtr<J3DMaterialInitData>(&i_block, i_block.mpMaterialInitData);
mpMaterialID = JSUConvertOffsetToPtr<BE(u16)>(&i_block, i_block.mpMaterialID);
if (i_block.mpIndInitData != NULL && (uintptr_t)i_block.mpIndInitData - (uintptr_t)i_block.mpNameTable > 4) {
if (i_block.mpIndInitData != (uintptr_t)NULL && (uintptr_t)i_block.mpIndInitData - (uintptr_t)i_block.mpNameTable > 4) {
mpIndInitData = JSUConvertOffsetToPtr<J3DIndInitData>(&i_block, i_block.mpIndInitData);
} else {
mpIndInitData = NULL;
@@ -399,13 +399,13 @@ void J3DModelLoader::readVertex(J3DVertexBlock const* i_block) {
if (vertex_data.mVtxTexCoordArray[0] == NULL) {
vertex_data.mTexCoordNum = 0;
return;
}
if (local_28) {
vertex_data.mTexCoordNum = (local_28 - (uintptr_t)vertex_data.mVtxTexCoordArray[0]) / 8 + 1;
} else {
vertex_data.mTexCoordNum =
(i_block->mBlockSize - (uintptr_t)i_block->mpVtxTexCoordArray[0]) / 8 + 1;
if (local_28) {
vertex_data.mTexCoordNum = (local_28 - (uintptr_t)vertex_data.mVtxTexCoordArray[0]) / 8 + 1;
} else {
vertex_data.mTexCoordNum =
(i_block->mBlockSize - (uintptr_t)i_block->mpVtxTexCoordArray[0]) / 8 + 1;
}
}
#if TARGET_PC
@@ -603,7 +603,7 @@ void J3DModelLoader::readJoint(J3DJointBlock const* i_block) {
J3D_ASSERT_NULLPTR(781, i_block);
J3DJointFactory factory(*i_block);
mpModelData->getJointTree().mJointNum = i_block->mJointNum;
if (i_block->mpNameTable != NULL) {
if (i_block->mpNameTable != (uintptr_t)NULL) {
mpModelData->getJointTree().mJointName =
JKR_NEW JUTNameTab(JSUConvertOffsetToPtr<ResNTAB>(i_block, i_block->mpNameTable));
J3D_ASSERT_ALLOCMEM(791, mpModelData->getJointTree().mJointName);
@@ -623,7 +623,7 @@ void J3DModelLoader_v26::readMaterial(J3DMaterialBlock const* i_block, u32 i_fla
J3DMaterialFactory factory(*i_block);
mpMaterialTable->mMaterialNum = i_block->mMaterialNum;
mpMaterialTable->mUniqueMatNum = factory.countUniqueMaterials();
if (i_block->mpNameTable != NULL) {
if (i_block->mpNameTable != (uintptr_t)NULL) {
mpMaterialTable->mMaterialName =
JKR_NEW JUTNameTab(JSUConvertOffsetToPtr<ResNTAB>(i_block, i_block->mpNameTable));
J3D_ASSERT_ALLOCMEM(832, mpMaterialTable->mMaterialName);
@@ -669,7 +669,7 @@ void J3DModelLoader_v21::readMaterial_v21(J3DMaterialBlock_v21 const* i_block, u
J3DMaterialFactory_v21 factory(*i_block);
mpMaterialTable->mMaterialNum = i_block->mMaterialNum;
mpMaterialTable->mUniqueMatNum = factory.countUniqueMaterials();
if (i_block->mpNameTable != NULL) {
if (i_block->mpNameTable != (uintptr_t)NULL) {
mpMaterialTable->mMaterialName =
JKR_NEW JUTNameTab(JSUConvertOffsetToPtr<ResNTAB>(i_block, i_block->mpNameTable));
J3D_ASSERT_ALLOCMEM(930, mpMaterialTable->mMaterialName);
@@ -713,7 +713,7 @@ void J3DModelLoader::readShape(J3DShapeBlock const* i_block, u32 i_flags) {
J3DShapeTable* shape_table = mpModelData->getShapeTable();
J3DShapeFactory factory(*i_block);
shape_table->mShapeNum = i_block->mShapeNum;
if (i_block->mpNameTable != NULL) {
if (i_block->mpNameTable != (uintptr_t)NULL) {
shape_table->mShapeName =
JKR_NEW JUTNameTab(JSUConvertOffsetToPtr<ResNTAB>(i_block, i_block->mpNameTable));
J3D_ASSERT_ALLOCMEM(1026, shape_table->mShapeName);
@@ -738,7 +738,7 @@ void J3DModelLoader::readTexture(J3DTextureBlock const* i_block) {
J3D_ASSERT_NULLPTR(1067, i_block);
u16 texture_num = i_block->mTextureNum;
ResTIMG* texture_res = JSUConvertOffsetToPtr<ResTIMG>(i_block, i_block->mpTextureRes);
if (i_block->mpNameTable != NULL) {
if (i_block->mpNameTable != (uintptr_t)NULL) {
mpMaterialTable->mTextureName =
JKR_NEW JUTNameTab(JSUConvertOffsetToPtr<ResNTAB>(i_block, i_block->mpNameTable));
J3D_ASSERT_ALLOCMEM(1077, mpMaterialTable->mTextureName);
@@ -753,7 +753,7 @@ void J3DModelLoader_v26::readMaterialTable(J3DMaterialBlock const* i_block, u32
J3D_ASSERT_NULLPTR(1101, i_block);
J3DMaterialFactory factory(*i_block);
mpMaterialTable->mMaterialNum = i_block->mMaterialNum;
if (i_block->mpNameTable != NULL) {
if (i_block->mpNameTable != (uintptr_t)NULL) {
mpMaterialTable->mMaterialName =
JKR_NEW JUTNameTab(JSUConvertOffsetToPtr<ResNTAB>(i_block, i_block->mpNameTable));
J3D_ASSERT_ALLOCMEM(1114, mpMaterialTable->mMaterialName);
@@ -776,7 +776,7 @@ void J3DModelLoader_v21::readMaterialTable_v21(J3DMaterialBlock_v21 const* i_blo
J3D_ASSERT_NULLPTR(1152, i_block);
J3DMaterialFactory_v21 factory(*i_block);
mpMaterialTable->mMaterialNum = i_block->mMaterialNum;
if (i_block->mpNameTable != NULL) {
if (i_block->mpNameTable != (uintptr_t)NULL) {
mpMaterialTable->mMaterialName =
JKR_NEW JUTNameTab(JSUConvertOffsetToPtr<ResNTAB>(i_block, i_block->mpNameTable));
J3D_ASSERT_ALLOCMEM(1165, mpMaterialTable->mMaterialName);
@@ -799,7 +799,7 @@ void J3DModelLoader::readTextureTable(J3DTextureBlock const* i_block) {
J3D_ASSERT_NULLPTR(1200, i_block);
u16 texture_num = i_block->mTextureNum;
ResTIMG* texture_res = JSUConvertOffsetToPtr<ResTIMG>(i_block, i_block->mpTextureRes);
if (i_block->mpNameTable != NULL) {
if (i_block->mpNameTable != (uintptr_t)NULL) {
mpMaterialTable->mTextureName =
JKR_NEW JUTNameTab(JSUConvertOffsetToPtr<ResNTAB>(i_block, i_block->mpNameTable));
J3D_ASSERT_ALLOCMEM(1211, mpMaterialTable->mTextureName);
@@ -815,7 +815,7 @@ void J3DModelLoader::readPatchedMaterial(J3DMaterialBlock const* i_block, u32 i_
J3DMaterialFactory factory(*i_block);
mpMaterialTable->mMaterialNum = i_block->mMaterialNum;
mpMaterialTable->mUniqueMatNum = factory.countUniqueMaterials();
if (i_block->mpNameTable != NULL) {
if (i_block->mpNameTable != (uintptr_t)NULL) {
mpMaterialTable->mMaterialName =
JKR_NEW JUTNameTab(JSUConvertOffsetToPtr<ResNTAB>(i_block, i_block->mpNameTable));
J3D_ASSERT_ALLOCMEM(1251, mpMaterialTable->mMaterialName);
@@ -841,7 +841,7 @@ void J3DModelLoader::readMaterialDL(J3DMaterialDLBlock const* i_block, u32 i_fla
mpMaterialTable->field_0x1c = 1;
mpMaterialTable->mMaterialNum = i_block->mMaterialNum;
mpMaterialTable->mUniqueMatNum = i_block->mMaterialNum;
if (i_block->mpNameTable != NULL) {
if (i_block->mpNameTable != (uintptr_t)NULL) {
mpMaterialTable->mMaterialName =
JKR_NEW JUTNameTab(JSUConvertOffsetToPtr<ResNTAB>(i_block, i_block->mpNameTable));
J3D_ASSERT_ALLOCMEM(1312, mpMaterialTable->mMaterialName);
@@ -222,7 +222,7 @@ u32 J3DModelLoader_v26::calcSizeMaterial(const J3DMaterialBlock* block, u32 flag
J3DMaterialFactory factory(*block);
u32 count = block->mMaterialNum;
int uniqueCount = factory.countUniqueMaterials();
if (block->mpNameTable != NULL) {
if (block->mpNameTable != (uintptr_t)NULL) {
size += 0x10;
}
size += (count * sizeof(J3DMaterial*));
+1 -1
View File
@@ -472,7 +472,7 @@ void JASAramStream::updateChannel(u32 i_callbackType, JASChannel* i_channel,
mChannelUpdateFlags |= CHANNEL_UPDATE_LOOP_START;
#if !TARGET_PC // The variable assigned here is never used.
if (field_0x0c4 < 0xffffffff) {
field_0x0c4++;
field_0x0c4 += 1;
}
#endif
mEndSetup = false;
+1 -1
View File
@@ -96,7 +96,7 @@ void* JASAudioThread::run() {
case AUDIOMSG_DSP:
JUT_ASSERT(125, snIntCount != 0);
snIntCount--;
snIntCount -= 1;
if (snIntCount == 0) {
JASProbe::stop(7);
JASDriver::finishDSPFrame();
+1 -1
View File
@@ -21,7 +21,7 @@ bool JASBasicBank::getInstParam(int prg_no, int param_1, int param_2,
JASInstParam* o_param) const {
JASInst* inst = getInst(prg_no);
if (inst == NULL) {
return NULL;
return false;
}
return inst->getParam(param_1, param_2, o_param);
}
+1 -1
View File
@@ -5,7 +5,7 @@
#include <limits>
void JASCalc::imixcopy(const s16* s1, const s16* s2, s16* dst, u32 n) {
for (n; n != 0; n--) {
for (; n != 0; n--) {
*dst++ = *(s1)++;
*dst++ = *(s2)++;
}
+1 -1
View File
@@ -295,7 +295,7 @@ u32 JASSeqParser::readReg(JASTrack* param_0, u32 param_1) const {
case 0x6a:
result = param_0->getReleasePrio();
// @bug this should have been <<=
result << 8;
(void)(result << 8);
result |= param_0->getNoteOnPrio();
break;
case 0x6b:
@@ -15,6 +15,11 @@ void JAUSoundTable::init(void const* param_0) {
}
u8 JAUSoundTable::getTypeID(JAISoundID param_0) const {
#if DUSK_AUDIO_DISABLED
if (this == NULL) {
return 0xff;
}
#endif
if (param_0.isAnonymous()) {
return 0xff;
}
@@ -30,6 +35,11 @@ u8 JAUSoundTable::getTypeID(JAISoundID param_0) const {
}
JAUSoundTableItem* JAUSoundTable::getData(JAISoundID param_0) const {
#if DUSK_AUDIO_DISABLED
if (this == NULL) {
return NULL;
}
#endif
if (param_0.isAnonymous()) {
return NULL;
}
@@ -227,10 +227,6 @@ void JFWDisplay::endGX() {
}
void JFWDisplay::beginRender() {
#if TARGET_PC
aurora_begin_frame();
#endif
if (field_0x40) {
JUTProcBar::getManager()->wholeLoopEnd();
}
@@ -342,10 +338,6 @@ void JFWDisplay::endFrame() {
JUTProcBar::getManager()->setCostFrame(retrace_cnt - prevFrame);
prevFrame = retrace_cnt;
}
#if TARGET_PC
aurora_end_frame();
#endif
}
void JFWDisplay::waitBlanking(int param_0) {
+3 -3
View File
@@ -1260,7 +1260,7 @@ JPABaseShape::JPABaseShape(u8 const* pData, JKRHeap* pHeap) {
}
if (isTexAnm()) {
JUT_ASSERT(1698, pBsd->texAnmKeyNum != NULL);
JUT_ASSERT(1698, pBsd->texAnmKeyNum != 0);
u32 offs = sizeof(JPABaseShapeData);
if (isTexCrdAnm()) {
offs += 0x28;
@@ -1271,7 +1271,7 @@ JPABaseShape::JPABaseShape(u8 const* pData, JKRHeap* pHeap) {
}
if (isPrmAnm()) {
JUT_ASSERT(1707, pBsd->prmAnmKeyNum != NULL);
JUT_ASSERT(1707, pBsd->prmAnmKeyNum != 0);
JPAClrAnmKeyData* anmKeyData = (JPAClrAnmKeyData*)(pData + pBsd->mClrPrmAnmOffset);
makeColorTable(&mpPrmClrAnmTbl, anmKeyData,
pBsd->prmAnmKeyNum, pBsd->mClrAnmFrmMax, pHeap);
@@ -1280,7 +1280,7 @@ JPABaseShape::JPABaseShape(u8 const* pData, JKRHeap* pHeap) {
}
if (isEnvAnm()) {
JUT_ASSERT(1716, pBsd->envAnmKeyNum != NULL);
JUT_ASSERT(1716, pBsd->envAnmKeyNum != 0);
JPAClrAnmKeyData* anmKeyData = (JPAClrAnmKeyData*)(pData + pBsd->mClrEnvAnmOffset);
makeColorTable(&mpEnvClrAnmTbl, anmKeyData,
pBsd->envAnmKeyNum, pBsd->mClrAnmFrmMax, pHeap);
@@ -2,6 +2,8 @@
#include "JSystem/JStudio/JStudio/jstudio-object.h"
#include "dusk/audio.h"
namespace JStudio {
namespace {
@@ -1103,6 +1105,8 @@ u32 const JStudio::TAdaptor_sound::sauVariableValue_3_POSITION_XYZ[3] = {
};
void JStudio::TObject_sound::do_paragraph(u32 param_1, void const* param_2, u32 param_3) {
DUSK_AUDIO_SKIP()
TAdaptor* adaptor = getAdaptor();
TControl* control;
if (adaptor == NULL) {
@@ -37,7 +37,7 @@ bool JStudio_JStage::TCreateObject::create(
eObject = JStage::OBJECT_FOG;
break;
default:
return NULL;
return false;
}
JUT_ASSERT(99, pfnCreateObject!=NULL);
JUT_ASSERT(100, eObject!=JStage::OBJECT_UNDEFINED);
+1 -1
View File
@@ -181,7 +181,7 @@ void JUTConsole::doDraw(JUTConsole::EConsoleType consoleType) const {
mFont->drawString_scale((int)f31, sp94, mFontSizeX, mFontSizeY,
mVisible ? "[ON]" : "[OFF]", TRUE);
f31 += (int)(mFontSizeX * 6.0f);
if (this == NULL) // ????
if (IS_REF_NULL(*this)) // ????
{
mFont->setCharColor(JUtility::TColor(0xff, 0xff, 0x64, 0xff));
mFont->drawString_scale((int)(f31 - mFontSizeX), mFontSizeX, mFontSizeY, sp94,
+1 -1
View File
@@ -949,7 +949,7 @@ bool JUTException::queryMapAddress_single(char* mapPath, u32 address, s32 sectio
dst--;
i--;
}
(void)*src; // needed to match debug
UNUSED(*src); // needed to match debug
*dst = 0;
if (print) {
if (begin_with_newline) {
+13 -1
View File
@@ -25,12 +25,18 @@ void JUTFader::control() {
if (mStatus == 1) {
return;
}
switch (mStatus) {
case 0:
mColor.a = 0xFF;
break;
case 2:
#if AVOID_UB
if (field_0x8 == 0) {
mStatus = 1;
break;
}
#endif
mColor.a = 0xFF - ((++field_0xa * 0xFF) / field_0x8);
if (field_0xa >= field_0x8) {
@@ -39,6 +45,12 @@ void JUTFader::control() {
break;
case 3:
#if AVOID_UB
if (field_0x8 == 0) {
mStatus = 0;
break;
}
#endif
mColor.a = ((++field_0xa * 0xFF) / field_0x8);
if (field_0xa >= field_0x8) {
+27 -1
View File
@@ -5,6 +5,12 @@
#include "SSystem/SComponent/c_bg_s_gnd_chk.h"
#include "f_pc/f_pc_manager.h"
#include "JSystem/JUtility/JUTAssert.h"
#define CHECK_FLOAT_CLASS(line, x) JUT_ASSERT(line, !isnan(x));
#define CHECK_FLOAT_RANGE(line, x) JUT_ASSERT(line, -INF < x && x < INF);
#define CHECK_FLOAT_MIN(line, x) JUT_ASSERT(line, -INF < x);
#define CHECK_FLOAT_MAX(line, x) JUT_ASSERT(line, x < INF);
cBgS_GndChk::cBgS_GndChk() {
m_pos = cXyz::Zero;
@@ -15,11 +21,31 @@ cBgS_GndChk::cBgS_GndChk() {
cBgS_GndChk::~cBgS_GndChk() {}
void cBgS_GndChk::SetPos(Vec const* pos) {
m_pos = *pos;
m_pos.x = pos->x;
m_pos.y = pos->y;
m_pos.z = pos->z;
CHECK_FLOAT_CLASS(37, m_pos.x);
CHECK_FLOAT_CLASS(38, m_pos.y);
CHECK_FLOAT_CLASS(39, m_pos.z);
CHECK_FLOAT_RANGE(43, m_pos.x);
CHECK_FLOAT_MIN(44, m_pos.y);
CHECK_FLOAT_MAX(45, m_pos.y);
CHECK_FLOAT_RANGE(46, m_pos.z);
}
void cBgS_GndChk::SetPos(cXyz const* pos) {
m_pos = *pos;
CHECK_FLOAT_CLASS(59, m_pos.x);
CHECK_FLOAT_CLASS(60, m_pos.y);
CHECK_FLOAT_CLASS(61, m_pos.z);
CHECK_FLOAT_RANGE(65, m_pos.x);
CHECK_FLOAT_MIN(66, m_pos.y);
CHECK_FLOAT_MAX(67, m_pos.y);
CHECK_FLOAT_RANGE(68, m_pos.z);
}
void cBgS_GndChk::PreCheck() {
+4 -4
View File
@@ -28,11 +28,11 @@ void cBgS_LinChk::Set2(cXyz const* startPos, cXyz const* endPos, unsigned int ac
field_0x40 = *endPos;
SetActorPid(actorPid);
mStts &= ~STTS_HIT;
ClearPi();
ClearCheckIndex();
}
void cBgS_LinChk::PreCalc() {
mPreWallChk = !(mStts & STTS_WALL_OFF);
mPreGroundChk = !(mStts & STTS_GROUND_OFF);
mPreRoofChk = !(mStts & STTS_ROOF_OFF);
mPreWallChk = !ChkSttsWallOff();
mPreGroundChk = !ChkSttsGroundOff();
mPreRoofChk = !ChkSttsRoofOff();
}
+104 -102
View File
@@ -218,9 +218,7 @@ void cCcD_Stts::PlusCcMove(f32 x, f32 y, f32 z) {
}
void cCcD_Stts::ClrCcMove() {
m_cc_move.z = 0.0f;
m_cc_move.y = 0.0f;
m_cc_move.x = 0.0f;
m_cc_move.x = m_cc_move.y = m_cc_move.z = 0.0f;
}
void cCcD_Stts::PlusDmg(int dmg) {
@@ -231,7 +229,8 @@ void cCcD_Stts::PlusDmg(int dmg) {
}
f32 cCcD_Stts::GetWeightF() const {
return (s32)m_weight;
int weighti = GetWeightUc();
return weighti;
}
void cCcD_ObjCommonBase::ct() {
@@ -259,17 +258,13 @@ fopAc_ac_c* cCcD_Obj::GetAc() {
if (mStts == NULL) {
return NULL;
} else {
return mStts->GetAc();
return mStts->GetActor();
}
}
void cCcD_ShapeAttr::getShapeAccess(cCcD_ShapeAttr::Shape* pshape) const {
pshape->_0 = 2;
pshape->_14 = 0.0f;
pshape->_10 = 0.0f;
pshape->_4.z = 0.0f;
pshape->_4.y = 0.0f;
pshape->_4.x = 0.0f;
pshape->_4.x = pshape->_4.y = pshape->_4.z = pshape->_10 = pshape->_14 = 0.0f;
}
bool cCcD_PntAttr::GetNVec(cXyz const& param_0, cXyz* param_1) const {
@@ -321,19 +316,20 @@ bool cCcD_TriAttr::CrossAtTg(const cCcD_TriAttr& other, cXyz* pxyz) const {
}
void cCcD_TriAttr::CalcAabBox() {
mAab.ClearForMinMax();
mAab.SetMinMax(mA);
mAab.SetMinMax(mB);
mAab.SetMinMax(mC);
GetWorkAab().ClearForMinMax();
GetWorkAab().SetMinMax(mA);
GetWorkAab().SetMinMax(mB);
GetWorkAab().SetMinMax(mC);
}
bool cCcD_TriAttr::GetNVec(const cXyz& param_0, cXyz* pOut) const {
if (getPlaneFunc(&param_0) >= 0.0f) {
*pOut = mNormal;
*pOut = *GetNP();
} else {
*pOut = mNormal;
VECScale(pOut, pOut, -1.0f);
*pOut = *GetNP();
PSVECScale(pOut, pOut, -1.0f);
}
return true;
}
@@ -362,7 +358,7 @@ bool cCcD_CpsAttr::CrossAtTg(const cCcD_SphAttr& sphAttr, cXyz* pxyz) const {
}
bool cCcD_CpsAttr::CrossAtTg(const cCcD_TriAttr& triAttr, cXyz* pxyz) const {
if (triAttr.cM3dGTri::Cross(*this, pxyz)) {
if (cM3dGCps::Cross(triAttr, pxyz)) {
return true;
} else {
return false;
@@ -400,44 +396,47 @@ bool cCcD_CpsAttr::CrossCo(const cCcD_SphAttr& sphAttr, f32* param_1) const {
}
void cCcD_CpsAttr::CalcAabBox() {
mAab.ClearForMinMax();
mAab.SetMinMax(mStart);
mAab.SetMinMax(mEnd);
mAab.PlusR(mRadius);
GetWorkAab().ClearForMinMax();
GetWorkAab().SetMinMax(*GetStartP());
GetWorkAab().SetMinMax(*GetEndP());
GetWorkAab().PlusR(GetR());
}
bool cCcD_CpsAttr::GetNVec(const cXyz& param_0, cXyz* param_1) const {
Vec diff;
const cXyz& endP = GetEndP();
VECSubtract(&endP, &mStart, &diff);
cXyz diff;
PSVECSubtract(GetEndP(), GetStartP(), &diff);
f32 diffLen = VECDotProduct(&diff, &diff);
f32 diffLen = PSVECDotProduct(&diff, &diff);
if (cM3d_IsZero(diffLen)) {
return false;
} else {
Vec vec1, vec2;
VECSubtract(&param_0, &mStart, &vec1);
f32 vec1Len = VECDotProduct(&vec1, &diff) / diffLen;
if (vec1Len < 0.0f) {
vec2 = mStart;
} else {
if (vec1Len > 1.0f) {
vec2 = endP;
} else {
VECScale(&diff, &diff, vec1Len);
VECAdd(&diff, &mStart, &vec2);
}
}
}
VECSubtract(&param_0, &vec2, param_1);
if (cM3d_IsZero(VECMag(param_1))) {
param_1->set(0.0f, 0.0f, 0.0f);
return false;
cXyz vec1;
PSVECSubtract(&param_0, GetStartP(), &vec1);
f32 vec1Len = PSVECDotProduct(&vec1, &diff) / diffLen;
cXyz vec2;
if (vec1Len < 0.0f) {
vec2 = *GetStartP();
} else {
if (vec1Len > 1.0f) {
vec2 = *GetEndP();
} else {
VECNormalize(param_1, param_1);
return true;
PSVECScale(&diff, &diff, vec1Len);
PSVECAdd(&diff, GetStartP(), &vec2);
}
}
PSVECSubtract(&param_0, &vec2, param_1);
if (cM3d_IsZero(PSVECMag(param_1))) {
param_1->x = 0.0f;
param_1->y = 0.0f;
param_1->z = 0.0f;
return false;
} else {
PSVECNormalize(param_1, param_1);
return true;
}
}
bool cCcD_CylAttr::CrossAtTg(const cCcD_CpsAttr& cpsAttr, cXyz* pxyz) const {
@@ -473,7 +472,7 @@ bool cCcD_CylAttr::CrossAtTg(const cCcD_TriAttr& triAttr, cXyz* pxyz) const {
}
bool cCcD_CylAttr::CrossCo(const cCcD_CylAttr& other, f32* f) const {
if (cM3dGCyl::Cross(&other, f)) {
if (cM3dGCyl::cross(&other, f)) {
return true;
} else {
return false;
@@ -481,7 +480,7 @@ bool cCcD_CylAttr::CrossCo(const cCcD_CylAttr& other, f32* f) const {
}
bool cCcD_CylAttr::CrossCo(const cCcD_SphAttr& sphAttr, f32* f) const {
if (cM3dGCyl::Cross(&sphAttr, f)) {
if (cM3dGCyl::cross(&sphAttr, f)) {
return true;
} else {
return false;
@@ -507,51 +506,51 @@ void cCcD_CylAttr::CalcAabBox() {
max.x = GetCP()->x + GetR();
max.y = GetCP()->y + GetH();
max.z = GetCP()->z + GetR();
mAab.Set(&min, &max);
GetWorkAab().Set(&min, &max);
}
bool cCcD_CylAttr::GetNVec(const cXyz& param_0, cXyz* param_1) const {
Vec vec;
if (GetCP()->y > param_0.y) {
vec = mCenter;
const cXyz* cp = GetCP();
cXyz vec;
if (cp->y > param_0.y) {
vec = *cp;
} else {
if (GetCP()->y + GetH() < param_0.y) {
vec.x = GetCP()->x;
vec.y = GetCP()->y;
vec.z = GetCP()->z;
vec.y = GetCP()->y + GetH();
if (cp->y + GetH() < param_0.y) {
vec = *cp;
vec.y += GetH();
} else {
vec = mCenter;
vec = *cp;
vec.y = param_0.y;
}
}
VECSubtract(&param_0, &vec, param_1);
if (cM3d_IsZero(VECMag(param_1))) {
param_1->set(0.0f, 0.0f, 0.0f);
PSVECSubtract(&param_0, &vec, param_1);
if (cM3d_IsZero(PSVECMag(param_1))) {
param_1->x = 0.0f;
param_1->y = 0.0f;
param_1->z = 0.0f;
return false;
} else {
VECNormalize(param_1, param_1);
PSVECNormalize(param_1, param_1);
return true;
}
return false;
}
void cCcD_CylAttr::getShapeAccess(cCcD_ShapeAttr::Shape* pshape) const {
pshape->_0 = 1;
pshape->_4.x = mCenter.x;
pshape->_4.y = mCenter.y;
pshape->_4.z = mCenter.z;
pshape->_10 = mRadius;
pshape->_14 = mHeight;
}
inline bool inlineCross(const cM3dGSph& sph, const cM3dGCps* pcps, cXyz* pxyz) {
return cM3d_Cross_CpsSph(*pcps, sph, pxyz);
const cXyz& center = GetC();
pshape->_4.x = center.x;
pshape->_4.y = center.y;
pshape->_4.z = center.z;
pshape->_10 = GetR();
pshape->_14 = GetH();
}
bool cCcD_SphAttr::CrossAtTg(const cCcD_CpsAttr& cpsAttr, cXyz* pxyz) const {
if (inlineCross(*this, &cpsAttr, pxyz)) {
if (cM3dGSph::Cross(&cpsAttr, pxyz)) {
return true;
} else {
return false;
@@ -575,7 +574,7 @@ bool cCcD_SphAttr::CrossAtTg(const cCcD_SphAttr& sphAttr, cXyz* pxyz) const {
}
bool cCcD_SphAttr::CrossAtTg(const cCcD_TriAttr& triAttr, cXyz* pxyz) const {
if (triAttr.cM3dGTri::Cross(*this, pxyz)) {
if (cM3dGSph::Cross(triAttr, pxyz)) {
return true;
} else {
return false;
@@ -583,7 +582,7 @@ bool cCcD_SphAttr::CrossAtTg(const cCcD_TriAttr& triAttr, cXyz* pxyz) const {
}
bool cCcD_SphAttr::CrossCo(const cCcD_CylAttr& cylAttr, f32* f) const {
if (cM3dGSph::Cross(&cylAttr, f)) {
if (cM3dGSph::cross(&cylAttr, f)) {
return true;
} else {
return false;
@@ -591,7 +590,7 @@ bool cCcD_SphAttr::CrossCo(const cCcD_CylAttr& cylAttr, f32* f) const {
}
bool cCcD_SphAttr::CrossCo(const cCcD_SphAttr& sphAttr, f32* f) const {
if (cM3dGSph::Cross(&sphAttr, f)) {
if (cM3dGSph::cross(&sphAttr, f)) {
return true;
} else {
return false;
@@ -622,37 +621,40 @@ void cCcD_SphAttr::CalcAabBox() {
max.y += GetR();
max.z += GetR();
mAab.Set(&min, &max);
GetWorkAab().Set(&min, &max);
}
bool cCcD_SphAttr::GetNVec(const cXyz& param_0, cXyz* param_1) const {
param_1->x = param_0.x - mCenter.x;
param_1->y = param_0.y - mCenter.y;
param_1->z = param_0.z - mCenter.z;
const cXyz& center = GetC();
param_1->x = param_0.x - center.x;
param_1->y = param_0.y - center.y;
param_1->z = param_0.z - center.z;
if (cM3d_IsZero(VECMag(param_1))) {
if (cM3d_IsZero(PSVECMag(param_1))) {
param_1->x = 0.0f;
param_1->y = 0.0f;
param_1->z = 0.0f;
return false;
} else {
VECNormalize(param_1, param_1);
PSVECNormalize(param_1, param_1);
return true;
}
}
void cCcD_SphAttr::getShapeAccess(cCcD_ShapeAttr::Shape* pshape) const {
pshape->_0 = 0;
pshape->_4.x = mCenter.x;
pshape->_4.y = mCenter.y;
pshape->_4.z = mCenter.z;
pshape->_10 = mRadius;
const cXyz& center = GetC();
pshape->_4.x = center.x;
pshape->_4.y = center.y;
pshape->_4.z = center.z;
pshape->_10 = GetR();
pshape->_14 = 0.0f;
}
void cCcD_ObjAt::SetHit(cCcD_Obj* pObj) {
mRPrm = 1;
mHitObj = pObj;
SetRPrm(1);
SetHitObj(pObj);
}
void cCcD_ObjAt::Set(const cCcD_SrcObjAt& src) {
@@ -662,8 +664,8 @@ void cCcD_ObjAt::Set(const cCcD_SrcObjAt& src) {
}
void cCcD_ObjAt::ClrHit() {
mRPrm &= ~1;
mHitObj = NULL;
ClrRPrm(1);
ClrObj();
}
void cCcD_ObjTg::Set(const cCcD_SrcObjTg& src) {
@@ -672,36 +674,36 @@ void cCcD_ObjTg::Set(const cCcD_SrcObjTg& src) {
}
void cCcD_ObjTg::SetGrp(u32 grp) {
mSPrm &= ~0x1E;
mSPrm |= grp;
OffSPrmBit(0x1E);
OnSPrmBit(grp);
}
void cCcD_ObjTg::ClrHit() {
mRPrm &= ~1;
mHitObj = NULL;
ClrRPrm(1);
ClrObj();
}
void cCcD_ObjTg::SetHit(cCcD_Obj* pObj) {
mRPrm = 1;
mHitObj = pObj;
SetRPrm(1);
SetHitObj(pObj);
}
void cCcD_ObjCo::SetHit(cCcD_Obj* pObj) {
mRPrm = 1;
mHitObj = pObj;
SetRPrm(1);
SetHitObj(pObj);
}
void cCcD_ObjCo::ClrHit() {
mRPrm &= ~1;
mHitObj = NULL;
ClrRPrm(1);
ClrObj();
}
void cCcD_ObjCo::SetIGrp(u32 grp) {
mSPrm &= ~0xE;
mSPrm |= grp;
OffSPrmBit(0xE);
OnSPrmBit(grp);
}
void cCcD_ObjCo::SetVsGrp(u32 grp) {
mSPrm &= ~0x70;
mSPrm |= grp;
OffSPrmBit(0x70);
OnSPrmBit(grp);
}
+51 -34
View File
@@ -33,6 +33,10 @@ void cCcS::Ct() {
*obj = NULL;
}
mObjCount = 0;
#if DEBUG
m_debug_code = 1234;
#endif
}
void cCcS::Dt() {
@@ -98,9 +102,8 @@ void cCcS::ClrCoHitInf() {
if (*obj != NULL) {
(*obj)->GetGObjInf()->ClrCoHit();
cCcD_Stts* stts = (*obj)->GetStts();
if (stts != NULL) {
stts->ClrCcMove();
if ((*obj)->GetStts() != NULL) {
(*obj)->GetStts()->ClrCo();
}
}
}
@@ -111,9 +114,8 @@ void cCcS::ClrTgHitInf() {
if (*obj != NULL) {
(*obj)->GetGObjInf()->ClrTgHit();
cCcD_Stts* stts = (*obj)->GetStts();
if (stts != NULL) {
stts->ClrTg();
if ((*obj)->GetStts() != NULL) {
(*obj)->GetStts()->ClrTg();
}
}
}
@@ -124,9 +126,8 @@ void cCcS::ClrAtHitInf() {
if (*obj != NULL) {
(*obj)->GetGObjInf()->ClrAtHit();
cCcD_Stts* stts = (*obj)->GetStts();
if (stts != NULL) {
stts->ClrAt();
if ((*obj)->GetStts() != NULL) {
(*obj)->GetStts()->ClrAt();
}
}
}
@@ -155,18 +156,18 @@ void cCcS::ChkAtTg() {
continue;
cCcD_ShapeAttr* pat_sa = (*pat_obj)->GetShapeAttr();
JUT_ASSERT(0, pat_sa != NULL);
JUT_ASSERT(338, pat_sa != NULL);
for (cCcD_Obj** ptg_obj = mpObjTg; ptg_obj < objTgEnd; ++ptg_obj) {
if (*ptg_obj == NULL || !(*ptg_obj)->ChkTgSet())
continue;
if (!(*pat_obj)->GetDivideInfo().Chk((*ptg_obj)->GetDivideInfo()))
if (!(*pat_obj)->GetPDivideInfo()->Chk(*(*ptg_obj)->GetPDivideInfo()))
continue;
if (ChkNoHitAtTg(*pat_obj, *ptg_obj))
continue;
cCcD_ShapeAttr* ptg_sa = (*ptg_obj)->GetShapeAttr();
JUT_ASSERT(0, ptg_sa != NULL);
JUT_ASSERT(354, ptg_sa != NULL);
static cXyz cross;
bool didCross = pat_sa->CrossAtTg(*ptg_sa, &cross);
@@ -176,9 +177,12 @@ void cCcS::ChkAtTg() {
} else if (anyBsRevHit && !didCross) {
cCcD_ShapeAttr* pat_sa = (*pat_obj)->GetShapeAttr();
if (pat_sa == NULL) {
cross.set(0.0f, 0.0f, 0.0f);
cross.x = 0.0f;
cross.y = 0.0f;
cross.z = 0.0f;
} else {
pat_sa->GetWorkAab().CalcCenter(&cross);
cM3dGAab& aab = pat_sa->GetWorkAab();
aab.CalcCenter(&cross);
}
SetAtTgCommonHitInf(*pat_obj, *ptg_obj, &cross);
@@ -213,24 +217,22 @@ void cCcS::ChkCo() {
continue;
cCcD_ShapeAttr* pco1_sa = (*pco1_obj)->GetShapeAttr();
JUT_ASSERT(0, pco1_sa != NULL);
JUT_ASSERT(444, pco1_sa != NULL);
for (cCcD_Obj** pco2_obj = pco1_obj + 1; pco2_obj < objCoEnd; ++pco2_obj) {
if (*pco2_obj == NULL || !(*pco2_obj)->ChkCoSet())
continue;
if (!(*pco1_obj)->GetDivideInfo().Chk((*pco2_obj)->GetDivideInfo()))
if (!(*pco1_obj)->GetPDivideInfo()->Chk(*(*pco2_obj)->GetPDivideInfo()))
continue;
if (ChkNoHitCo(*pco1_obj, *pco2_obj))
continue;
cCcD_ShapeAttr* pco2_sa = (*pco2_obj)->GetShapeAttr();
JUT_ASSERT(0, pco2_sa != NULL);
JUT_ASSERT(456, pco2_sa != NULL);
f32 cross_len;
if (pco1_sa->CrossCo(*pco2_sa, &cross_len)) {
cXyz& co2_center = pco2_sa->GetCoCP();
cXyz& co1_center = pco1_sa->GetCoCP();
SetCoCommonHitInf(*pco1_obj, &co1_center, *pco2_obj, &co2_center, cross_len);
SetCoCommonHitInf(*pco1_obj, &pco1_sa->GetCoCP(), *pco2_obj, &pco2_sa->GetCoCP(), cross_len);
}
}
}
@@ -238,7 +240,11 @@ void cCcS::ChkCo() {
void cCcS::CalcTgPlusDmg(cCcD_Obj* pat_obj, cCcD_Obj* ptg_obj, cCcD_Stts* pat_stts,
cCcD_Stts* ptg_stts) {
ptg_stts->PlusDmg(pat_obj->GetAtAtp());
UNUSED(ptg_obj);
UNUSED(pat_stts);
int atp = pat_obj->GetAtAtp();
ptg_stts->PlusDmg(atp);
}
void cCcS::SetAtTgCommonHitInf(cCcD_Obj* pat_obj, cCcD_Obj* ptg_obj, cXyz* pcross) {
@@ -296,8 +302,8 @@ void cCcS::SetPosCorrect(cCcD_Obj* pco1_obj, cXyz* ppos1, cCcD_Obj* pco2_obj, cX
return;
if (pco1_obj->GetStts() == NULL || pco2_obj->GetStts() == NULL)
return;
if (pco1_obj->GetStts()->GetAc() != NULL &&
pco1_obj->GetStts()->GetAc() == pco2_obj->GetStts()->GetAc())
if (pco1_obj->GetStts()->GetActor() != NULL &&
pco1_obj->GetStts()->GetActor() == pco2_obj->GetStts()->GetActor())
return;
if (!(fabsf(cross_len) < (1.0f / 125.0f))) {
@@ -346,12 +352,12 @@ void cCcS::SetPosCorrect(cCcD_Obj* pco1_obj, cXyz* ppos1, cCcD_Obj* pco2_obj, cX
}
f32 objDistLen;
Vec vec1;
Vec vec2;
cXyz vec1;
cXyz vec2;
Vec objsDist;
if (bothCoSph3DCrr) {
VECSubtract(ppos2, ppos1, &objsDist);
objDistLen = VECMag(&objsDist);
PSVECSubtract(ppos2, ppos1, &objsDist);
objDistLen = PSVECMag(&objsDist);
} else {
objsDist.x = ppos2->x - ppos1->x;
objsDist.y = 0;
@@ -361,10 +367,11 @@ void cCcS::SetPosCorrect(cCcD_Obj* pco1_obj, cXyz* ppos1, cCcD_Obj* pco2_obj, cX
if (!cM3d_IsZero(objDistLen)) {
if (bothCoSph3DCrr) {
VECScale(&objsDist, &objsDist, cross_len / objDistLen);
f32 sp1C = cross_len / objDistLen;
PSVECScale(&objsDist, &objsDist, sp1C);
obj2Weight *= -1;
VECScale(&objsDist, &vec1, obj2Weight);
VECScale(&objsDist, &vec2, obj1Weight);
PSVECScale(&objsDist, &vec1, obj2Weight);
PSVECScale(&objsDist, &vec2, obj1Weight);
} else {
f32 pushFactor = cross_len / objDistLen;
objsDist.x *= pushFactor;
@@ -435,7 +442,7 @@ void cCcS::CalcArea() {
for (cCcD_Obj** pset_obj = mpObj; pset_obj < mpObj + mObjCount; ++pset_obj) {
if (*pset_obj != NULL) {
cCcD_ShapeAttr* pset_sa = (*pset_obj)->GetShapeAttr();
JUT_ASSERT(0, pset_sa != NULL);
JUT_ASSERT(826, pset_sa != NULL);
pset_sa->CalcAabBox();
aab.SetMinMax(pset_sa->GetWorkAab());
@@ -445,10 +452,10 @@ void cCcS::CalcArea() {
mDivideArea.SetArea(aab);
for (cCcD_Obj** pset_obj = mpObj; pset_obj < mpObj + mObjCount; ++pset_obj) {
if (*pset_obj != NULL) {
const cCcD_ShapeAttr* pset_sa = (*pset_obj)->GetShapeAttr();
JUT_ASSERT(0, pset_sa != NULL);
cCcD_ShapeAttr* pset_sa = (*pset_obj)->GetShapeAttr();
JUT_ASSERT(839, pset_sa != NULL);
cCcD_DivideInfo* divideInfo = &(*pset_obj)->GetDivideInfo();
cCcD_DivideInfo* divideInfo = (*pset_obj)->GetPDivideInfo();
mDivideArea.CalcDivideInfo(divideInfo, pset_sa->GetWorkAab(),
(*pset_obj)->ChkBsRevHit());
}
@@ -456,10 +463,20 @@ void cCcS::CalcArea() {
}
void cCcS::Move() {
#if DEBUG
JUT_ASSERT(866, m_debug_code == 1234);
#endif
CalcArea();
ChkAtTg();
ChkCo();
MoveAfterCheck();
field_0x280c = mObjAtCount;
field_0x280e = mObjTgCount;
field_0x2810 = mObjCoCount;
field_0x2812 = mObjCount;
mObjAtCount = 0;
mObjTgCount = 0;
mObjCoCount = 0;
+74 -74
View File
@@ -66,14 +66,14 @@ bool cM3d_Len2dSqPntAndSegLine(f32 param_1, f32 param_2, f32 param_3, f32 param_
bool cM3d_Len3dSqPntAndSegLine(const cM3dGLin* pLine, const Vec* pVec, Vec* pOutVec, f32* pOutF) {
bool retVal = false;
Vec tmp;
VECSubtract(&pLine->GetEndP(), &pLine->GetStartP(), &tmp);
VECSubtract(pLine->GetEndP(), pLine->GetStartP(), &tmp);
f32 seqLen = VECDotProduct(&tmp, &tmp);
if (cM3d_IsZero(seqLen)) {
*pOutF = 0.0f;
return retVal;
} else {
Vec tmp2;
VECSubtract(pVec, &pLine->GetStartP(), &tmp2);
VECSubtract(pVec, pLine->GetStartP(), &tmp2);
f32 tmpF = VECDotProduct(&tmp2, &tmp);
tmpF /= seqLen;
if (tmpF < 0.0f || tmpF > 1.0f) {
@@ -82,7 +82,7 @@ bool cM3d_Len3dSqPntAndSegLine(const cM3dGLin* pLine, const Vec* pVec, Vec* pOut
retVal = true;
}
VECScale(&tmp, &tmp, tmpF);
VECAdd(&tmp, &pLine->GetStartP(), pOutVec);
VECAdd(&tmp, pLine->GetStartP(), pOutVec);
*pOutF = VECSquareDistance(pOutVec, pVec);
return retVal;
}
@@ -213,7 +213,7 @@ int cM3d_Check_LinLin(const cM3dGLin* lin_a, const cM3dGLin* lin_b, f32* dst_a,
VECScale(&linAVec, &linAVec, invLinALen);
VECScale(&linBVec, &linBVec, invLinBLen);
Vec tmp;
VECSubtract(&lin_a->GetStartP(), &lin_b->GetStartP(), &tmp);
VECSubtract(lin_a->GetStartP(), lin_b->GetStartP(), &tmp);
f32 tmpF = -VECDotProduct(&linAVec, &linBVec);
f32 tmpF2 = VECDotProduct(&tmp, &linAVec);
VECSquareMag(&tmp); // result not used
@@ -262,19 +262,19 @@ static bool cM3d_CrossInfLineVsInfPlane_proc(f32 pFloatA, f32 pFloatB, const Vec
}
bool cM3d_Cross_LinPla(const cM3dGLin* lin, const cM3dGPla* pla, Vec* dst, bool a, bool b) {
f32 startVal = pla->getPlaneFunc(&lin->GetStartP());
f32 endVal = pla->getPlaneFunc(&lin->GetEndP());
f32 startVal = pla->getPlaneFunc(lin->GetStartP());
f32 endVal = pla->getPlaneFunc(lin->GetEndP());
if (startVal * endVal > 0.0f) {
*dst = lin->GetEnd();
return false;
} else {
if (startVal >= 0.0f && endVal <= 0.0f) {
if (a) {
return cM3d_CrossInfLineVsInfPlane_proc(startVal, endVal, &lin->GetStartP(), &lin->GetEndP(), dst);
return cM3d_CrossInfLineVsInfPlane_proc(startVal, endVal, lin->GetStartP(), lin->GetEndP(), dst);
}
} else {
if (b) {
return cM3d_CrossInfLineVsInfPlane_proc(startVal, endVal, &lin->GetStartP(), &lin->GetEndP(), dst);
return cM3d_CrossInfLineVsInfPlane_proc(startVal, endVal, lin->GetStartP(), lin->GetEndP(), dst);
}
}
*dst = lin->GetEnd();
@@ -1034,53 +1034,53 @@ bool cM3d_Cross_LinSph(cM3dGLin const* line, cM3dGSph const* sph, Vec* param_2)
const Vec* center = sph->GetCP();
f32 max_x = center->x + sph->GetR();
if (max_x < line->GetStartP().x && max_x < line->GetEndP().x) {
if (max_x < line->GetStartP()->x && max_x < line->GetEndP()->x) {
return false;
}
f32 min_x = center->x - sph->GetR();
if (min_x > line->GetStartP().x && min_x > line->GetEndP().x) {
if (min_x > line->GetStartP()->x && min_x > line->GetEndP()->x) {
return false;
}
f32 max_y = center->y + sph->GetR();
if (max_y < line->GetStartP().y && max_y < line->GetEndP().y) {
if (max_y < line->GetStartP()->y && max_y < line->GetEndP()->y) {
return false;
}
f32 min_y = center->y - sph->GetR();
if (min_y > line->GetStartP().y && min_y > line->GetEndP().y) {
if (min_y > line->GetStartP()->y && min_y > line->GetEndP()->y) {
return false;
}
f32 max_z = center->z + sph->GetR();
if (max_z < line->GetStartP().z && max_z < line->GetEndP().z) {
if (max_z < line->GetStartP()->z && max_z < line->GetEndP()->z) {
return false;
}
f32 min_z = center->z - sph->GetR();
if (min_z > line->GetStartP().z && min_z > line->GetEndP().z) {
if (min_z > line->GetStartP()->z && min_z > line->GetEndP()->z) {
return false;
}
VECSubtract(&line->GetEndP(), &line->GetStartP(), &lin_vec);
VECSubtract(line->GetEndP(), line->GetStartP(), &lin_vec);
f32 len_sq = VECSquareMag(&lin_vec);
if (cM3d_IsZero(len_sq)) {
return false;
}
VECSubtract(center, &line->GetStartP(), &vec);
VECSubtract(center, line->GetStartP(), &vec);
f32 proj = VECDotProduct(&vec, &lin_vec) / len_sq;
if (proj < 0.0f || proj > 1.0f) {
if (line->GetStartP().abs2(*center) < line->GetEndP().abs2(*center)) {
if (cM3d_Cross_SphPnt(sph, &line->GetStartP())) {
param_2->x = line->GetStartP().x;
param_2->y = line->GetStartP().y;
param_2->z = line->GetStartP().z;
if (line->GetStartP()->abs2(*center) < line->GetEndP()->abs2(*center)) {
if (cM3d_Cross_SphPnt(sph, line->GetStartP())) {
param_2->x = line->GetStartP()->x;
param_2->y = line->GetStartP()->y;
param_2->z = line->GetStartP()->z;
return true;
}
} else {
if (cM3d_Cross_SphPnt(sph, &line->GetEndP())) {
param_2->x = line->GetEndP().x;
param_2->y = line->GetEndP().y;
param_2->z = line->GetEndP().z;
if (cM3d_Cross_SphPnt(sph, line->GetEndP())) {
param_2->x = line->GetEndP()->x;
param_2->y = line->GetEndP()->y;
param_2->z = line->GetEndP()->z;
return true;
}
}
@@ -1089,7 +1089,7 @@ bool cM3d_Cross_LinSph(cM3dGLin const* line, cM3dGSph const* sph, Vec* param_2)
Vec proj_vec;
VECScale(&lin_vec, &proj_vec, proj);
VECAdd(&proj_vec, &line->GetStartP(), param_2);
VECAdd(&proj_vec, line->GetStartP(), param_2);
if (cM3d_LenSq(param_2, center) <= sph->GetR() * sph->GetR()) {
return true;
}
@@ -1100,8 +1100,8 @@ int cM3d_Cross_LinSph_CrossPos(cM3dGSph const& sph, cM3dGLin const& line, Vec* p
Vec* param_3) {
int ret;
Vec line_vec, vec;
VECSubtract(&line.GetEndP(), &line.GetStartP(), &line_vec);
VECSubtract(&line.GetStartP(), sph.GetCP(), &vec);
VECSubtract(line.GetEndP(), line.GetStartP(), &line_vec);
VECSubtract(line.GetStartP(), sph.GetCP(), &vec);
f32 len_sq = VECDotProduct(&line_vec, &line_vec);
f32 dVar9 = VECDotProduct(&line_vec, &vec) * 2.0f;
f32 dVar6 = VECDotProduct(&vec, &vec) - sph.GetR() * sph.GetR();
@@ -1113,7 +1113,7 @@ int cM3d_Cross_LinSph_CrossPos(cM3dGSph const& sph, cM3dGLin const& line, Vec* p
ret = 1;
Vec vec2;
VECScale(&line_vec, &vec2, -dVar6 / dVar9);
VECAdd(&vec2, &line.GetStartP(), param_2);
VECAdd(&vec2, line.GetStartP(), param_2);
}
} else {
f32 f11 = dVar9 * dVar9 - len_sq * 4.0f * dVar6;
@@ -1121,7 +1121,7 @@ int cM3d_Cross_LinSph_CrossPos(cM3dGSph const& sph, cM3dGLin const& line, Vec* p
ret = 1;
Vec vec2;
VECScale(&line_vec, &vec2, -dVar9 / (len_sq * 2.0f));
VECAdd(&vec2, &line.GetStartP(), param_2);
VECAdd(&vec2, line.GetStartP(), param_2);
} else if (f11 < 0.0f) {
ret = 0;
} else {
@@ -1131,9 +1131,9 @@ int cM3d_Cross_LinSph_CrossPos(cM3dGSph const& sph, cM3dGLin const& line, Vec* p
f32 scale1 = f1 * (-dVar9 + sqrtf(f11));
f32 scale2 = f1 * (-dVar9 - sqrtf(f11));
VECScale(&line_vec, &vec2, scale1);
VECAdd(&vec2, &line.GetStartP(), param_2);
VECAdd(&vec2, line.GetStartP(), param_2);
VECScale(&line_vec, &vec2, scale2);
VECAdd(&vec2, &line.GetStartP(), param_3);
VECAdd(&vec2, line.GetStartP(), param_3);
}
}
@@ -1460,17 +1460,17 @@ int cM3d_Cross_CylLin(cM3dGCyl const* cyl, cM3dGLin const* line, Vec* param_2, V
f2 = 0.0f;
uVar11 = 0;
if (cM3d_Cross_CylPnt(cyl, &line->GetStartP()) && cM3d_Cross_CylPnt(cyl, &line->GetEndP())) {
*param_2 = line->GetStartP();
*param_3 = line->GetEndP();
if (cM3d_Cross_CylPnt(cyl, line->GetStartP()) && cM3d_Cross_CylPnt(cyl, line->GetEndP())) {
*param_2 = *line->GetStartP();
*param_3 = *line->GetEndP();
return 2;
}
Vec vec1, vec2, vec3;
Vec vec[4];
const Vec* center = cyl->GetCP();
VECSubtract(&line->GetStartP(), center, &vec1);
VECSubtract(&line->GetEndP(), center, &vec2);
VECSubtract(line->GetStartP(), center, &vec1);
VECSubtract(line->GetEndP(), center, &vec2);
VECSubtract(&vec2, &vec1, &vec3);
r_sq = cyl->GetR() * cyl->GetR();
@@ -1599,7 +1599,7 @@ int cM3d_Cross_CylLin(cM3dGCyl const* cyl, cM3dGLin const* line, Vec* param_2, V
if (count == 0) {
*param_2 = vec[i];
} else if (count == 1) {
if (cM3d_LenSq(&line->GetStartP(), param_2) < cM3d_LenSq(&line->GetStartP(), &vec[i])) {
if (cM3d_LenSq(line->GetStartP(), param_2) < cM3d_LenSq(line->GetStartP(), &vec[i])) {
*param_3 = vec[i];
} else {
*param_3 = *param_2;
@@ -1707,36 +1707,36 @@ inline bool cM3d_Cross_CpsCyl_Check(cM3dGCps const& cps, cM3dGCyl const& cyl, Ve
bool cM3d_Cross_CpsCyl(cM3dGCps const& cps, cM3dGCyl const& cyl, Vec* param_2) {
cM3dGLin line;
if (cM3d_Cross_CylPnt(&cyl, &cps.GetEndP())) {
*param_2 = cps.GetEndP();
if (cM3d_Cross_CylPnt(&cyl, cps.GetEndP())) {
*param_2 = *cps.GetEndP();
return true;
}
if (cM3d_Cross_CylPnt(&cyl, &cps.GetStartP())) {
*param_2 = cps.GetStartP();
if (cM3d_Cross_CylPnt(&cyl, cps.GetStartP())) {
*param_2 = *cps.GetStartP();
return true;
}
line.GetStartP() = *cyl.GetCP();
line.GetEndP() = *cyl.GetCP();
line.GetEndP().y += cyl.GetH();
*line.GetStartP() = *cyl.GetCP();
*line.GetEndP() = *cyl.GetCP();
line.GetEndP()->y += cyl.GetH();
Vec vec;
f32 tmp;
if (cM3d_Len3dSqPntAndSegLine(&cps, &line.GetEndP(), &vec, &tmp)) {
f32 dist = VECDistance(&line.GetEndP(), &vec);
if (cM3d_Len3dSqPntAndSegLine(&cps, line.GetEndP(), &vec, &tmp)) {
f32 dist = VECDistance(line.GetEndP(), &vec);
if (dist < cps.GetR()) {
VECAdd(&line.GetEndP(), &vec, param_2);
VECAdd(line.GetEndP(), &vec, param_2);
VECScale(param_2, param_2, 0.5f);
*param_2 = line.GetEndP();
*param_2 = *line.GetEndP();
return true;
}
}
if (cM3d_Len3dSqPntAndSegLine(&cps, &line.GetStartP(), &vec, &tmp)) {
f32 dist = VECDistance(&line.GetStartP(), &vec);
if (cM3d_Len3dSqPntAndSegLine(&cps, line.GetStartP(), &vec, &tmp)) {
f32 dist = VECDistance(line.GetStartP(), &vec);
if (dist < cps.GetR()) {
VECAdd(&line.GetStartP(), &vec, param_2);
VECAdd(line.GetStartP(), &vec, param_2);
VECScale(param_2, param_2, 0.5f);
return true;
}
@@ -1749,7 +1749,7 @@ bool cM3d_Cross_CpsCyl(cM3dGCps const& cps, cM3dGCyl const& cyl, Vec* param_2) {
cM3dGSph sph;
f32 tmp2;
sph.SetR(cps.GetR());
sph.SetC(cps.GetStartP());
sph.SetC(*cps.GetStartP());
return cM3d_Cross_CylSph(&cyl, &sph, param_2, &tmp2);
} else if (iVar2 == 2) {
if (f1 >= 0.0f && f1 <= 1.0f && f2 >= 0.0f && f2 <= 1.0f) {
@@ -1818,8 +1818,8 @@ static void cM3d_Cross_CpsSph_CrossPos(cM3dGCps const& param_1, cM3dGSph const&
if (iVar5 == 1) {
*param_4 = aVStack_70;
} else if (iVar5 == 2) {
f32 dVar8 = VECSquareDistance(&aVStack_70, &param_1.GetStartP());
f32 dVar9 = VECSquareDistance(&VStack_7c, &param_1.GetStartP());
f32 dVar8 = VECSquareDistance(&aVStack_70, param_1.GetStartP());
f32 dVar9 = VECSquareDistance(&VStack_7c, param_1.GetStartP());
if (dVar8 < dVar9) {
*param_4 = aVStack_70;
} else {
@@ -1840,14 +1840,14 @@ static void cM3d_Cross_CpsSph_CrossPos(cM3dGCps const& param_1, cM3dGSph const&
bool cM3d_Cross_CpsSph(cM3dGCps const& param_1, cM3dGSph const& param_2, Vec* param_3) {
f32 local_38 = VECDistance(&param_1.GetStartP(), param_2.GetCP());
f32 local_38 = VECDistance(param_1.GetStartP(), param_2.GetCP());
if (local_38 < param_1.GetR() + param_2.GetR()) {
cM3d_Cross_CpsSph_CrossPos(param_1, param_2, param_1.GetStartP(), param_3);
cM3d_Cross_CpsSph_CrossPos(param_1, param_2, *param_1.GetStartP(), param_3);
return true;
}
local_38 = VECDistance(&param_1.GetEndP(), param_2.GetCP());
local_38 = VECDistance(param_1.GetEndP(), param_2.GetCP());
if (local_38 < param_1.GetR() + param_2.GetR()) {
cM3d_Cross_CpsSph_CrossPos(param_1, param_2, param_1.GetEndP(), param_3);
cM3d_Cross_CpsSph_CrossPos(param_1, param_2, *param_1.GetEndP(), param_3);
return true;
}
Vec auStack_34;
@@ -1922,13 +1922,13 @@ inline f32 cM3d_2LinCenter(cM3dGLin const& pLinA, f32 pLinAF, cM3dGLin const& pL
bool cM3d_Cross_CpsTri(cM3dGCps const& cps, cM3dGTri tri, Vec* param_2) {
cM3dGSph sph;
sph.SetC(cps.GetStartP());
sph.SetC(*cps.GetStartP());
sph.SetR(cps.GetR());
if (cM3d_Cross_SphTri(&sph, &tri, param_2)) {
return true;
}
sph.SetC(cps.GetEndP());
sph.SetC(*cps.GetEndP());
sph.SetR(cps.GetR());
if (cM3d_Cross_SphTri(&sph, &tri, param_2)) {
return true;
@@ -2044,25 +2044,25 @@ static int cM3d_2PlaneCrossLine(const cM3dGPla& pPlaneA, const cM3dGPla& pPlaneB
if (absTX >= absTY && absTX >= absTZ) {
cM3d_PlaneCrossLineProcWork(pPlaneA.GetNP()->y, pPlaneA.GetNP()->z, pPlaneB.GetNP()->y,
pPlaneB.GetNP()->z, tmp.x, pPlaneA.GetD(), pPlaneB.GetD(),
&pLinOut->GetStartP().y, &pLinOut->GetStartP().z);
pLinOut->GetStartP().x = 0.0f;
&pLinOut->GetStartP()->y, &pLinOut->GetStartP()->z);
pLinOut->GetStartP()->x = 0.0f;
} else if (absTY >= absTX && absTY >= absTZ) {
cM3d_PlaneCrossLineProcWork(pPlaneA.GetNP()->z, pPlaneA.GetNP()->x, pPlaneB.GetNP()->z,
pPlaneB.GetNP()->x, tmp.y, pPlaneA.GetD(), pPlaneB.GetD(),
&pLinOut->GetStartP().z, &pLinOut->GetStartP().x);
pLinOut->GetStartP().y = 0.0f;
&pLinOut->GetStartP()->z, &pLinOut->GetStartP()->x);
pLinOut->GetStartP()->y = 0.0f;
} else {
cM3d_PlaneCrossLineProcWork(pPlaneA.GetNP()->x, pPlaneA.GetNP()->y, pPlaneB.GetNP()->x,
pPlaneB.GetNP()->y, tmp.z, pPlaneA.GetD(), pPlaneB.GetD(),
&pLinOut->GetStartP().x, &pLinOut->GetStartP().y);
pLinOut->GetStartP().z = 0.0f;
&pLinOut->GetStartP()->x, &pLinOut->GetStartP()->y);
pLinOut->GetStartP()->z = 0.0f;
}
f32 scale = VECMag(&pLinOut->GetStartP());
f32 scale = VECMag(pLinOut->GetStartP());
if (cM3d_IsZero(scale)) {
scale = 1.0f;
}
VECScale(&tmp, &tmp, scale);
VECAdd(&pLinOut->GetStartP(), &tmp, &pLinOut->GetEndP());
VECAdd(pLinOut->GetStartP(), &tmp, pLinOut->GetEndP());
return 1;
}
}
@@ -2073,10 +2073,10 @@ BOOL cM3d_3PlaneCrossPos(const cM3dGPla& pPlaneA, const cM3dGPla& pPlaneB, const
if (!cM3d_2PlaneCrossLine(pPlaneA, pPlaneB, &lin)) {
return false;
} else {
const Vec* end = &lin.GetEndP();
f32 tmpf1 = pPlaneC.getPlaneFunc(&lin.GetStartP());
const Vec* end = lin.GetEndP();
f32 tmpf1 = pPlaneC.getPlaneFunc(lin.GetStartP());
f32 tmpf2 = pPlaneC.getPlaneFunc(end);
if (!cM3d_CrossInfLineVsInfPlane_proc(tmpf1, tmpf2, &lin.GetStartP(), end, pVecOut)) {
if (!cM3d_CrossInfLineVsInfPlane_proc(tmpf1, tmpf2, lin.GetStartP(), end, pVecOut)) {
return false;
} else {
return true;
@@ -2094,10 +2094,10 @@ f32 cM3d_lineVsPosSuisenCross(const cM3dGLin* pLine, const Vec* pPoint, Vec* pVe
*pVecOut = *pPoint;
return 0.0f;
} else {
VECSubtract(pPoint, &pLine->GetStartP(), &tmp2);
VECSubtract(pPoint, pLine->GetStartP(), &tmp2);
f32 retVal = VECDotProduct(&tmp2, &tmp1) / diffLen;
VECScale(&tmp1, &tmp3, retVal);
VECAdd(&tmp3, &pLine->GetStartP(), pVecOut);
VECAdd(&tmp3, pLine->GetStartP(), pVecOut);
return retVal;
}
}
+10 -5
View File
@@ -1718,11 +1718,16 @@ void Z2SceneMgr::setSceneName(char* spot, s32 room, s32 layer) {
if (Z2GetSoundMgr()->getStreamMgr()->isActive()) {
JAUSoundTable* sound_table = JAUSoundTable::getInstance();
JSUList<JAIStream>* stream_list = Z2GetSoundMgr()->getStreamMgr()->getStreamList();
JSULink<JAIStream>* stream;
for (stream = stream_list->getFirst(); stream != NULL; stream = stream->getNext()) {
if (bVar2 || sound_table->getTypeID(stream->getObject()->getID()) != 0x71) {
stream->getObject()->stop(Z2Param::SCENE_CHANGE_BGM_FADEOUT_TIME);
#if DUSK_AUDIO_DISABLED
if (sound_table->isValid())
#endif
{
JSUList<JAIStream>* stream_list = Z2GetSoundMgr()->getStreamMgr()->getStreamList();
JSULink<JAIStream>* stream;
for (stream = stream_list->getFirst(); stream != NULL; stream = stream->getNext()) {
if (bVar2 || sound_table->getTypeID(stream->getObject()->getID()) != 0x71) {
stream->getObject()->stop(Z2Param::SCENE_CHANGE_BGM_FADEOUT_TIME);
}
}
}
}
+2
View File
@@ -136,6 +136,8 @@ Z2SoundHandlePool* Z2SoundObjBase::startSound(JAISoundID soundID, u32 mapinfo, s
}
Z2SoundHandlePool* Z2SoundObjBase::startLevelSound(JAISoundID soundID, u32 mapinfo, s8 reverb) {
DUSK_AUDIO_SKIP(NULL);
if (!alive_) {
return NULL;
}
+1 -1
View File
@@ -15717,7 +15717,7 @@ int daAlink_c::procMoveTurnInit(int param_0) {
dComIfGp_setPlayerStatus0(0, 0x800);
if (param_0 != 0) {
mProcVar3.field_0x300e = (mpHIO->mMove.m.mMaxTurnAngle * 4) + 19030;
mProcVar3.field_0x300e = (s16)((mpHIO->mMove.m.mMaxTurnAngle * 4) + 19030);
mProcVar4.field_0x3010 = mpHIO->mMove.m.mMaxTurnAngle * 2;
mProcVar1.field_0x300a = 2;
current.angle.y = mMoveAngle;
+1 -1
View File
@@ -1872,7 +1872,7 @@ static void demo_camera(b_bq_class* i_this) {
spFC.set(BREG_F(5) + -30.0f, 0.0f, BREG_F(6) + 1938.0f);
}
daPy_getPlayerActorClass()->setPlayerPosAndAngle(&spFC, BREG_S(5) + 0x8000, 0);
daPy_getPlayerActorClass()->setPlayerPosAndAngle(&spFC, (s16)(BREG_S(5) + 0x8000), 0);
if (i_this->field_0x5c8 != 0) {
i_this->field_0x5cc.y += i_this->field_0x5d8;
+1
View File
@@ -1325,6 +1325,7 @@ void daB_MGN_c::executeDash() {
}
if (mMoveMode == 11) {
// @bug - parenthesis should not be on the condition
if (abs((s16)(angle - field_0xa90) < 0x1800) != 0) {
if ((s16)(angle - field_0xa90) < 0) {
angle = field_0xa90 - 0x1800;
+1 -1
View File
@@ -881,7 +881,7 @@ void daBgObj_c::setParticle() {
for (; partNum != 0; partNum--) {
u32 flags = *(BE(u32)*)partBlockItems++;
u16 res_id = *(BE(u32)*)partBlockItems;
*partBlockItems++;
partBlockItems++;
GXColor prmColor = { 0xFF, 0xFF, 0xFF, 0xFF };
GXColor envColor = { 0xFF, 0xFF, 0xFF, 0xFF };
+1 -1
View File
@@ -254,7 +254,7 @@ BOOL daBdoor_c::checkArea() {
if (fabsf(vec.z) > 100.0f) {
return false;
}
return (s16)fabs(current.angle.y - 0x7fff - player->current.angle.y) <= 0x4000 ? 1 : 0;
return (s16)fabs((f64)(current.angle.y - 0x7fff - player->current.angle.y)) <= 0x4000 ? 1 : 0;
}
BOOL daBdoor_c::checkFront() {
+1 -1
View File
@@ -825,7 +825,7 @@ int daBdoorL1_c::checkArea() {
if (fabsf(local_48.z) > 100.0f) {
return 0;
}
if ((s16)fabs(current.angle.y - 0x7fff - player->current.angle.y) <= 0x4000) {
if ((s16)fabs((f64)(current.angle.y - 0x7fff - player->current.angle.y)) <= 0x4000) {
return 1;
} else {
return 0;
+1 -1
View File
@@ -348,7 +348,7 @@ int daBdoorL5_c::checkArea() {
if (fabsf(local_48.z) > 100.0f) {
return 0;
}
if ((s16)fabs(current.angle.y - 0x7fff - player->current.angle.y) <= 0x4000) {
if ((s16)fabs((f64)(current.angle.y - 0x7fff - player->current.angle.y)) <= 0x4000) {
return 1;
} else {
return 0;
+1 -1
View File
@@ -1318,7 +1318,7 @@ int daMBdoorL1_c::checkArea() {
return 0;
}
if ((s16)fabs(angle - 0x7fff - player->current.angle.y) > 0x4000) {
if ((s16)fabs((f64)(angle - 0x7fff - player->current.angle.y)) > 0x4000) {
return 0;
} else {
return 1;
+6 -2
View File
@@ -11,7 +11,7 @@
#include "f_pc/f_pc_name.h"
#include "f_op/f_op_actor_mng.h"
static void PPCallBack(fopAc_ac_c* i_this, fopAc_ac_c* i_unused, s16 i_unused2,
static fopAc_ac_c* PPCallBack(fopAc_ac_c* i_this, fopAc_ac_c* i_unused, s16 i_unused2,
dBgW_Base::PushPullLabel param_3) {
if (cLib_checkBit(param_3, dBgW_Base::PPLABEL_PUSH) != 0) {
daDoorPush_c* l_this = (daDoorPush_c*)i_this;
@@ -19,9 +19,11 @@ static void PPCallBack(fopAc_ac_c* i_this, fopAc_ac_c* i_unused, s16 i_unused2,
l_this->field_0x62e[1] = 0;
l_this->field_0x62c[0] = 1;
}
return i_this;
}
static void PPCallBack2(fopAc_ac_c* i_this, fopAc_ac_c* i_unused, s16 i_unused2,
static fopAc_ac_c* PPCallBack2(fopAc_ac_c* i_this, fopAc_ac_c* i_unused, s16 i_unused2,
dBgW_Base::PushPullLabel param_3) {
if (cLib_checkBit(param_3, dBgW_Base::PPLABEL_PUSH) != 0) {
daDoorPush_c* l_this = (daDoorPush_c*)i_this;
@@ -29,6 +31,8 @@ static void PPCallBack2(fopAc_ac_c* i_this, fopAc_ac_c* i_unused, s16 i_unused2,
l_this->field_0x62e[0] = 0;
l_this->field_0x62c[1] = 1;
}
return i_this;
}
void daDoorPush_c::initBaseMtx() {
+6
View File
@@ -1934,7 +1934,13 @@ int daE_HZ_c::CreateHeap() {
return 0;
}
// This happens to work with MWCC since the member will only ever be initialized a pointer to a
// string in this TU's .data section, but comparing against a string literal is still UB.
#if AVOID_UB
if (strcmp(mpName, "E_hzp") == 0) {
#else
if (mpName == "E_hzp") {
#endif
modelData = (J3DModelData*)dComIfG_getObjectRes(mpName, 3);
} else {
modelData = (J3DModelData*)dComIfG_getObjectRes(mpName, 3);
+1
View File
@@ -496,6 +496,7 @@ static s8 e_kr_path_move(e_kr_class* i_this) {
if (totalDiff < 10.0f * TREG_F(10) + 300.0f) {
point = &i_this->field_0x6e4->m_points[i_this->field_0x6e2];
u8 pointArg1 = point->mArg1;
// !@bug Comparison of u8 with -1 will always evaluate to false
if (pointArg1 == -1) {
i_this->field_0x684 = 50.0f * 1.2f;
} else {

Some files were not shown because too many files have changed in this diff Show More