dMsgScrnTree_c OK, Some JGeometry work (#370)

* Minor work on c_damagereaction and JGeomtry

* dMsgScrnTree_c OK

* dMsgScrnExplain_c OK
This commit is contained in:
hatal175
2023-07-16 13:09:21 -06:00
committed by GitHub
parent fe7fbf37db
commit 0b12611fea
42 changed files with 709 additions and 3288 deletions
+26 -6
View File
@@ -59,11 +59,15 @@ struct TVec3<f32> {
f32 y;
f32 z;
/* TVec3(const Vec& i_vec) {
setTVec3f(&i_vec.x, &x);
} */
// inline TVec3(const Vec& i_vec) {
// setTVec3f(&i_vec.x, &x);
// }
/* TVec3() {} */
// inline TVec3(const TVec3<f32>& i_vec) {
// setTVec3f(&i_vec.x, &x);
// }
// TVec3() {}
operator Vec*() { return (Vec*)&x; }
operator const Vec*() const { return (Vec*)&x; }
@@ -80,6 +84,10 @@ struct TVec3<f32> {
z = z_;
}
inline void add(const TVec3<f32>& b) {
C_VECAdd((Vec*)&x, (Vec*)&b.x, (Vec*)&x);
}
void zero() { x = y = z = 0.0f; }
void mul(const TVec3<f32>& a, const TVec3<f32>& b) {
@@ -104,6 +112,17 @@ struct TVec3<f32> {
};
}
inline TVec3<f32>& operator+=(const TVec3<f32>& b) {
add(b);
return *this;
}
// inline TVec3<f32> operator+(const TVec3<f32>& b) {
// TVec3<f32> res(*(Vec*)this);
// res += b;
// return res;
// }
inline TVec3<f32>& operator=(const TVec3<f32>& b) {
register f32* dst = &x;
const register f32* src = &b.x;
@@ -140,13 +159,14 @@ struct TVec3<f32> {
register f32 z;
register f32 x_y;
register f32* dst = &x;
register f32 zres;
asm {
psq_l x_y, 0(dst), 0, 0
psq_l z, 8(dst), 1, 0
ps_muls0 x_y, x_y, sc
psq_st x_y, 0(dst), 0, 0
ps_muls0 x_y, z, sc
psq_st x_y, 8(dst), 1, 0
ps_muls0 zres, z, sc
psq_st zres, 8(dst), 1, 0
};
}
};
+3 -1
View File
@@ -357,11 +357,13 @@ public:
/* 80280548 */ f32 getWidth(JPABaseEmitter const*) const;
/* 80280568 */ f32 getHeight(JPABaseEmitter const*) const;
int getAge() { return mAge; }
void setOffsetPosition(const JGeometry::TVec3<f32>& pos) { mOffsetPosition.set(pos); }
void getOffsetPosition(JGeometry::TVec3<f32>& pos) { pos.set(mOffsetPosition); }
public:
/* 0x00 */ Vec mPosition;
/* 0x0C */ Vec mLocalPosition;
/* 0x18 */ Vec mOffsetPosition;
/* 0x18 */ JGeometry::TVec3<f32> mOffsetPosition;
/* 0x24 */ Vec mVelocity;
/* 0x30 */ Vec mVelType1;
/* 0x3C */ Vec mVelType0;