Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions src/SB/Core/x/xEnt.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,38 @@ struct xEntFrame

// Offset: 0xE0
U32 mode;

xEntFrame& operator=(const xEntFrame& rhs)
{
mat = rhs.mat;
oldmat = rhs.oldmat;
*(S32*)(&oldvel.x) = *(S32*)(&rhs.oldvel.x);
*(S32*)(&oldvel.y) = *(S32*)(&rhs.oldvel.y);
*(S32*)(&oldvel.z) = *(S32*)(&rhs.oldvel.z);
Comment on lines +83 to +89
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is probably a compiler generated assignment function. That's the only way I know to get it to copy floats via the regular registers. Do things work ok if you delete this function?

*(S32*)(&oldrot.axis.x) = *(S32*)(&rhs.oldrot.axis.x);
*(S32*)(&oldrot.axis.y) = *(S32*)(&rhs.oldrot.axis.y);
*(S32*)(&oldrot.axis.z) = *(S32*)(&rhs.oldrot.axis.z);
*(S32*)(&oldrot.angle) = *(S32*)(&rhs.oldrot.angle);
*(S32*)(&drot.axis.x) = *(S32*)(&rhs.drot.axis.x);
*(S32*)(&drot.axis.y) = *(S32*)(&rhs.drot.axis.y);
*(S32*)(&drot.axis.z) = *(S32*)(&rhs.drot.axis.z);
*(S32*)(&drot.angle) = *(S32*)(&rhs.drot.angle);
*(S32*)(&rot.axis.x) = *(S32*)(&rhs.rot.axis.x);
*(S32*)(&rot.axis.y) = *(S32*)(&rhs.rot.axis.y);
*(S32*)(&rot.axis.z) = *(S32*)(&rhs.rot.axis.z);
*(S32*)(&rot.angle) = *(S32*)(&rhs.rot.angle);
*(S32*)(&dpos.x) = *(S32*)(&rhs.dpos.x);
*(S32*)(&dpos.y) = *(S32*)(&rhs.dpos.y);
*(S32*)(&dpos.z) = *(S32*)(&rhs.dpos.z);
*(S32*)(&dvel.x) = *(S32*)(&rhs.dvel.x);
*(S32*)(&dvel.y) = *(S32*)(&rhs.dvel.y);
*(S32*)(&dvel.z) = *(S32*)(&rhs.dvel.z);
*(S32*)(&vel.x) = *(S32*)(&rhs.vel.x);
*(S32*)(&vel.y) = *(S32*)(&rhs.vel.y);
*(S32*)(&vel.z) = *(S32*)(&rhs.vel.z);
mode = rhs.mode;
return *this;
}
};

struct xEntCollis
Expand Down
40 changes: 40 additions & 0 deletions src/SB/Core/x/xEntDrive.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,17 @@ struct xEntDrive
xVec3 loc;
F32 yaw;
const xCollis* coll;

tri_data& operator=(const tri_data& rhs)
{
xCollis::tri_data::operator=(rhs);
*(S32*)(&loc.x) = *(S32*)(&rhs.loc.x);
*(S32*)(&loc.y) = *(S32*)(&rhs.loc.y);
*(S32*)(&loc.z) = *(S32*)(&rhs.loc.z);
Comment on lines +15 to +20
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment

yaw = rhs.yaw;
coll = rhs.coll;
return *this;
}
};

U32 flags;
Expand All @@ -31,6 +42,35 @@ struct xEntDrive

// 0x5c
tri_data tri;

xEntDrive& operator=(const xEntDrive& rhs)
{
flags = rhs.flags;
otm = rhs.otm;
otmr = rhs.otmr;
os = rhs.os;
tm = rhs.tm;
tmr = rhs.tmr;
s = rhs.s;
odriver = rhs.odriver;
driver = rhs.driver;
driven = rhs.driven;
*(S32*)(&op.x) = *(S32*)(&rhs.op.x);
*(S32*)(&op.y) = *(S32*)(&rhs.op.y);
Comment on lines +46 to +59
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment

*(S32*)(&op.z) = *(S32*)(&rhs.op.z);
*(S32*)(&p.x) = *(S32*)(&rhs.p.x);
*(S32*)(&p.y) = *(S32*)(&rhs.p.y);
*(S32*)(&p.z) = *(S32*)(&rhs.p.z);
*(S32*)(&q.x) = *(S32*)(&rhs.q.x);
*(S32*)(&q.y) = *(S32*)(&rhs.q.y);
*(S32*)(&q.z) = *(S32*)(&rhs.q.z);
yaw = rhs.yaw;
*(S32*)(&dloc.x) = *(S32*)(&rhs.dloc.x);
*(S32*)(&dloc.y) = *(S32*)(&rhs.dloc.y);
*(S32*)(&dloc.z) = *(S32*)(&rhs.dloc.z);
tri = rhs.tri;
return *this;
}
};

void xEntDriveInit(xEntDrive* drv, xEnt* driven);
Expand Down
14 changes: 14 additions & 0 deletions src/SB/Core/x/xMath3.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,20 @@ struct xBBox
{
xVec3 center;
xBox box;

xBBox& operator=(const xBBox& rhs)
{
*(S32*)(&center.x) = *(S32*)(&rhs.center.x);
*(S32*)(&center.y) = *(S32*)(&rhs.center.y);
Comment on lines +69 to +72
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment

*(S32*)(&center.z) = *(S32*)(&rhs.center.z);
*(S32*)(&box.upper.x) = *(S32*)(&rhs.box.upper.x);
*(S32*)(&box.upper.y) = *(S32*)(&rhs.box.upper.y);
*(S32*)(&box.upper.z) = *(S32*)(&rhs.box.upper.z);
*(S32*)(&box.lower.x) = *(S32*)(&rhs.box.lower.x);
*(S32*)(&box.lower.y) = *(S32*)(&rhs.box.lower.y);
*(S32*)(&box.lower.z) = *(S32*)(&rhs.box.lower.z);
return *this;
}
};

struct xCylinder
Expand Down
Loading
Loading