d_a_tag_firewall done (#2137)

* mostly fix TVec3 ctors

* d_a_tag_firewall done

* remove asm
This commit is contained in:
TakaRikka
2024-04-21 05:27:47 -07:00
committed by GitHub
parent 151c5099ab
commit b24b477fc4
27 changed files with 369 additions and 1222 deletions
+1 -1
View File
@@ -69,7 +69,7 @@ public:
void clip(const JGeometry::TBox2<f32>& bounds);
void setBasePosition(J2DBasePosition position);
void setInfluencedAlpha(bool arg1, bool arg2);
JGeometry::TVec3<f32> getGlbVtx(u8 arg1) const;
Vec getGlbVtx(u8 arg1) const;
J2DPane* getFirstChildPane();
J2DPane* getNextChildPane();
J2DPane* getParentPane();
+10 -3
View File
@@ -10,10 +10,17 @@ struct J3DTextureSRTInfo;
* @ingroup jsystem-j3d
*
*/
struct J3DTransformInfo {
/* 0x00 */ JGeometry::TVec3<f32> mScale;
/* 0x0C */ JGeometry::TVec3<s16> mRotation;
/* 0x14 */ JGeometry::TVec3<f32> mTranslate;
/* 0x00 */ Vec mScale;
/* 0x0C */ SVec mRotation;
/* 0x14 */ Vec mTranslate;
inline J3DTransformInfo& operator=(const J3DTransformInfo& b) {
mScale = b.mScale;
mRotation = b.mRotation;
mTranslate = b.mTranslate;
return *this;
}
}; // Size: 0x20
extern J3DTransformInfo const j3dDefaultTransformInfo;
+12 -30
View File
@@ -85,20 +85,16 @@ inline float fsqrt_step(float mag) {
}
template <>
struct TVec3<f32> {
f32 x;
f32 y;
f32 z;
struct TVec3<f32> : public Vec {
inline TVec3(const Vec& i_vec) {
setTVec3f(&i_vec.x, &x);
}
// inline TVec3(const Vec& i_vec) {
// setTVec3f(&i_vec.x, &x);
// }
inline TVec3(const TVec3<f32>& i_vec) {
setTVec3f(&i_vec.x, &x);
}
// inline TVec3(const TVec3<f32>& i_vec) {
// setTVec3f(&i_vec.x, &x);
// }
// TVec3() {}
TVec3() {}
operator Vec*() { return (Vec*)&x; }
operator const Vec*() const { return (Vec*)&x; }
@@ -148,10 +144,10 @@ struct TVec3<f32> {
return *this;
}
// inline TVec3<f32>& operator=(const TVec3<f32>& b) {
// setTVec3f(&b.x, &this->x);
// return *this;
// }
inline TVec3<f32>& operator=(const TVec3<f32>& b) {
set(b.x, b.y, b.z);
return *this;
}
inline TVec3<f32>& operator+=(const TVec3<f32>& b) {
add(b);
@@ -164,20 +160,6 @@ struct TVec3<f32> {
// return res;
// }
inline TVec3<f32>& operator=(const TVec3<f32>& b) {
register f32* dst = &x;
const register f32* src = &b.x;
register f32 x_y;
register f32 z;
asm {
psq_l x_y, 0(src), 0, 0
psq_st x_y, 0(dst), 0, 0
lfs z, 8(src)
stfs z, 8(dst)
};
return *this;
}
f32 squared() const {
return C_VECSquareMag((Vec*)&x);
}