diff --git a/LEGO1/mxdsaction.cpp b/LEGO1/mxdsaction.cpp index 7b977d1f..a62ecfd3 100644 --- a/LEGO1/mxdsaction.cpp +++ b/LEGO1/mxdsaction.cpp @@ -51,10 +51,9 @@ void MxDSAction::CopyFrom(MxDSAction &p_dsAction) this->m_duration = p_dsAction.m_duration; this->m_loopCount = p_dsAction.m_loopCount; - // TODO - // this->m_location.SetVector(p_dsAction.m_location.GetData()); - // this->m_direction.SetVector(p_dsAction.m_direction.GetData()); - // this->m_up.SetVector(p_dsAction.m_up.GetData()); + this->m_location.CopyFrom(p_dsAction.m_location); + this->m_direction.CopyFrom(p_dsAction.m_direction); + this->m_up.CopyFrom(p_dsAction.m_up); FUN_100ADE60(p_dsAction.m_unk80, p_dsAction.m_unk7c); this->m_unk84 = p_dsAction.m_unk84; @@ -221,4 +220,4 @@ MxLong MxDSAction::GetCurrentTime() void MxDSAction::FUN_100ADE60(MxU16 p_length, void *p_data) { // TOOD -} \ No newline at end of file +} diff --git a/LEGO1/mxvector.h b/LEGO1/mxvector.h index e55e8d56..ae58abd9 100644 --- a/LEGO1/mxvector.h +++ b/LEGO1/mxvector.h @@ -57,8 +57,8 @@ class MxVector2 virtual void DivScalar(float *p_value); // vtable + 0x6C - virtual void SetVector(MxVector2 *other); - virtual void SetVector(float *other); + virtual void SetVector(MxVector2 *p_other); + virtual void SetVector(float *p_other); inline float& operator[](size_t idx) { return m_data[idx]; } inline const float operator[](size_t idx) const { return m_data[idx]; } @@ -134,12 +134,29 @@ class MxVector4 : public MxVector3 class MxVector3Data : public MxVector3 { public: - inline MxVector3Data() : MxVector3(&x) {} + inline MxVector3Data() : MxVector3(storage) {} inline MxVector3Data(float p_x, float p_y, float p_z) - : MxVector3(&x) + : MxVector3(storage) , x(p_x), y(p_y), z(p_z) {} - float x, y, z; + + union { + float storage[3]; + struct { + float x; + float y; + float z; + }; + }; + + void CopyFrom(MxVector3Data &p_other) { + EqualsImpl(p_other.m_data); + + float *dest = this->storage; + float *src = p_other.storage; + for (size_t i = sizeof(storage) / sizeof(float); i > 0; --i) + *dest++ = *src++; + } }; // VTABLE 0x100d41e8 @@ -147,8 +164,16 @@ class MxVector3Data : public MxVector3 class MxVector4Data : public MxVector4 { public: - inline MxVector4Data() : MxVector4(&x) {} - float x, y, z, w; + inline MxVector4Data() : MxVector4(storage) {} + union { + float storage[4]; + struct { + float x; + float y; + float z; + float w; + }; + }; }; -#endif // MXVECTOR_H \ No newline at end of file +#endif // MXVECTOR_H