diff options
| author | TakaRikka <38417346+TakaRikka@users.noreply.github.com> | 2024-04-21 05:27:47 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-21 15:27:47 +0300 |
| commit | b24b477fc4b641e58069455cdabfe80d5d0995b4 (patch) | |
| tree | 9fa859e8d7bd9be5129191d349cad1da2f61f1a5 /include/JSystem | |
| parent | 151c5099abdddb91c8c4cf3565c0c5075a0e0146 (diff) | |
d_a_tag_firewall done (#2137)
* mostly fix TVec3 ctors
* d_a_tag_firewall done
* remove asm
Diffstat (limited to 'include/JSystem')
| -rw-r--r-- | include/JSystem/J2DGraph/J2DPane.h | 2 | ||||
| -rw-r--r-- | include/JSystem/J3DGraphBase/J3DTransform.h | 13 | ||||
| -rw-r--r-- | include/JSystem/JGeometry.h | 42 |
3 files changed, 23 insertions, 34 deletions
diff --git a/include/JSystem/J2DGraph/J2DPane.h b/include/JSystem/J2DGraph/J2DPane.h index 09f8c388fd..ae13d386bb 100644 --- a/include/JSystem/J2DGraph/J2DPane.h +++ b/include/JSystem/J2DGraph/J2DPane.h @@ -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(); diff --git a/include/JSystem/J3DGraphBase/J3DTransform.h b/include/JSystem/J3DGraphBase/J3DTransform.h index 0a327c4c48..d4c7bed2ce 100644 --- a/include/JSystem/J3DGraphBase/J3DTransform.h +++ b/include/JSystem/J3DGraphBase/J3DTransform.h @@ -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; diff --git a/include/JSystem/JGeometry.h b/include/JSystem/JGeometry.h index 29eabce378..bbdf2a0e2f 100644 --- a/include/JSystem/JGeometry.h +++ b/include/JSystem/JGeometry.h @@ -85,20 +85,16 @@ inline float fsqrt_step(float mag) { } template <> -struct TVec3<f32> { - f32 x; - f32 y; - f32 z; - - // inline TVec3(const Vec& i_vec) { - // setTVec3f(&i_vec.x, &x); - // } +struct TVec3<f32> : public Vec { + 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); } |
