c_lib, c_xyz, c_angle, c_bg_s_gnd_chk fix

This commit is contained in:
Jasper St. Pierre
2023-09-22 20:02:31 -07:00
parent c8292b3624
commit f2da02f2b9
6 changed files with 38 additions and 34 deletions
+4 -4
View File
@@ -510,12 +510,12 @@ config.libs = [
Object(Matching, "SSystem/SComponent/c_request.cpp"),
Object(Matching, "SSystem/SComponent/c_tag.cpp"),
Object(Matching, "SSystem/SComponent/c_tag_iter.cpp"),
Object(NonMatching, "SSystem/SComponent/c_xyz.cpp"),
Object(Matching, "SSystem/SComponent/c_xyz.cpp"),
Object(Matching, "SSystem/SComponent/c_sxyz.cpp"),
Object(Matching, "SSystem/SComponent/c_math.cpp"),
Object(NonMatching, "SSystem/SComponent/c_bg_s.cpp"),
Object(Matching, "SSystem/SComponent/c_bg_s_chk.cpp"),
Object(NonMatching, "SSystem/SComponent/c_bg_s_gnd_chk.cpp"),
Object(Matching, "SSystem/SComponent/c_bg_s_gnd_chk.cpp"),
Object(Matching, "SSystem/SComponent/c_bg_s_lin_chk.cpp"),
Object(NonMatching, "SSystem/SComponent/c_bg_w.cpp"),
Object(NonMatching, "SSystem/SComponent/c_m2d.cpp"),
@@ -526,8 +526,8 @@ config.libs = [
Object(Matching, "SSystem/SComponent/c_m3d_g_pla.cpp"),
Object(Matching, "SSystem/SComponent/c_m3d_g_sph.cpp"),
Object(Matching, "SSystem/SComponent/c_m3d_g_tri.cpp"),
Object(NonMatching, "SSystem/SComponent/c_lib.cpp"),
Object(NonMatching, "SSystem/SComponent/c_angle.cpp"),
Object(Matching, "SSystem/SComponent/c_lib.cpp"),
Object(Matching, "SSystem/SComponent/c_angle.cpp"),
Object(Matching, "SSystem/SComponent/c_data_tbl.cpp"),
Object(Matching, "SSystem/SStandard/s_basic.cpp"),
],
+25 -25
View File
@@ -23,15 +23,15 @@ public:
void Val(const cSAngle&);
void Val(s16);
void Val(float);
float Degree(void) const;
float Radian(void) const;
float Norm(void) const;
s16 Abs(void) const;
s16 Inv(void) const;
float Sin(void) const;
float Cos(void) const;
float Tan(void) const;
cSAngle operator-(void) const;
float Degree() const;
float Radian() const;
float Norm() const;
s16 Abs() const;
s16 Inv() const;
float Sin() const;
float Cos() const;
float Tan() const;
cSAngle operator-() const;
cSAngle operator+(const cSAngle&) const;
cSAngle operator-(const cSAngle&) const;
void operator+=(const cSAngle&);
@@ -44,10 +44,10 @@ public:
void operator*=(float);
bool operator<(const cSAngle& other) const { return mAngle < other.mAngle; }
bool operator>(const cSAngle& other) const { return mAngle > other.mAngle; }
operator s16(void) const { return mAngle; }
operator s16() const { return mAngle; }
void operator=(const cSAngle& other) { mAngle = other.mAngle; }
static inline cSAngle getMaxNegative(void) { return cSAngle((s16)-0x8000); }
inline void mirrorAtMaxNeg(void) { *this = cSAngle((s16)-0x8000) - *this; }
static inline cSAngle getMaxNegative() { return cSAngle((s16)-0x8000); }
inline void mirrorAtMaxNeg() { *this = cSAngle((s16)-0x8000) - *this; }
};
cSAngle operator+(short, const cSAngle&);
@@ -91,11 +91,11 @@ public:
cDegree(float);
~cDegree() {}
cDegree& Formal(void);
cDegree& Formal();
void Val(float);
float Radian(void) const;
float Sin(void) const;
float Cos(void) const;
float Radian() const;
float Sin() const;
float Cos() const;
};
class cSPolar {
@@ -107,10 +107,10 @@ private:
public:
cSPolar() {}
cSPolar(const cXyz&);
cSPolar& Formal(void);
cSPolar& Formal();
void Val(float, short, short);
void Val(const cXyz&);
cXyz Xyz(void) const;
cXyz Xyz() const;
void Globe(class cSGlobe*) const;
};
@@ -126,18 +126,18 @@ public:
cSGlobe(float, const cSAngle&, const cSAngle&);
cSGlobe(const cXyz&);
~cSGlobe() {}
cSGlobe& Formal(void);
cSGlobe& Formal();
void Val(const cSGlobe&);
void Val(float, short, short);
void Val(float, const cSAngle&, const cSAngle&);
void Val(const cXyz&);
float R(void) const { return mRadius; }
const cSAngle& V(void) const { return mAzimuth; }
const cSAngle& U(void) const { return mInclination; }
cXyz Xyz(void) const;
float R() const { return mRadius; }
const cSAngle& V() const { return mAzimuth; }
const cSAngle& U() const { return mInclination; }
cXyz Xyz() const;
void Polar(cSPolar*) const;
cXyz Norm(void) const;
cSGlobe& Invert(void);
cXyz Norm() const;
cSGlobe& Invert();
};
#endif /* C_ANGLE_H */
+3 -3
View File
@@ -326,7 +326,7 @@ void cSGlobe::Polar(cSPolar* csp) const {
}
/* 80254864-80254890 .text Invert__7cSGlobeFv */
cXyz cSGlobe::Norm() const {
cSGlobe glob(1.0f, mAzimuth, mInclination);
return glob.Xyz();
cSGlobe& cSGlobe::Invert() {
mRadius = -mRadius;
return Formal();
}
+1 -1
View File
@@ -10,5 +10,5 @@
cBgS_GndChk::cBgS_GndChk() {
m_pos = cXyz::Zero;
setActorPid(0xFFFFFFFF);
mFlags = 2;
mFlags = 3;
}
+1 -1
View File
@@ -366,7 +366,7 @@ s32 cLib_distanceAngleS(s16 x, s16 y) {
return abs(static_cast<s16>(x - y));
}
static Mtx mtx[10];
Mtx mtx[10];
Mtx* calc_mtx = mtx;
+4
View File
@@ -153,3 +153,7 @@ bool cXyz::isZero(void) const {
return fabsf(this->x) < 3.8146972e-06f && fabsf(this->y) < 3.8146972e-06f &&
fabsf(this->z) < 3.8146972e-06f;
}
// Unused, but must be in .rodata to match
static const char * fmt0 = "[%f %f %f]\n";
static const char * fmt1 = "%s=[%f %f %f]\n";