From 0bb3ea6a0304e6c31f9ea62ba0ccddb3cf6d8c30 Mon Sep 17 00:00:00 2001 From: MS Date: Sun, 19 Nov 2023 07:23:30 -0500 Subject: [PATCH] MxList refactor (#290) * MxList refactor * Reorder LegoPathControllerList::Destroy * MxPtrList custom destructor and more offsets Co-authored-by: Christian Semmler * Fix member offset comments in collection classes * Fix template annotations --------- Co-authored-by: Christian Semmler --- CMakeLists.txt | 1 + LEGO1/legoinputmanager.cpp | 25 ++++++++++++++ LEGO1/legoinputmanager.h | 43 ++++++----------------- LEGO1/legopathcontrollerlist.cpp | 42 +++++++++++++++++++++++ LEGO1/legopathcontrollerlist.h | 26 ++++++++++++++ LEGO1/legoworld.h | 11 ++++-- LEGO1/mxcollection.h | 4 +-- LEGO1/mxdsactionlist.cpp | 15 ++++++++ LEGO1/mxdsactionlist.h | 17 ++++----- LEGO1/mxhashtable.h | 22 ++++++------ LEGO1/mxlist.h | 33 ++++++------------ LEGO1/mxpresenterlist.cpp | 24 +++++++++++++ LEGO1/mxpresenterlist.h | 24 +++++-------- LEGO1/mxregion.h | 2 +- LEGO1/mxregionlist.cpp | 49 ++++++++++++++++++++++++-- LEGO1/mxregionlist.h | 59 ++++++++++++++------------------ LEGO1/mxstreamchunklist.cpp | 15 ++++++++ LEGO1/mxstreamchunklist.h | 20 ++++------- LEGO1/mxstringlist.cpp | 21 ++++++++++++ LEGO1/mxstringlist.h | 21 ------------ LEGO1/mxvariabletable.h | 4 +-- 21 files changed, 308 insertions(+), 170 deletions(-) create mode 100644 LEGO1/legopathcontrollerlist.cpp create mode 100644 LEGO1/legopathcontrollerlist.h diff --git a/CMakeLists.txt b/CMakeLists.txt index a297f7f4..d5bc8ae3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -83,6 +83,7 @@ add_library(lego1 SHARED LEGO1/legopartpresenter.cpp LEGO1/legopathactor.cpp LEGO1/legopathcontroller.cpp + LEGO1/legopathcontrollerlist.cpp LEGO1/legopathpresenter.cpp LEGO1/legophonemepresenter.cpp LEGO1/legoplantmanager.cpp diff --git a/LEGO1/legoinputmanager.cpp b/LEGO1/legoinputmanager.cpp index e9a82cc6..fb0fc079 100644 --- a/LEGO1/legoinputmanager.cpp +++ b/LEGO1/legoinputmanager.cpp @@ -5,6 +5,7 @@ #include "mxautolocker.h" DECOMP_SIZE_ASSERT(LegoInputManager, 0x338); +DECOMP_SIZE_ASSERT(LegoEventQueue, 0x18); // OFFSET: LEGO1 0x1005b790 LegoInputManager::LegoInputManager() @@ -55,6 +56,27 @@ MxResult LegoInputManager::Create(HWND p_hwnd) return SUCCESS; } +// OFFSET: LEGO1 0x1005bb80 TEMPLATE +// MxCollection::Compare + +// OFFSET: LEGO1 0x1005bc30 TEMPLATE +// MxCollection::Destroy + +// OFFSET: LEGO1 0x1005bc80 TEMPLATE +// MxList::~MxList + +// OFFSET: LEGO1 0x1005bd50 TEMPLATE +// MxCollection::`scalar deleting destructor' + +// OFFSET: LEGO1 0x1005bdc0 TEMPLATE +// MxList::`scalar deleting destructor' + +// OFFSET: LEGO1 0x1005beb0 TEMPLATE +// LegoEventQueue::`scalar deleting destructor' + +// OFFSET: LEGO1 0x1005bf70 TEMPLATE +// MxQueue::`scalar deleting destructor' + // OFFSET: LEGO1 0x1005bfe0 void LegoInputManager::Destroy() { @@ -270,3 +292,6 @@ void LegoInputManager::KillTimer() ::KillTimer(omni->GetWindowHandle(), m_timer); } } + +// OFFSET: LEGO1 0x1005d010 TEMPLATE +// MxListEntry::GetValue diff --git a/LEGO1/legoinputmanager.h b/LEGO1/legoinputmanager.h index c583a64a..542bd02d 100644 --- a/LEGO1/legoinputmanager.h +++ b/LEGO1/legoinputmanager.h @@ -12,7 +12,17 @@ class LegoControlManager; +// VTABLE 0x100d87b8 TEMPLATE +// class MxCollection + +// VTABLE 0x100d87d0 TEMPLATE +// class MxList + +// VTABLE 0x100d87e8 TEMPLATE +// class MxQueue + // VTABLE 0x100d8800 +// SIZE 0x18 class LegoEventQueue : public MxQueue {}; // VTABLE 0x100d8760 @@ -80,37 +90,4 @@ class LegoInputManager : public MxPresenter { MxBool m_unk0x336; }; -// OFFSET: LEGO1 0x1005bb80 TEMPLATE -// MxListParent::Compare - -// OFFSET: LEGO1 0x1005bc30 TEMPLATE -// MxListParent::Destroy - -// OFFSET: LEGO1 0x1005bc80 TEMPLATE -// MxList::~MxList - -// OFFSET: LEGO1 0x1005bd50 TEMPLATE -// MxListParent::`scalar deleting destructor' - -// OFFSET: LEGO1 0x1005bdc0 TEMPLATE -// MxList::`scalar deleting destructor' - -// OFFSET: LEGO1 0x1005beb0 TEMPLATE -// LegoEventQueue::`scalar deleting destructor' - -// OFFSET: LEGO1 0x1005bf70 TEMPLATE -// MxQueue::`scalar deleting destructor' - -// OFFSET: LEGO1 0x1005d010 TEMPLATE -// MxListEntry::GetValue - -// VTABLE 0x100d87e8 TEMPLATE -// class MxQueue - -// VTABLE 0x100d87d0 TEMPLATE -// class MxList - -// VTABLE 0x100d87b8 TEMPLATE -// class MxListParent - #endif // LEGOINPUTMANAGER_H diff --git a/LEGO1/legopathcontrollerlist.cpp b/LEGO1/legopathcontrollerlist.cpp new file mode 100644 index 00000000..762217c0 --- /dev/null +++ b/LEGO1/legopathcontrollerlist.cpp @@ -0,0 +1,42 @@ +#include "legopathcontrollerlist.h" + +#include "decomp.h" +#include "legopathcontroller.h" + +DECOMP_SIZE_ASSERT(LegoPathControllerList, 0x18); + +// OFFSET: LEGO1 0x1001d210 +MxS8 LegoPathControllerList::Compare(LegoPathController* p_a, LegoPathController* p_b) +{ + return p_a == p_b ? 0 : p_a < p_b ? -1 : 1; +} + +// OFFSET: LEGO1 0x1001d230 TEMPLATE +// MxCollection::Compare + +// OFFSET: LEGO1 0x1001d240 TEMPLATE +// MxList::MxList + +// OFFSET: LEGO1 0x1001d2d0 TEMPLATE +// MxCollection::~MxCollection + +// OFFSET: LEGO1 0x1001d320 TEMPLATE +// MxCollection::Destroy + +// OFFSET: LEGO1 0x1001d330 TEMPLATE +// MxList::~MxList + +// OFFSET: LEGO1 0x1001d3c0 +void LegoPathControllerList::Destroy(LegoPathController* p_controller) +{ + delete p_controller; +} + +// OFFSET: LEGO1 0x1001d490 TEMPLATE +// MxCollection::`scalar deleting destructor' + +// OFFSET: LEGO1 0x1001d500 TEMPLATE +// MxList::`scalar deleting destructor' + +// OFFSET: LEGO1 0x1001d5b0 TEMPLATE +// MxPtrList::`scalar deleting destructor' diff --git a/LEGO1/legopathcontrollerlist.h b/LEGO1/legopathcontrollerlist.h new file mode 100644 index 00000000..f69472d6 --- /dev/null +++ b/LEGO1/legopathcontrollerlist.h @@ -0,0 +1,26 @@ +#ifndef LEGOPATHCONTROLLERLIST_H +#define LEGOPATHCONTROLLERLIST_H + +#include "legopathcontroller.h" +#include "mxlist.h" +#include "mxtypes.h" + +// VTABLE 0x100d6320 TEMPLATE +// class MxPtrList + +// VTABLE 0x100d6338 +// SIZE 0x18 +class LegoPathControllerList : public MxPtrList { +public: + LegoPathControllerList() : MxPtrList(Destroy) {} + virtual MxS8 Compare(LegoPathController*, LegoPathController*) override; // vtable+0x14 + static void Destroy(LegoPathController*); +}; + +// VTABLE 0x100d6380 TEMPLATE +// class MxCollection + +// VTABLE 0x100d6398 TEMPLATE +// class MxList + +#endif // LEGOPATHCONTROLLERLIST_H diff --git a/LEGO1/legoworld.h b/LEGO1/legoworld.h index b2ad8793..7f46ff58 100644 --- a/LEGO1/legoworld.h +++ b/LEGO1/legoworld.h @@ -3,7 +3,9 @@ #include "legocameracontroller.h" #include "legoentity.h" +#include "legopathcontrollerlist.h" #include "mxpresenter.h" +#include "mxpresenterlist.h" // VTABLE 0x100d6280 // SIZE 0xf8 @@ -39,9 +41,12 @@ class LegoWorld : public LegoEntity { void EndAction(MxPresenter* p_presenter); protected: - undefined m_unk68[0x30]; - LegoCameraController* m_camera; - undefined m_unk9c[0x5a]; + LegoPathControllerList m_list0x68; // 0x68 + MxPresenterList m_list0x80; // 0x80 + LegoCameraController* m_camera; // 0x98 + undefined m_unk9c[0x1c]; + MxPresenterList m_list0xb8; // 0xb8 + undefined m_unkd0[0x26]; undefined m_unkf6; undefined m_unkf7; }; diff --git a/LEGO1/mxcollection.h b/LEGO1/mxcollection.h index 0f32a064..903ba8bd 100644 --- a/LEGO1/mxcollection.h +++ b/LEGO1/mxcollection.h @@ -18,8 +18,8 @@ class MxCollection : public MxCore { virtual MxS8 Compare(T, T) { return 0; } protected: - MxU32 m_count; // +0x8 - void (*m_customDestructor)(T); // +0xc + MxU32 m_count; // 0x8 + void (*m_customDestructor)(T); // 0xc }; #endif // MXCOLLECTION_H diff --git a/LEGO1/mxdsactionlist.cpp b/LEGO1/mxdsactionlist.cpp index 2959ffcd..123a38eb 100644 --- a/LEGO1/mxdsactionlist.cpp +++ b/LEGO1/mxdsactionlist.cpp @@ -17,3 +17,18 @@ void MxDSActionList::Destroy(MxDSAction* p_action) if (p_action) delete p_action; } + +// OFFSET: LEGO1 0x100c9cc0 TEMPLATE +// MxCollection::Compare + +// OFFSET: LEGO1 0x100c9d20 TEMPLATE +// MxCollection::Destroy + +// OFFSET: LEGO1 0x100c9d30 TEMPLATE +// MxList::~MxList + +// OFFSET: LEGO1 0x100c9e30 TEMPLATE +// MxCollection::`scalar deleting destructor' + +// OFFSET: LEGO1 0x100c9ea0 TEMPLATE +// MxList::`scalar deleting destructor' diff --git a/LEGO1/mxdsactionlist.h b/LEGO1/mxdsactionlist.h index d3bafbbb..b6ca0c11 100644 --- a/LEGO1/mxdsactionlist.h +++ b/LEGO1/mxdsactionlist.h @@ -6,13 +6,19 @@ class MxDSAction; +// VTABLE 0x100dcea8 TEMPLATE +// class MxCollection + +// VTABLE 0x100dcec0 TEMPLATE +// class MxList + // VTABLE 0x100dced8 // SIZE 0x1c class MxDSActionList : public MxList { public: MxDSActionList() { this->m_unk18 = 0; } - virtual MxS8 Compare(MxDSAction*, MxDSAction*) override; // +0x14 + virtual MxS8 Compare(MxDSAction*, MxDSAction*) override; // vtable+0x14 static void Destroy(MxDSAction* p_action); @@ -22,13 +28,4 @@ class MxDSActionList : public MxList { typedef MxListCursorChild MxDSActionListCursor; -// OFFSET: LEGO1 0x100c9cc0 TEMPLATE -// MxListParent::Compare - -// OFFSET: LEGO1 0x100c9d20 TEMPLATE -// MxListParent::Destroy - -// OFFSET: LEGO1 0x100c9d30 TEMPLATE -// MxList::~MxList - #endif // MXDSACTIONLIST_H diff --git a/LEGO1/mxhashtable.h b/LEGO1/mxhashtable.h index a276cfd8..b09bf28c 100644 --- a/LEGO1/mxhashtable.h +++ b/LEGO1/mxhashtable.h @@ -59,16 +59,16 @@ class MxHashTable : protected MxCollection { protected: void _NodeInsert(MxHashTableNode*); - MxHashTableNode** m_slots; // +0x10 - MxU32 m_numSlots; // +0x14 - MxU32 m_autoResizeRatio; // +0x18 - HashTableOpt m_resizeOption; // +0x1c + MxHashTableNode** m_slots; // 0x10 + MxU32 m_numSlots; // 0x14 + MxU32 m_autoResizeRatio; // 0x18 + HashTableOpt m_resizeOption; // 0x1c // FIXME: or FIXME? This qword is used as an integer or double depending // on the value of m_resizeOption. Hard to say whether this is how the devs // did it, but a simple cast in either direction doesn't match. union { - MxU32 m_increaseAmount; // +0x20 - double m_increaseFactor; // +0x20 + MxU32 m_increaseAmount; // 0x20 + double m_increaseFactor; // 0x20 }; }; @@ -156,13 +156,13 @@ void MxHashTable::DeleteAll() while (t) { MxHashTableNode* next = t->m_next; - m_customDestructor(t->m_obj); + this->m_customDestructor(t->m_obj); delete t; t = next; } } - m_count = 0; + this->m_count = 0; memset(m_slots, 0, sizeof(MxHashTableNode*) * m_numSlots); delete[] m_slots; @@ -188,7 +188,7 @@ inline void MxHashTable::Resize() MxHashTableNode** new_table = new MxHashTableNode*[m_numSlots]; m_slots = new_table; memset(m_slots, 0, sizeof(MxHashTableNode*) * m_numSlots); - m_count = 0; + this->m_count = 0; for (MxS32 i = 0; i != old_size; i++) { MxHashTableNode* t = old_table[i]; @@ -214,13 +214,13 @@ inline void MxHashTable::_NodeInsert(MxHashTableNode* p_node) m_slots[bucket]->m_prev = p_node; m_slots[bucket] = p_node; - m_count++; + this->m_count++; } template inline void MxHashTable::Add(T p_newobj) { - if (m_resizeOption && ((m_count + 1) / m_numSlots) > m_autoResizeRatio) + if (m_resizeOption && ((this->m_count + 1) / m_numSlots) > m_autoResizeRatio) MxHashTable::Resize(); MxU32 hash = Hash(p_newobj); diff --git a/LEGO1/mxlist.h b/LEGO1/mxlist.h index 11f0e8ba..d44d6c8f 100644 --- a/LEGO1/mxlist.h +++ b/LEGO1/mxlist.h @@ -1,6 +1,7 @@ #ifndef MXLIST_H #define MXLIST_H +#include "mxcollection.h" #include "mxcore.h" #include "mxtypes.h" @@ -9,6 +10,12 @@ class MxList; template class MxListCursor; +template +class MxPtrList : public MxList { +public: + MxPtrList(void (*p_destroy)(T*) = Destroy) { m_customDestructor = p_destroy; } +}; + template class MxListEntry { public: @@ -40,29 +47,9 @@ class MxListEntry { MxListEntry* m_next; }; -// SIZE 0x10 -template -class MxListParent : public MxCore { -public: - MxListParent() - { - m_count = 0; - m_customDestructor = Destroy; - } - - virtual ~MxListParent() {} - virtual MxS8 Compare(T, T) { return 0; }; - - static void Destroy(T){}; - -protected: - MxU32 m_count; // +0x8 - void (*m_customDestructor)(T); // +0xc -}; - // SIZE 0x18 template -class MxList : protected MxListParent { +class MxList : protected MxCollection { public: MxList() { @@ -80,8 +67,8 @@ class MxList : protected MxListParent { friend class MxListCursor; protected: - MxListEntry* m_first; // +0x10 - MxListEntry* m_last; // +0x14 + MxListEntry* m_first; // 0x10 + MxListEntry* m_last; // 0x14 void _DeleteEntry(MxListEntry* match); MxListEntry* _InsertEntry(T, MxListEntry*, MxListEntry*); diff --git a/LEGO1/mxpresenterlist.cpp b/LEGO1/mxpresenterlist.cpp index f6ed6594..da625f24 100644 --- a/LEGO1/mxpresenterlist.cpp +++ b/LEGO1/mxpresenterlist.cpp @@ -10,3 +10,27 @@ MxS8 MxPresenterList::Compare(MxPresenter* p_a, MxPresenter* p_b) { return p_a == p_b ? 0 : p_a < p_b ? -1 : 1; } + +// OFFSET: LEGO1 0x1001cd20 TEMPLATE +// MxCollection::Compare + +// OFFSET: LEGO1 0x1001cd30 TEMPLATE +// MxCollection::Destroy + +// OFFSET: LEGO1 0x1001cd40 TEMPLATE +// MxList::MxList + +// OFFSET: LEGO1 0x1001cdd0 TEMPLATE +// MxCollection::~MxCollection + +// OFFSET: LEGO1 0x1001ce20 TEMPLATE +// MxList::~MxList + +// OFFSET: LEGO1 0x1001cf70 TEMPLATE +// MxCollection::`scalar deleting destructor' + +// OFFSET: LEGO1 0x1001cfe0 TEMPLATE +// MxList::`scalar deleting destructor' + +// OFFSET: LEGO1 0x1001d090 TEMPLATE +// MxPtrList::`scalar deleting destructor' diff --git a/LEGO1/mxpresenterlist.h b/LEGO1/mxpresenterlist.h index 350d6c17..b8c95950 100644 --- a/LEGO1/mxpresenterlist.h +++ b/LEGO1/mxpresenterlist.h @@ -5,30 +5,22 @@ class MxPresenter; -// Unclear what the purpose of this class is -// VTABLE 0x100d62f0 -// SIZE 0x18 -class MxPresenterListParent : public MxList { -public: - MxPresenterListParent() { m_customDestructor = Destroy; } -}; +// VTABLE 0x100d62f0 TEMPLATE +// class MxPtrList // VTABLE 0x100d6308 // SIZE 0x18 -class MxPresenterList : public MxPresenterListParent { +class MxPresenterList : public MxPtrList { public: - virtual MxS8 Compare(MxPresenter*, MxPresenter*) override; // +0x14 + virtual MxS8 Compare(MxPresenter*, MxPresenter*) override; // vtable+0x14 }; typedef MxListCursorChildChild MxPresenterListCursor; -// OFFSET: LEGO1 0x1001cd20 TEMPLATE -// MxListParent::Compare +// VTABLE 0x100d6350 TEMPLATE +// class MxCollection -// OFFSET: LEGO1 0x1001cd30 TEMPLATE -// MxListParent::Destroy - -// OFFSET: LEGO1 0x1001ce20 TEMPLATE -// MxList::~MxList +// VTABLE 0x100d6368 TEMPLATE +// class MxList #endif // MXPRESENTERLIST_H diff --git a/LEGO1/mxregion.h b/LEGO1/mxregion.h index ac6acd5e..a0fa7475 100644 --- a/LEGO1/mxregion.h +++ b/LEGO1/mxregion.h @@ -21,7 +21,7 @@ struct MxRegionTopBottom { inline void SetTop(MxS32 p_top) { m_top = p_top; } inline void SetBottom(MxS32 p_bottom) { m_bottom = p_bottom; } - friend class MxRegionListParent; + friend class MxRegionList; private: MxS32 m_top; diff --git a/LEGO1/mxregionlist.cpp b/LEGO1/mxregionlist.cpp index a33d78b7..74e5739a 100644 --- a/LEGO1/mxregionlist.cpp +++ b/LEGO1/mxregionlist.cpp @@ -3,7 +3,7 @@ #include "mxregion.h" // OFFSET: LEGO1 0x100c33e0 -void MxRegionListParent::Destroy(MxRegionTopBottom* p_topBottom) +void MxRegionList::Destroy(MxRegionTopBottom* p_topBottom) { if (p_topBottom) { if (p_topBottom->m_leftRightList) @@ -13,7 +13,52 @@ void MxRegionListParent::Destroy(MxRegionTopBottom* p_topBottom) } // OFFSET: LEGO1 0x100c4e80 -void MxRegionLeftRightListParent::Destroy(MxRegionLeftRight* p_leftRight) +void MxRegionLeftRightList::Destroy(MxRegionLeftRight* p_leftRight) { delete p_leftRight; } + +// OFFSET: LEGO1 0x100c32e0 TEMPLATE +// MxCollection::Compare + +// OFFSET: LEGO1 0x100c3340 TEMPLATE +// MxCollection::Destroy + +// OFFSET: LEGO1 0x100c34d0 TEMPLATE +// MxCollection::`scalar deleting destructor' + +// OFFSET: LEGO1 0x100c3540 TEMPLATE +// MxList::`scalar deleting destructor' + +// OFFSET: LEGO1 0x100c35f0 TEMPLATE +// MxPtrList::`scalar deleting destructor' + +// OFFSET: LEGO1 0x100c4d80 TEMPLATE +// MxCollection::Compare + +// OFFSET: LEGO1 0x100c4de0 TEMPLATE +// MxCollection::Destroy + +// OFFSET: LEGO1 0x100c4f50 TEMPLATE +// MxCollection::`scalar deleting destructor' + +// OFFSET: LEGO1 0x100c4fc0 TEMPLATE +// MxList::`scalar deleting destructor' + +// OFFSET: LEGO1 0x100c5070 TEMPLATE +// MxPtrList::`scalar deleting destructor' + +// OFFSET: LEGO1 0x100c54f0 TEMPLATE +// MxListCursor::MxListCursor + +// OFFSET: LEGO1 0x100c58c0 TEMPLATE +// MxList::_InsertEntry + +// OFFSET: LEGO1 0x100c5970 TEMPLATE +// MxList::_InsertEntry + +// OFFSET: LEGO1 0x100c5a20 TEMPLATE +// MxListEntry::MxListEntry + +// OFFSET: LEGO1 0x100c5a40 TEMPLATE +// MxList::_DeleteEntry diff --git a/LEGO1/mxregionlist.h b/LEGO1/mxregionlist.h index 52336d38..c3a5d2ef 100644 --- a/LEGO1/mxregionlist.h +++ b/LEGO1/mxregionlist.h @@ -6,51 +6,44 @@ struct MxRegionTopBottom; struct MxRegionLeftRight; -// VTABLE 0x100dcb40 -// SIZE 0x18 -class MxRegionListParent : public MxList { -public: - static void Destroy(MxRegionTopBottom* p_topBottom); +// VTABLE 0x100dcb10 TEMPLATE +// class MxCollection - MxRegionListParent() { m_customDestructor = Destroy; } -}; +// VTABLE 0x100dcb28 TEMPLATE +// class MxList + +// VTABLE 0x100dcb40 TEMPLATE +// class MxPtrList // VTABLE 0x100dcb58 // SIZE 0x18 -class MxRegionList : public MxRegionListParent {}; +class MxRegionList : public MxPtrList { +public: + MxRegionList() : MxPtrList(Destroy) {} + static void Destroy(MxRegionTopBottom*); +}; // VTABLE 0x100dcb88 typedef MxListCursorChildChild MxRegionListCursor; -// OFFSET: LEGO1 0x100c5970 TEMPLATE -// MxList::_InsertEntry - -// OFFSET: LEGO1 0x100c5a20 TEMPLATE -// MxListEntry::MxListEntry - -// VTABLE 0x100dcc70 -// SIZE 0x18 -class MxRegionLeftRightListParent : public MxList { -public: - static void Destroy(MxRegionLeftRight* p_leftRight); - - MxRegionLeftRightListParent() { m_customDestructor = Destroy; } -}; - -// VTABLE 0x100dcc88 -// SIZE 0x18 -class MxRegionLeftRightList : public MxRegionLeftRightListParent {}; - // VTABLE 0x100dcc10 typedef MxListCursorChildChild MxRegionLeftRightListCursor; -// OFFSET: LEGO1 0x100c54f0 TEMPLATE -// MxListCursor::MxListCursor +// VTABLE 0x100dcc40 TEMPLATE +// class MxCollection -// OFFSET: LEGO1 0x100c58c0 TEMPLATE -// MxList::_InsertEntry +// VTABLE 0x100dcc58 TEMPLATE +// class MxList -// OFFSET: LEGO1 0x100c5a40 TEMPLATE -// MxList::_DeleteEntry +// VTABLE 0x100dcc70 TEMPLATE +// class MxPtrList + +// VTABLE 0x100dcc88 +// SIZE 0x18 +class MxRegionLeftRightList : public MxPtrList { +public: + MxRegionLeftRightList() : MxPtrList(Destroy) {} + static void Destroy(MxRegionLeftRight*); +}; #endif // MXREGIONLIST_H diff --git a/LEGO1/mxstreamchunklist.cpp b/LEGO1/mxstreamchunklist.cpp index 8c76452e..46a610ad 100644 --- a/LEGO1/mxstreamchunklist.cpp +++ b/LEGO1/mxstreamchunklist.cpp @@ -17,3 +17,18 @@ void MxStreamChunkList::Destroy(MxStreamChunk* p_chunk) if (p_chunk) delete p_chunk; } + +// OFFSET: LEGO1 0x100b5930 TEMPLATE +// MxCollection::Compare + +// OFFSET: LEGO1 0x100b5990 TEMPLATE +// MxCollection::Destroy + +// OFFSET: LEGO1 0x100b59a0 TEMPLATE +// MxList::~MxList + +// OFFSET: LEGO1 0x100b5aa0 TEMPLATE +// MxCollection::`scalar deleting destructor' + +// OFFSET: LEGO1 0x100b5b10 TEMPLATE +// MxList::`scalar deleting destructor' diff --git a/LEGO1/mxstreamchunklist.h b/LEGO1/mxstreamchunklist.h index 3a19950b..9a84e572 100644 --- a/LEGO1/mxstreamchunklist.h +++ b/LEGO1/mxstreamchunklist.h @@ -6,29 +6,23 @@ class MxStreamChunk; +// VTABLE 0x100dc5d0 TEMPLATE +// class MxCollection + +// VTABLE 0x100dc5e8 TEMPLATE +// class MxList + // VTABLE 0x100dc600 // SIZE 0x18 class MxStreamChunkList : public MxList { public: MxStreamChunkList() { m_customDestructor = Destroy; } - virtual MxS8 Compare(MxStreamChunk*, MxStreamChunk*) override; // +0x14 + virtual MxS8 Compare(MxStreamChunk*, MxStreamChunk*) override; // vtable+0x14 static void Destroy(MxStreamChunk* p_chunk); }; typedef MxListCursorChild MxStreamChunkListCursor; -// OFFSET: LEGO1 0x100b5930 TEMPLATE -// MxListParent::Compare - -// OFFSET: LEGO1 0x100b5990 TEMPLATE -// MxListParent::Destroy - -// OFFSET: LEGO1 0x100b59a0 TEMPLATE -// MxList::~MxList - -// OFFSET: LEGO1 0x100b5b10 TEMPLATE -// MxList::`scalar deleting destructor' - #endif // MXSTREAMCHUNKLIST_H diff --git a/LEGO1/mxstringlist.cpp b/LEGO1/mxstringlist.cpp index 8a0a2ddc..9279e8cf 100644 --- a/LEGO1/mxstringlist.cpp +++ b/LEGO1/mxstringlist.cpp @@ -3,3 +3,24 @@ #include "decomp.h" DECOMP_SIZE_ASSERT(MxListEntry, 0x18) + +// OFFSET: LEGO1 0x100cb3c0 TEMPLATE +// MxCollection::Compare + +// OFFSET: LEGO1 0x100cb470 TEMPLATE +// MxCollection::Destroy + +// OFFSET: LEGO1 0x100cb4c0 TEMPLATE +// MxList::~MxList + +// OFFSET: LEGO1 0x100cbb40 TEMPLATE +// MxList::Append + +// OFFSET: LEGO1 0x100cc2d0 TEMPLATE +// MxList::_InsertEntry + +// OFFSET: LEGO1 0x100cc3c0 TEMPLATE +// MxListEntry::MxListEntry + +// OFFSET: LEGO1 0x100cc450 TEMPLATE +// MxListEntry::GetValue diff --git a/LEGO1/mxstringlist.h b/LEGO1/mxstringlist.h index d80c4777..f397fbf7 100644 --- a/LEGO1/mxstringlist.h +++ b/LEGO1/mxstringlist.h @@ -11,25 +11,4 @@ class MxStringList : public MxList {}; // VTABLE 0x100dd058 typedef MxListCursorChild MxStringListCursor; -// OFFSET: LEGO1 0x100cb3c0 TEMPLATE -// MxListParent::Compare - -// OFFSET: LEGO1 0x100cb470 TEMPLATE -// MxListParent::Destroy - -// OFFSET: LEGO1 0x100cb4c0 TEMPLATE -// MxList::~MxList - -// OFFSET: LEGO1 0x100cbb40 TEMPLATE -// MxList::Append - -// OFFSET: LEGO1 0x100cc2d0 TEMPLATE -// MxList::_InsertEntry - -// OFFSET: LEGO1 0x100cc3c0 TEMPLATE -// MxListEntry::MxListEntry - -// OFFSET: LEGO1 0x100cc450 TEMPLATE -// MxListEntry::GetValue - #endif // MXSTRINGLIST_H diff --git a/LEGO1/mxvariabletable.h b/LEGO1/mxvariabletable.h index 872aa49f..1df02204 100644 --- a/LEGO1/mxvariabletable.h +++ b/LEGO1/mxvariabletable.h @@ -17,8 +17,8 @@ class MxVariableTable : public MxHashTable { // OFFSET: LEGO1 0x100afdb0 static void Destroy(MxVariable* p_obj) { p_obj->Destroy(); } - virtual MxS8 Compare(MxVariable*, MxVariable*) override; // +0x14 - virtual MxU32 Hash(MxVariable*) override; // +0x18 + virtual MxS8 Compare(MxVariable*, MxVariable*) override; // vtable+0x14 + virtual MxU32 Hash(MxVariable*) override; // vtable+0x18 }; // OFFSET: LEGO1 0x100afcd0 TEMPLATE