From 9b76ba8944aacfedd0e9fa4e9bc4a76966c1d21a Mon Sep 17 00:00:00 2001 From: Christian Semmler Date: Mon, 15 Jan 2024 15:10:39 -0500 Subject: [PATCH] Add LegoEntityList --- LEGO1/lego/legoomni/include/legoentitylist.h | 89 ++++++++++++++++++++ LEGO1/lego/legoomni/include/legoworld.h | 4 +- LEGO1/lego/legoomni/src/entity/legoworld.cpp | 2 +- 3 files changed, 93 insertions(+), 2 deletions(-) create mode 100644 LEGO1/lego/legoomni/include/legoentitylist.h diff --git a/LEGO1/lego/legoomni/include/legoentitylist.h b/LEGO1/lego/legoomni/include/legoentitylist.h new file mode 100644 index 00000000..98753f61 --- /dev/null +++ b/LEGO1/lego/legoomni/include/legoentitylist.h @@ -0,0 +1,89 @@ +#ifndef LEGOENTITYLIST_H +#define LEGOENTITYLIST_H + +#include "mxlist.h" +#include "mxtypes.h" + +class LegoEntity; + +// VTABLE: LEGO1 0x100d6410 +// class MxCollection + +// VTABLE: LEGO1 0x100d6428 +// class MxList + +// VTABLE: LEGO1 0x100d6440 +// class MxPtrList + +// VTABLE: LEGO1 0x100d6458 +// SIZE 0x18 +class LegoEntityList : public MxPtrList { +public: + LegoEntityList(MxBool p_ownership = FALSE) : MxPtrList(p_ownership) {} + + // FUNCTION: LEGO1 0x1001e2d0 + virtual MxS8 Compare(LegoEntity* p_a, LegoEntity* p_b) override + { + return p_a == p_b ? 0 : p_a < p_b ? -1 : 1; + }; // vtable+0x14 +}; + +// VTABLE: LEGO1 0x100d64e8 +// class MxListCursor + +// VTABLE: LEGO1 0x100d64b8 +// class MxPtrListCursor + +// VTABLE: LEGO1 0x100d64d0 +// SIZE 0x10 +class LegoEntityListCursor : public MxPtrListCursor { +public: + LegoEntityListCursor(LegoEntityList* p_list) : MxPtrListCursor(p_list){}; +}; + +// TEMPLATE: LEGO1 0x1001e2f0 +// MxCollection::Compare + +// XTEMPLATE: LEGO1 0x1001e300 +// MxCollection::~MxCollection + +// TEMPLATE: LEGO1 0x1001e350 +// MxCollection::Destroy + +// TEMPLATE: LEGO1 0x1001e360 +// MxList::~MxList + +// TEMPLATE: LEGO1 0x1001e3f0 +// MxPtrList::Destroy + +// SYNTHETIC: LEGO1 0x1001e400 +// LegoEntityList::`scalar deleting destructor' + +// SYNTHETIC: LEGO1 0x1001e4c0 +// MxCollection::`scalar deleting destructor' + +// SYNTHETIC: LEGO1 0x1001e530 +// MxList::`scalar deleting destructor' + +// SYNTHETIC: LEGO1 0x1001e5e0 +// MxPtrList::`scalar deleting destructor' + +// SYNTHETIC: LEGO1 0x1001f110 +// LegoEntityListCursor::`scalar deleting destructor' + +// FUNCTION: LEGO1 0x1001f180 +// MxPtrListCursor::~MxPtrListCursor + +// SYNTHETIC: LEGO1 0x1001f1d0 +// MxListCursor::`scalar deleting destructor' + +// SYNTHETIC: LEGO1 0x1001f240 +// MxPtrListCursor::`scalar deleting destructor' + +// FUNCTION: LEGO1 0x1001f2b0 +// MxListCursor::~MxListCursor + +// FUNCTION: LEGO1 0x1001edc6 +// LegoEntityListCursor::~LegoEntityListCursor + +#endif // LEGOENTITYLIST_H diff --git a/LEGO1/lego/legoomni/include/legoworld.h b/LEGO1/lego/legoomni/include/legoworld.h index 7cacf766..2dfd60a7 100644 --- a/LEGO1/lego/legoomni/include/legoworld.h +++ b/LEGO1/lego/legoomni/include/legoworld.h @@ -3,6 +3,7 @@ #include "legocameracontroller.h" #include "legoentity.h" +#include "legoentitylist.h" #include "legopathcontrollerlist.h" #include "mxpresenter.h" #include "mxpresenterlist.h" @@ -59,7 +60,8 @@ class LegoWorld : public LegoEntity { LegoPathControllerList m_list0x68; // 0x68 MxPresenterList m_list0x80; // 0x80 LegoCameraController* m_cameraController; // 0x98 - undefined m_unk0x9c[0x1c]; // 0x9c + LegoEntityList* m_entityList; // 0x9c + undefined m_unk0xa0[0x18]; // 0xa0 MxPresenterList m_list0xb8; // 0xb8 undefined m_unk0xd0[0x1c]; // 0xd0 undefined4 m_unk0xec; // 0xec diff --git a/LEGO1/lego/legoomni/src/entity/legoworld.cpp b/LEGO1/lego/legoomni/src/entity/legoworld.cpp index c7a2608a..24167a1a 100644 --- a/LEGO1/lego/legoomni/src/entity/legoworld.cpp +++ b/LEGO1/lego/legoomni/src/entity/legoworld.cpp @@ -45,7 +45,7 @@ MxResult LegoWorld::Create(MxDSAction& p_dsAction) { MxEntity::Create(p_dsAction); - // TODO: Intitialize lists + m_entityList = new LegoEntityList(TRUE); if (VTable0x54()) { if (p_dsAction.GetFlags() & MxDSAction::Flag_Enabled) {