Skip to content

Commit eaccaff

Browse files
zThrown work
1 parent ce57a90 commit eaccaff

5 files changed

Lines changed: 1568 additions & 24 deletions

File tree

src/SB/Core/x/xEnt.h

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,38 @@ struct xEntFrame
7979

8080
// Offset: 0xE0
8181
U32 mode;
82+
83+
xEntFrame& operator=(const xEntFrame& rhs)
84+
{
85+
mat = rhs.mat;
86+
oldmat = rhs.oldmat;
87+
*(S32*)(&oldvel.x) = *(S32*)(&rhs.oldvel.x);
88+
*(S32*)(&oldvel.y) = *(S32*)(&rhs.oldvel.y);
89+
*(S32*)(&oldvel.z) = *(S32*)(&rhs.oldvel.z);
90+
*(S32*)(&oldrot.axis.x) = *(S32*)(&rhs.oldrot.axis.x);
91+
*(S32*)(&oldrot.axis.y) = *(S32*)(&rhs.oldrot.axis.y);
92+
*(S32*)(&oldrot.axis.z) = *(S32*)(&rhs.oldrot.axis.z);
93+
*(S32*)(&oldrot.angle) = *(S32*)(&rhs.oldrot.angle);
94+
*(S32*)(&drot.axis.x) = *(S32*)(&rhs.drot.axis.x);
95+
*(S32*)(&drot.axis.y) = *(S32*)(&rhs.drot.axis.y);
96+
*(S32*)(&drot.axis.z) = *(S32*)(&rhs.drot.axis.z);
97+
*(S32*)(&drot.angle) = *(S32*)(&rhs.drot.angle);
98+
*(S32*)(&rot.axis.x) = *(S32*)(&rhs.rot.axis.x);
99+
*(S32*)(&rot.axis.y) = *(S32*)(&rhs.rot.axis.y);
100+
*(S32*)(&rot.axis.z) = *(S32*)(&rhs.rot.axis.z);
101+
*(S32*)(&rot.angle) = *(S32*)(&rhs.rot.angle);
102+
*(S32*)(&dpos.x) = *(S32*)(&rhs.dpos.x);
103+
*(S32*)(&dpos.y) = *(S32*)(&rhs.dpos.y);
104+
*(S32*)(&dpos.z) = *(S32*)(&rhs.dpos.z);
105+
*(S32*)(&dvel.x) = *(S32*)(&rhs.dvel.x);
106+
*(S32*)(&dvel.y) = *(S32*)(&rhs.dvel.y);
107+
*(S32*)(&dvel.z) = *(S32*)(&rhs.dvel.z);
108+
*(S32*)(&vel.x) = *(S32*)(&rhs.vel.x);
109+
*(S32*)(&vel.y) = *(S32*)(&rhs.vel.y);
110+
*(S32*)(&vel.z) = *(S32*)(&rhs.vel.z);
111+
mode = rhs.mode;
112+
return *this;
113+
}
82114
};
83115

84116
struct xEntCollis

src/SB/Core/x/xEntDrive.h

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,17 @@ struct xEntDrive
1111
xVec3 loc;
1212
F32 yaw;
1313
const xCollis* coll;
14+
15+
tri_data& operator=(const tri_data& rhs)
16+
{
17+
xCollis::tri_data::operator=(rhs);
18+
*(S32*)(&loc.x) = *(S32*)(&rhs.loc.x);
19+
*(S32*)(&loc.y) = *(S32*)(&rhs.loc.y);
20+
*(S32*)(&loc.z) = *(S32*)(&rhs.loc.z);
21+
yaw = rhs.yaw;
22+
coll = rhs.coll;
23+
return *this;
24+
}
1425
};
1526

1627
U32 flags;
@@ -31,6 +42,35 @@ struct xEntDrive
3142

3243
// 0x5c
3344
tri_data tri;
45+
46+
xEntDrive& operator=(const xEntDrive& rhs)
47+
{
48+
flags = rhs.flags;
49+
otm = rhs.otm;
50+
otmr = rhs.otmr;
51+
os = rhs.os;
52+
tm = rhs.tm;
53+
tmr = rhs.tmr;
54+
s = rhs.s;
55+
odriver = rhs.odriver;
56+
driver = rhs.driver;
57+
driven = rhs.driven;
58+
*(S32*)(&op.x) = *(S32*)(&rhs.op.x);
59+
*(S32*)(&op.y) = *(S32*)(&rhs.op.y);
60+
*(S32*)(&op.z) = *(S32*)(&rhs.op.z);
61+
*(S32*)(&p.x) = *(S32*)(&rhs.p.x);
62+
*(S32*)(&p.y) = *(S32*)(&rhs.p.y);
63+
*(S32*)(&p.z) = *(S32*)(&rhs.p.z);
64+
*(S32*)(&q.x) = *(S32*)(&rhs.q.x);
65+
*(S32*)(&q.y) = *(S32*)(&rhs.q.y);
66+
*(S32*)(&q.z) = *(S32*)(&rhs.q.z);
67+
yaw = rhs.yaw;
68+
*(S32*)(&dloc.x) = *(S32*)(&rhs.dloc.x);
69+
*(S32*)(&dloc.y) = *(S32*)(&rhs.dloc.y);
70+
*(S32*)(&dloc.z) = *(S32*)(&rhs.dloc.z);
71+
tri = rhs.tri;
72+
return *this;
73+
}
3474
};
3575

3676
void xEntDriveInit(xEntDrive* drv, xEnt* driven);

src/SB/Core/x/xMath3.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,20 @@ struct xBBox
6565
{
6666
xVec3 center;
6767
xBox box;
68+
69+
xBBox& operator=(const xBBox& rhs)
70+
{
71+
*(S32*)(&center.x) = *(S32*)(&rhs.center.x);
72+
*(S32*)(&center.y) = *(S32*)(&rhs.center.y);
73+
*(S32*)(&center.z) = *(S32*)(&rhs.center.z);
74+
*(S32*)(&box.upper.x) = *(S32*)(&rhs.box.upper.x);
75+
*(S32*)(&box.upper.y) = *(S32*)(&rhs.box.upper.y);
76+
*(S32*)(&box.upper.z) = *(S32*)(&rhs.box.upper.z);
77+
*(S32*)(&box.lower.x) = *(S32*)(&rhs.box.lower.x);
78+
*(S32*)(&box.lower.y) = *(S32*)(&rhs.box.lower.y);
79+
*(S32*)(&box.lower.z) = *(S32*)(&rhs.box.lower.z);
80+
return *this;
81+
}
6882
};
6983

7084
struct xCylinder

0 commit comments

Comments
 (0)