diff --git a/include/JSystem/JGeometry.h b/include/JSystem/JGeometry.h index 42e24bd95..0fba56eab 100644 --- a/include/JSystem/JGeometry.h +++ b/include/JSystem/JGeometry.h @@ -57,7 +57,7 @@ template <> struct TVec3 : public SVec { TVec3() {} TVec3(const SVec& b) { set(b); } - TVec3(const s16 x, const s16 y, const s16 z) { set(x, y, z); } + TVec3(s16 x, s16 y, s16 z) { set(x, y, z); } void set(const SVec& vec) { x = vec.x; @@ -82,7 +82,7 @@ template <> struct TVec3 : public Vec { TVec3() {} - TVec3(const f32 x, const f32 y, const f32 z) { set((f32)x, (f32)y, (f32)z); } + TVec3(f32 x, f32 y, f32 z) { set(x, y, z); } TVec3(const Vec& b) { set(b); } @@ -91,9 +91,9 @@ struct TVec3 : public Vec { template void set(const TVec3& other) { - x = (f32)other.x; - y = (f32)other.y; - z = (f32)other.z; + x = other.x; + y = other.y; + z = other.z; } void set(const Vec& vec) { diff --git a/src/d/actor/d_a_npc_md.cpp b/src/d/actor/d_a_npc_md.cpp index b13479112..c44688fc5 100644 --- a/src/d/actor/d_a_npc_md.cpp +++ b/src/d/actor/d_a_npc_md.cpp @@ -5998,10 +5998,7 @@ void daNpc_Md_c::emitterTrace(JPABaseEmitter* emitter, MtxP mtx, csXyz* angle) { JGeometry::TVec3 pos(mtx[0][3], mtx[1][3], mtx[2][3]); emitter->setGlobalTranslation(pos); if (angle) { - JGeometry::TVec3 rot; - rot.z = angle->z; - rot.y = angle->y; - rot.x = angle->x; + JGeometry::TVec3 rot(angle->x, angle->y, angle->z); emitter->setGlobalRotation(rot); } } @@ -6069,10 +6066,7 @@ static BOOL daNpc_Md_IsDelete(daNpc_Md_c* i_this) { /* 0001114C-0001119C .text execute__26daNpc_Md_followEcallBack_cFP14JPABaseEmitter */ void daNpc_Md_followEcallBack_c::execute(JPABaseEmitter* emitter) { emitter->setGlobalTranslation(mPos.x, mPos.y, mPos.z); - JGeometry::TVec3 rot; - rot.z = mAngle.z; - rot.y = mAngle.y; - rot.x = mAngle.x; + JGeometry::TVec3 rot(mAngle.x, mAngle.y, mAngle.z); emitter->setGlobalRotation(rot); } diff --git a/src/d/actor/d_a_player_particle.inc b/src/d/actor/d_a_player_particle.inc index 953f49d02..0240ae271 100644 --- a/src/d/actor/d_a_player_particle.inc +++ b/src/d/actor/d_a_player_particle.inc @@ -77,8 +77,7 @@ void daPy_swimTailEcallBack_c::execute(JPABaseEmitter* emitter) { if (field_0x20 != NULL) { emitter->setGlobalTranslation(mPos.x, mPos.y, mPos.z); - JGeometry::TVec3 rot(0, 0, 0); - rot.y = field_0x20->y; + JGeometry::TVec3 rot(0, field_0x20->y, 0); emitter->setGlobalRotation(rot); }else { JGeometry::TVec3 sp20; @@ -381,8 +380,7 @@ void daPy_waterDropPcallBack_c::execute(JPABaseEmitter* emitter, JPABaseParticle /* 80129F48-80129F98 .text execute__22daPy_followEcallBack_cFP14JPABaseEmitter */ void daPy_followEcallBack_c::execute(JPABaseEmitter* emitter) { emitter->setGlobalTranslation(mPos.x, mPos.y, mPos.z); - JGeometry::TVec3 rot; - rot.set(mAngle.x, mAngle.y, mAngle.z); + JGeometry::TVec3 rot(mAngle.x, mAngle.y, mAngle.z); emitter->setGlobalRotation(rot); } diff --git a/src/d/actor/d_a_steam_tag.cpp b/src/d/actor/d_a_steam_tag.cpp index d578f46b0..d63eb31b6 100644 --- a/src/d/actor/d_a_steam_tag.cpp +++ b/src/d/actor/d_a_steam_tag.cpp @@ -131,15 +131,7 @@ BOOL daSteamTag_c::execute() { mCreateTimer--; if (mCreateTimer == 0) { if (createEmitter()) { - // TODO: Fakematch? The demo debug map indicates TVec3(s16, s16, s16) constructor - // was used here, but just doing that doesn't match for either the demo or retail. - // Assigning x/y/z with 3 individual assignments matches for retail, but doesn't - // match for the demo. However, first using the TVec3(s16, s16, s16) ctor and then - // *also* assigning x/y/z separately matches for both demo and retail. JGeometry::TVec3 angle(current.angle.x, current.angle.y, current.angle.z); - angle.x = current.angle.x; - angle.y = current.angle.y; - angle.z = current.angle.z; JGeometry::TVec3 pos(current.pos.x, current.pos.y, current.pos.z); mpEmitter->setGlobalTranslation(pos); mpEmitter->setGlobalRotation(angle); diff --git a/src/d/d_particle.cpp b/src/d/d_particle.cpp index 20d9c4b76..c26a7457d 100644 --- a/src/d/d_particle.cpp +++ b/src/d/d_particle.cpp @@ -1049,10 +1049,7 @@ void dPa_waveEcallBack::executeAfter(JPABaseEmitter* emitter) { } f32 speed = mVelFade1 * vel * mVelFade2; - JGeometry::TVec3 rot; - rot.x = 0; - rot.y = mpRot->y; - rot.z = 0; + JGeometry::TVec3 rot(0, mpRot->y, 0); emitter->setGlobalRotation(rot); if (std::fabsf(speed - mVel) > mVelSpeed) {