diff --git a/LEGO1/mxdsactionlist.h b/LEGO1/mxdsactionlist.h index 127dd142..fe0e162c 100644 --- a/LEGO1/mxdsactionlist.h +++ b/LEGO1/mxdsactionlist.h @@ -8,7 +8,7 @@ class MxDSAction; // VTABLE 0x100dced8 // SIZE 0x1c -class MxDSActionList : public MxList +class MxDSActionList : public MxList { public: MxDSActionList() { @@ -23,15 +23,15 @@ class MxDSActionList : public MxList undefined m_unk18; }; -typedef MxListCursorChild MxDSActionListCursor; +typedef MxListCursorChild MxDSActionListCursor; + +// OFFSET: LEGO1 0x100c9cc0 TEMPLATE +// MxListParent::Compare // OFFSET: LEGO1 0x100c9d20 TEMPLATE -// MxListParent::Destroy - -// OFFSET: LEGO1 0x100c9cd0 TEMPLATE -// MxListParent::~MxListParent +// MxListParent::Destroy // OFFSET: LEGO1 0x100c9d30 TEMPLATE -// MxList::~MxList +// MxList::~MxList #endif // MXDSACTIONLIST_H diff --git a/LEGO1/mxdsselectaction.cpp b/LEGO1/mxdsselectaction.cpp index 1c21b466..29f69022 100644 --- a/LEGO1/mxdsselectaction.cpp +++ b/LEGO1/mxdsselectaction.cpp @@ -5,12 +5,13 @@ DECOMP_SIZE_ASSERT(MxDSSelectAction, 0xb0) // OFFSET: LEGO1 0x100cb2b0 MxDSSelectAction::MxDSSelectAction() { - // TODO this->SetType(MxDSType_SelectAction); + this->m_unk0xac = new MxStringList; } -// OFFSET: LEGO1 0x100cb8d0 STUB +// OFFSET: LEGO1 0x100cb8d0 MxDSSelectAction::~MxDSSelectAction() { - // TODO + if (this->m_unk0xac) + delete this->m_unk0xac; } diff --git a/LEGO1/mxdsselectaction.h b/LEGO1/mxdsselectaction.h index df956fbc..d513efd0 100644 --- a/LEGO1/mxdsselectaction.h +++ b/LEGO1/mxdsselectaction.h @@ -2,6 +2,7 @@ #define MXDSSELECTACTION_H #include "mxdsparallelaction.h" +#include "mxstringlist.h" #include "decomp.h" // VTABLE 0x100dcfc8 @@ -25,12 +26,9 @@ class MxDSSelectAction : public MxDSParallelAction return !strcmp(name, MxDSSelectAction::ClassName()) || MxDSParallelAction::IsA(name); } - undefined4 m_unk0x9c; - undefined4 m_unk0xa0; - undefined4 m_unk0xa4; - undefined4 m_unk0xa8; - undefined4 m_unk0xac; - +private: + MxString m_unk0x9c; + MxStringList *m_unk0xac; }; #endif // MXDSSELECTACTION_H diff --git a/LEGO1/mxlist.h b/LEGO1/mxlist.h index ed4c2802..12695f82 100644 --- a/LEGO1/mxlist.h +++ b/LEGO1/mxlist.h @@ -4,19 +4,24 @@ #include "mxtypes.h" #include "mxcore.h" -template // SIZE 0xc +template class MxListEntry { public: MxListEntry() {} - MxListEntry(T *p_obj, MxListEntry *p_prev) { + MxListEntry(T p_obj, MxListEntry *p_prev) { m_obj = p_obj; m_prev = p_prev; m_next = NULL; } - T *m_obj; + T GetValue() { return this->m_obj; } + + friend class MxList; + friend class MxListCursor; +private: + T m_obj; MxListEntry *m_prev; MxListEntry *m_next; }; @@ -33,12 +38,12 @@ class MxListParent : public MxCore } virtual ~MxListParent() {} - virtual MxS8 Compare(T *, T *) = 0; + virtual MxS8 Compare(T, T) { return 0; }; - static void Destroy(T *) {}; + static void Destroy(T) {}; protected: MxU32 m_count; // +0x8 - void (*m_customDestructor)(T *); // +0xc + void (*m_customDestructor)(T); // +0xc }; // VTABLE 0x100d6368 @@ -54,13 +59,12 @@ class MxList : protected MxListParent virtual ~MxList(); - void Append(T*); + void Append(T); void DeleteAll(); MxU32 GetCount() { return m_count; } - void SetDestroy(void (*p_customDestructor)(T *)) { this->m_customDestructor = p_customDestructor; } + void SetDestroy(void (*p_customDestructor)(T)) { this->m_customDestructor = p_customDestructor; } friend class MxListCursor; - protected: MxListEntry *m_first; // +0x10 MxListEntry *m_last; // +0x14 @@ -79,10 +83,10 @@ class MxListCursor : public MxCore m_match = NULL; } - MxBool Find(T *p_obj); + MxBool Find(T p_obj); void Detach(); - MxBool Next(T*& p_obj); - void SetValue(T *p_obj); + MxBool Next(T& p_obj); + void SetValue(T p_obj); void Head() { m_match = m_list->m_first; } void Reset() { m_match = NULL; } @@ -123,7 +127,7 @@ inline void MxList::DeleteAll() break; MxListEntry *next = t->m_next; - m_customDestructor(t->m_obj); + m_customDestructor(t->GetValue()); delete t; t = next; } @@ -134,7 +138,7 @@ inline void MxList::DeleteAll() } template -inline void MxList::Append(T *p_newobj) +inline void MxList::Append(T p_newobj) { MxListEntry *currentLast = this->m_last; MxListEntry *newEntry = new MxListEntry(p_newobj, currentLast); @@ -169,7 +173,7 @@ inline void MxList::_DeleteEntry(MxListEntry *match) } template -inline MxBool MxListCursor::Find(T *p_obj) +inline MxBool MxListCursor::Find(T p_obj) { for (m_match = m_list->m_first; m_match && m_list->Compare(m_match->m_obj, p_obj); @@ -186,7 +190,7 @@ inline void MxListCursor::Detach() } template -inline MxBool MxListCursor::Next(T*& p_obj) +inline MxBool MxListCursor::Next(T& p_obj) { if (!m_match) m_match = m_list->m_first; @@ -200,7 +204,7 @@ inline MxBool MxListCursor::Next(T*& p_obj) } template -inline void MxListCursor::SetValue(T *p_obj) +inline void MxListCursor::SetValue(T p_obj) { if (m_match) m_match->m_obj = p_obj; diff --git a/LEGO1/mxpresenterlist.h b/LEGO1/mxpresenterlist.h index 71a7f9aa..0ee54a85 100644 --- a/LEGO1/mxpresenterlist.h +++ b/LEGO1/mxpresenterlist.h @@ -8,7 +8,7 @@ class MxPresenter; // Unclear what the purpose of this class is // VTABLE 0x100d62f0 // SIZE 0x18 -class MxPresenterListParent : public MxList +class MxPresenterListParent : public MxList { public: MxPresenterListParent() { @@ -24,15 +24,15 @@ class MxPresenterList : public MxPresenterListParent virtual MxS8 Compare(MxPresenter *, MxPresenter *); // +0x14 }; -typedef MxListCursorChildChild MxPresenterListCursor; +typedef MxListCursorChildChild MxPresenterListCursor; + +// OFFSET: LEGO1 0x1001cd20 TEMPLATE +// MxListParent::Compare // OFFSET: LEGO1 0x1001cd30 TEMPLATE -// MxListParent::Destroy - -// OFFSET: LEGO1 0x1001cdd0 TEMPLATE -// MxListParent::~MxListParent +// MxListParent::Destroy // OFFSET: LEGO1 0x1001ce20 TEMPLATE -// MxList::~MxList +// MxList::~MxList #endif // MXPRESENTERLIST_H diff --git a/LEGO1/mxstringlist.h b/LEGO1/mxstringlist.h new file mode 100644 index 00000000..dbf063f6 --- /dev/null +++ b/LEGO1/mxstringlist.h @@ -0,0 +1,23 @@ +#ifndef MXSTRINGLIST_H +#define MXSTRINGLIST_H + +#include "mxlist.h" +#include "mxstring.h" + +// VTABLE 0x100dd040 +// SIZE 0x18 +class MxStringList : public MxList {}; + +// OFFSET: LEGO1 0x100cb3c0 TEMPLATE +// MxListParent::Compare + +// OFFSET: LEGO1 0x100cb470 TEMPLATE +// MxListParent::Destroy + +// OFFSET: LEGO1 0x100cb4c0 TEMPLATE +// MxList::~MxList + +// OFFSET: LEGO1 0x100cc450 TEMPLATE +// MxListEntry::GetValue + +#endif // MXSTRINGLIST_H