From 70e8796af3135b0a5c75cfd4ac84439531eea9a7 Mon Sep 17 00:00:00 2001 From: Christian Semmler Date: Fri, 15 Mar 2024 22:20:44 -0400 Subject: [PATCH] Implement/match LegoEntity::VTable0x3c (#680) --- .../lego/legoomni/include/legobuildingmanager.h | 2 ++ .../legoomni/include/legocharactermanager.h | 1 + LEGO1/lego/legoomni/include/legoplantmanager.h | 2 ++ .../legoomni/src/build/legobuildingmanager.cpp | 7 +++++++ .../src/common/legocharactermanager.cpp | 7 +++++++ .../legoomni/src/common/legoplantmanager.cpp | 9 +++++++++ LEGO1/lego/legoomni/src/entity/legoentity.cpp | 17 +++++++++++++++-- 7 files changed, 43 insertions(+), 2 deletions(-) diff --git a/LEGO1/lego/legoomni/include/legobuildingmanager.h b/LEGO1/lego/legoomni/include/legobuildingmanager.h index d4ab3632..eb242399 100644 --- a/LEGO1/lego/legoomni/include/legobuildingmanager.h +++ b/LEGO1/lego/legoomni/include/legobuildingmanager.h @@ -5,6 +5,7 @@ #include "misc/legostorage.h" #include "mxcore.h" +class LegoEntity; class LegoROI; // VTABLE: LEGO1 0x100d6f50 @@ -31,6 +32,7 @@ class LegoBuildingManager : public MxCore { void FUN_1002fb30(); MxResult Save(LegoStorage* p_storage); MxResult Load(LegoStorage* p_storage); + MxBool FUN_1002fdb0(LegoEntity* p_entity); MxU32 FUN_1002ff40(LegoROI*, MxBool); void FUN_10030590(); diff --git a/LEGO1/lego/legoomni/include/legocharactermanager.h b/LEGO1/lego/legoomni/include/legocharactermanager.h index ec18152a..69fccb21 100644 --- a/LEGO1/lego/legoomni/include/legocharactermanager.h +++ b/LEGO1/lego/legoomni/include/legocharactermanager.h @@ -66,6 +66,7 @@ class LegoCharacterManager { void FUN_100832a0(); void FUN_10083db0(LegoROI* p_roi); void FUN_10083f10(LegoROI* p_roi); + MxBool FUN_10084ec0(LegoROI* p_roi); MxU32 FUN_10085140(LegoROI*, MxBool); LegoROI* FUN_10085210(const LegoChar*, LegoChar*, undefined); LegoROI* FUN_10085a80(LegoChar* p_und1, LegoChar* p_und2, undefined p_und3); diff --git a/LEGO1/lego/legoomni/include/legoplantmanager.h b/LEGO1/lego/legoomni/include/legoplantmanager.h index b5ac4e7b..1dcedd40 100644 --- a/LEGO1/lego/legoomni/include/legoplantmanager.h +++ b/LEGO1/lego/legoomni/include/legoplantmanager.h @@ -5,6 +5,7 @@ #include "misc/legostorage.h" #include "mxcore.h" +class LegoEntity; class LegoROI; // VTABLE: LEGO1 0x100d6758 @@ -28,6 +29,7 @@ class LegoPlantManager : public MxCore { void FUN_100263a0(undefined4 p_und); void Save(LegoStorage* p_storage); MxResult Load(LegoStorage* p_storage); + MxBool FUN_100269e0(LegoEntity* p_entity); MxU32 FUN_10026ba0(LegoROI*, MxBool); void FUN_10027120(); diff --git a/LEGO1/lego/legoomni/src/build/legobuildingmanager.cpp b/LEGO1/lego/legoomni/src/build/legobuildingmanager.cpp index 613ccca1..a97409d7 100644 --- a/LEGO1/lego/legoomni/src/build/legobuildingmanager.cpp +++ b/LEGO1/lego/legoomni/src/build/legobuildingmanager.cpp @@ -56,6 +56,13 @@ MxResult LegoBuildingManager::Load(LegoStorage* p_storage) return SUCCESS; } +// STUB: LEGO1 0x1002fdb0 +MxBool LegoBuildingManager::FUN_1002fdb0(LegoEntity* p_entity) +{ + // TODO + return FALSE; +} + // STUB: LEGO1 0x1002ff40 MxU32 LegoBuildingManager::FUN_1002ff40(LegoROI*, MxBool) { diff --git a/LEGO1/lego/legoomni/src/common/legocharactermanager.cpp b/LEGO1/lego/legoomni/src/common/legocharactermanager.cpp index 2cc1baaa..47d9a1b8 100644 --- a/LEGO1/lego/legoomni/src/common/legocharactermanager.cpp +++ b/LEGO1/lego/legoomni/src/common/legocharactermanager.cpp @@ -123,6 +123,13 @@ MxBool LegoCharacterManager::FUN_10084c00(const LegoChar*) return FALSE; } +// STUB: LEGO1 0x10084ec0 +MxBool LegoCharacterManager::FUN_10084ec0(LegoROI* p_roi) +{ + // TODO + return FALSE; +} + // STUB: LEGO1 0x10085140 MxU32 LegoCharacterManager::FUN_10085140(LegoROI*, MxBool) { diff --git a/LEGO1/lego/legoomni/src/common/legoplantmanager.cpp b/LEGO1/lego/legoomni/src/common/legoplantmanager.cpp index f4d18d3a..cc09b332 100644 --- a/LEGO1/lego/legoomni/src/common/legoplantmanager.cpp +++ b/LEGO1/lego/legoomni/src/common/legoplantmanager.cpp @@ -1,5 +1,7 @@ #include "legoplantmanager.h" +#include "legoentity.h" + DECOMP_SIZE_ASSERT(LegoPlantManager, 0x2c) // GLOBAL: LEGO1 0x100f3188 @@ -47,6 +49,13 @@ MxResult LegoPlantManager::Load(LegoStorage* p_storage) return SUCCESS; } +// STUB: LEGO1 0x100269e0 +MxBool LegoPlantManager::FUN_100269e0(LegoEntity* p_entity) +{ + // TODO + return FALSE; +} + // STUB: LEGO1 0x10026ba0 MxU32 LegoPlantManager::FUN_10026ba0(LegoROI*, MxBool) { diff --git a/LEGO1/lego/legoomni/src/entity/legoentity.cpp b/LEGO1/lego/legoomni/src/entity/legoentity.cpp index ffda6f6c..506854e2 100644 --- a/LEGO1/lego/legoomni/src/entity/legoentity.cpp +++ b/LEGO1/lego/legoomni/src/entity/legoentity.cpp @@ -276,10 +276,23 @@ void LegoEntity::VTable0x38() // TODO } -// STUB: LEGO1 0x10011300 +// FUNCTION: LEGO1 0x10011300 void LegoEntity::VTable0x3c() { - // TODO + switch (m_unk0x59) { + case 0: + CharacterManager()->FUN_10084ec0(m_roi); + break; + case 2: + PlantManager()->FUN_100269e0(this); + break; + case 3: + BuildingManager()->FUN_1002fdb0(this); + break; + } + + VTable0x34(FALSE); + VTable0x38(); } // STUB: LEGO1 0x10011360