From c48fc69cf37d117ddcbc770bd6823fea23070e5e Mon Sep 17 00:00:00 2001 From: Christian Semmler Date: Sun, 6 Aug 2023 13:39:22 -0400 Subject: [PATCH] Implement/match MxDSAction constructor (#101) * Implement MxDSAction constructor * Update mxdsaction.cpp --- LEGO1/mxdsaction.cpp | 33 ++++++++++++++++++++++++++++++--- LEGO1/mxdsaction.h | 37 +++++++++++++------------------------ LEGO1/mxvector.cpp | 6 ------ LEGO1/mxvector.h | 6 ++++-- 4 files changed, 47 insertions(+), 35 deletions(-) diff --git a/LEGO1/mxdsaction.cpp b/LEGO1/mxdsaction.cpp index b5cf6e75..d6e1fdb5 100644 --- a/LEGO1/mxdsaction.cpp +++ b/LEGO1/mxdsaction.cpp @@ -1,16 +1,43 @@ #include "mxdsaction.h" +#include +#include + // OFFSET: LEGO1 0x100ad810 MxDSAction::MxDSAction() { - // TODO + this->m_flags = 32; + this->m_startTime = INT_MIN; + this->m_unk7c = NULL; + this->m_unk80 = 0; + this->m_duration = INT_MIN; + this->m_loopCount = -1; + this->SetType(MxDSType_Action); + + { + float value = FLT_MAX; + this->m_location.EqualsScalar(&value); + } + + { + float value = FLT_MAX; + this->m_direction.EqualsScalar(&value); + } + + { + float value = FLT_MAX; + this->m_up.EqualsScalar(&value); + } + + this->m_unk84 = 0; + this->m_unk88 = 0; this->m_omni = NULL; - this->m_someTimingField = -0x80000000; + this->m_someTimingField = INT_MIN; } // OFFSET: LEGO1 0x100ada80 MxDSAction::~MxDSAction() { delete this->m_unk7c; -} \ No newline at end of file +} diff --git a/LEGO1/mxdsaction.h b/LEGO1/mxdsaction.h index 155d7cc2..10a14365 100644 --- a/LEGO1/mxdsaction.h +++ b/LEGO1/mxdsaction.h @@ -2,6 +2,7 @@ #define MXDSACTION_H #include "mxdsobject.h" +#include "mxvector.h" #include "mxomni.h" // VTABLE 0x100dc098 @@ -25,30 +26,18 @@ class MxDSAction : public MxDSObject return !strcmp(name, MxDSAction::ClassName()) || MxDSObject::IsA(name); } private: - MxLong m_unk2c; - MxLong m_unk30; - MxLong m_unk34; - MxLong* m_unk38; - MxLong m_unk3c; - MxLong m_unk40; - MxLong m_unk44; - MxLong m_unk48; - MxLong m_unk4c; - MxLong m_unk50; - MxLong m_unk54; - MxLong m_unk58; - MxLong m_unk5c; - MxLong m_unk60; - MxLong m_unk64; - MxLong m_unk68; - MxLong m_unk6c; - MxLong m_unk70; - MxLong m_unk74; - MxLong m_unk78; - MxLong* m_unk7c; - MxLong m_unk80; - MxLong m_unk84; - MxLong m_unk88; + undefined4 m_unk2c; + DWORD m_flags; + DWORD m_startTime; + LONG m_duration; + MxS32 m_loopCount; + MxVector3Data m_location; + MxVector3Data m_direction; + MxVector3Data m_up; + undefined4 *m_unk7c; + undefined2 m_unk80; + undefined4 m_unk84; + undefined4 m_unk88; MxOmni* m_omni; // 0x8c MxS32 m_someTimingField; // 0x90 }; diff --git a/LEGO1/mxvector.cpp b/LEGO1/mxvector.cpp index 80ca1a17..a4053105 100644 --- a/LEGO1/mxvector.cpp +++ b/LEGO1/mxvector.cpp @@ -12,12 +12,6 @@ DECOMP_SIZE_ASSERT(MxVector4, 0x8); DECOMP_SIZE_ASSERT(MxVector3Data, 0x14); DECOMP_SIZE_ASSERT(MxVector4Data, 0x18); -// OFFSET: LEGO1 0x10002060 -void MxVector2::SetData(float *p_data) -{ - m_data = p_data; -} - // OFFSET: LEGO1 0x100020a0 const float *MxVector2::GetData() const { diff --git a/LEGO1/mxvector.h b/LEGO1/mxvector.h index 0b766348..f5b8e686 100644 --- a/LEGO1/mxvector.h +++ b/LEGO1/mxvector.h @@ -9,7 +9,7 @@ class MxVector2 { public: // OFFSET: LEGO1 0x1000c0f0 - inline MxVector2(float* p_data) : m_data(p_data) {} + inline MxVector2(float* p_data) { this->SetData(p_data); } // vtable + 0x00 (no virtual destructor) virtual void AddScalarImpl(float p_value) = 0; @@ -21,7 +21,9 @@ class MxVector2 virtual void MullVectorImpl(float *p_value) = 0; virtual void DivScalarImpl(float *p_value) = 0; virtual float DotImpl(float *p_a, float *p_b) const = 0; - virtual void SetData(float *p_data); + + // OFFSET: LEGO1 0x10002060 + virtual void SetData(float *p_data) { this->m_data = p_data; } // vtable + 0x20 virtual void EqualsImpl(float *p_data) = 0;