From 3def0a0eb766e269a5c682d725b275b0f5969b9e Mon Sep 17 00:00:00 2001 From: disinvite Date: Sat, 18 Nov 2023 23:55:08 -0500 Subject: [PATCH] MxPtrList custom destructor and more offsets Co-authored-by: Christian Semmler --- LEGO1/legopathcontrollerlist.h | 2 ++ LEGO1/mxlist.h | 2 +- LEGO1/mxregionlist.cpp | 30 ++++++++++++++++++++++++++++++ LEGO1/mxregionlist.h | 14 ++++++++++++++ 4 files changed, 47 insertions(+), 1 deletion(-) diff --git a/LEGO1/legopathcontrollerlist.h b/LEGO1/legopathcontrollerlist.h index 9627135b..f69472d6 100644 --- a/LEGO1/legopathcontrollerlist.h +++ b/LEGO1/legopathcontrollerlist.h @@ -11,6 +11,8 @@ // VTABLE 0x100d6338 // SIZE 0x18 class LegoPathControllerList : public MxPtrList { +public: + LegoPathControllerList() : MxPtrList(Destroy) {} virtual MxS8 Compare(LegoPathController*, LegoPathController*) override; // vtable+0x14 static void Destroy(LegoPathController*); }; diff --git a/LEGO1/mxlist.h b/LEGO1/mxlist.h index 27f6dad1..7a9ddbcd 100644 --- a/LEGO1/mxlist.h +++ b/LEGO1/mxlist.h @@ -13,7 +13,7 @@ class MxListCursor; template class MxPtrList : public MxList { public: - MxPtrList() { m_customDestructor = Destroy; } + MxPtrList(void (*p_destroy)(T*) = Destroy) { m_customDestructor = p_destroy; } }; template diff --git a/LEGO1/mxregionlist.cpp b/LEGO1/mxregionlist.cpp index 33f3fdd6..74e5739a 100644 --- a/LEGO1/mxregionlist.cpp +++ b/LEGO1/mxregionlist.cpp @@ -18,6 +18,36 @@ 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 diff --git a/LEGO1/mxregionlist.h b/LEGO1/mxregionlist.h index bd6651f1..c3a5d2ef 100644 --- a/LEGO1/mxregionlist.h +++ b/LEGO1/mxregionlist.h @@ -6,6 +6,12 @@ struct MxRegionTopBottom; struct MxRegionLeftRight; +// VTABLE 0x100dcb10 TEMPLATE +// class MxCollection + +// VTABLE 0x100dcb28 TEMPLATE +// class MxList + // VTABLE 0x100dcb40 TEMPLATE // class MxPtrList @@ -13,6 +19,7 @@ struct MxRegionLeftRight; // SIZE 0x18 class MxRegionList : public MxPtrList { public: + MxRegionList() : MxPtrList(Destroy) {} static void Destroy(MxRegionTopBottom*); }; @@ -22,6 +29,12 @@ typedef MxListCursorChildChild MxRegionListCursor; // VTABLE 0x100dcc10 typedef MxListCursorChildChild MxRegionLeftRightListCursor; +// VTABLE 0x100dcc40 TEMPLATE +// class MxCollection + +// VTABLE 0x100dcc58 TEMPLATE +// class MxList + // VTABLE 0x100dcc70 TEMPLATE // class MxPtrList @@ -29,6 +42,7 @@ typedef MxListCursorChildChild MxRegionLeftRightListCursor; // SIZE 0x18 class MxRegionLeftRightList : public MxPtrList { public: + MxRegionLeftRightList() : MxPtrList(Destroy) {} static void Destroy(MxRegionLeftRight*); };