diff --git a/LEGO1/lego/legoomni/include/legoanimationmanager.h b/LEGO1/lego/legoomni/include/legoanimationmanager.h index f943b062..e8feb299 100644 --- a/LEGO1/lego/legoomni/include/legoanimationmanager.h +++ b/LEGO1/lego/legoomni/include/legoanimationmanager.h @@ -1,6 +1,7 @@ #ifndef LEGOANIMATIONMANAGER_H #define LEGOANIMATIONMANAGER_H +#include "decomp.h" #include "mxcore.h" // VTABLE: LEGO1 0x100d8c18 @@ -28,6 +29,7 @@ class LegoAnimationManager : public MxCore { void FUN_1005f6d0(MxBool); void FUN_10064670(MxBool); + void InitForWorld(undefined4); __declspec(dllexport) static void configureLegoAnimationManager(MxS32 p_legoAnimationManagerConfig); diff --git a/LEGO1/lego/legoomni/include/legobuildingmanager.h b/LEGO1/lego/legoomni/include/legobuildingmanager.h index bb9c96bb..b472afff 100644 --- a/LEGO1/lego/legoomni/include/legobuildingmanager.h +++ b/LEGO1/lego/legoomni/include/legobuildingmanager.h @@ -19,6 +19,8 @@ class LegoBuildingManager : public MxCore { __declspec(dllexport) static void configureLegoBuildingManager(MxS32); + void OnWorldCreated(); + private: void Init(); }; diff --git a/LEGO1/lego/legoomni/include/legoplantmanager.h b/LEGO1/lego/legoomni/include/legoplantmanager.h index 7fd20746..8aa9ce50 100644 --- a/LEGO1/lego/legoomni/include/legoplantmanager.h +++ b/LEGO1/lego/legoomni/include/legoplantmanager.h @@ -1,6 +1,7 @@ #ifndef LEGOPLANTMANAGER_H #define LEGOPLANTMANAGER_H +#include "decomp.h" #include "mxcore.h" // VTABLE: LEGO1 0x100d6758 @@ -19,6 +20,8 @@ class LegoPlantManager : public MxCore { return "LegoPlantManager"; } + void InitForWorld(undefined4 p_world); + private: void Init(); }; diff --git a/LEGO1/lego/legoomni/include/legoworld.h b/LEGO1/lego/legoomni/include/legoworld.h index c4f53913..edcfebfa 100644 --- a/LEGO1/lego/legoomni/include/legoworld.h +++ b/LEGO1/lego/legoomni/include/legoworld.h @@ -43,6 +43,7 @@ class LegoWorld : public LegoEntity { virtual void VTable0x68(MxBool p_add); // vtable+68 inline LegoCameraController* GetCamera() { return m_camera; } + inline undefined4 GetUnknown0xec() { return m_unk0xec; } undefined FUN_100220e0(); MxResult SetAsCurrentWorld(MxDSObject& p_dsObject); @@ -60,7 +61,9 @@ class LegoWorld : public LegoEntity { LegoCameraController* m_camera; // 0x98 undefined m_unk0x9c[0x1c]; // 0x9c MxPresenterList m_list0xb8; // 0xb8 - undefined m_unk0xd0[0x24]; // 0xd0 + undefined m_unk0xd0[0x1c]; // 0xd0 + undefined4 m_unk0xec; // 0xec + undefined4 m_unk0xf0; // 0xf0 MxS16 m_unk0xf4; // 0xf4 MxBool m_unk0xf6; // 0xf6 undefined m_unk0xf7; // 0xf7 diff --git a/LEGO1/lego/legoomni/src/build/legobuildingmanager.cpp b/LEGO1/lego/legoomni/src/build/legobuildingmanager.cpp index 34652509..75bc4c4c 100644 --- a/LEGO1/lego/legoomni/src/build/legobuildingmanager.cpp +++ b/LEGO1/lego/legoomni/src/build/legobuildingmanager.cpp @@ -26,3 +26,9 @@ void LegoBuildingManager::Init() { // TODO } + +// STUB: LEGO1 0x1002fa00 +void LegoBuildingManager::OnWorldCreated() +{ + // TODO +} diff --git a/LEGO1/lego/legoomni/src/common/legoplantmanager.cpp b/LEGO1/lego/legoomni/src/common/legoplantmanager.cpp index 4b93d8d7..0388dc41 100644 --- a/LEGO1/lego/legoomni/src/common/legoplantmanager.cpp +++ b/LEGO1/lego/legoomni/src/common/legoplantmanager.cpp @@ -18,6 +18,12 @@ void LegoPlantManager::Init() // TODO } +// STUB: LEGO1 0x10026360 +void LegoPlantManager::InitForWorld(undefined4 p_world) +{ + // TODO +} + // STUB: LEGO1 0x10026e00 MxResult LegoPlantManager::Tickle() { diff --git a/LEGO1/lego/legoomni/src/entity/legoworldpresenter.cpp b/LEGO1/lego/legoomni/src/entity/legoworldpresenter.cpp index 9e5e930c..38d0aad8 100644 --- a/LEGO1/lego/legoomni/src/entity/legoworldpresenter.cpp +++ b/LEGO1/lego/legoomni/src/entity/legoworldpresenter.cpp @@ -1,12 +1,17 @@ #include "legoworldpresenter.h" +#include "legoanimationmanager.h" +#include "legobuildingmanager.h" #include "legoentity.h" #include "legoomni.h" +#include "legoplantmanager.h" #include "legovideomanager.h" +#include "legoworld.h" #include "mxactionnotificationparam.h" #include "mxautolocker.h" #include "mxdsactionlist.h" #include "mxdsmultiaction.h" +#include "mxnotificationmanager.h" #include "mxobjectfactory.h" #include "mxpresenter.h" #include "mxstl/stlcompat.h" @@ -26,10 +31,25 @@ LegoWorldPresenter::LegoWorldPresenter() m_unk0x50 = 50000; } -// STUB: LEGO1 0x10066770 +// FUNCTION: LEGO1 0x10066770 LegoWorldPresenter::~LegoWorldPresenter() { - // TODO + MxBool result = FALSE; + if (m_objectBackend) { + undefined4 world = ((LegoWorld*) m_objectBackend)->GetUnknown0xec(); + PlantManager()->InitForWorld(world); + AnimationManager()->InitForWorld(world); + BuildingManager()->OnWorldCreated(); + result = ((LegoWorld*) m_objectBackend)->VTable0x5c(); + } + + if (result == FALSE) { + FUN_10015820(0, 7); + } + + if (m_objectBackend) { + NotificationManager()->Send(m_objectBackend, &MxNotificationParam(c_notificationNewPresenter, NULL)); + } } // FUNCTION: LEGO1 0x10066870 diff --git a/LEGO1/lego/legoomni/src/video/legoanimationmanager.cpp b/LEGO1/lego/legoomni/src/video/legoanimationmanager.cpp index 444eeccf..2bc1a151 100644 --- a/LEGO1/lego/legoomni/src/video/legoanimationmanager.cpp +++ b/LEGO1/lego/legoomni/src/video/legoanimationmanager.cpp @@ -33,6 +33,13 @@ void LegoAnimationManager::FUN_1005f6d0(MxBool) // TODO } +// STUB: LEGO1 0x1005f720 +void LegoAnimationManager::InitForWorld(undefined4) +{ + // TODO +} + + // STUB: LEGO1 0x100619f0 MxLong LegoAnimationManager::Notify(MxParam& p_param) {