diff --git a/LEGO1/lego/legoomni/include/legoomni.h b/LEGO1/lego/legoomni/include/legoomni.h index d7d9a2d4..5ed0eb99 100644 --- a/LEGO1/lego/legoomni/include/legoomni.h +++ b/LEGO1/lego/legoomni/include/legoomni.h @@ -105,6 +105,7 @@ class LegoOmni : public MxOmni { LegoEntity* FindByEntityIdOrAtomId(const MxAtomId& p_atom, MxS32 p_entityid); void AddWorld(LegoWorld* p_world); + void DeleteEntity(LegoEntity* p_entity); void FUN_1005b4f0(MxBool p_disable, MxU16 p_flags); LegoVideoManager* GetVideoManager() { return (LegoVideoManager*) m_videoManager; } diff --git a/LEGO1/lego/legoomni/include/legoworld.h b/LEGO1/lego/legoomni/include/legoworld.h index 31b60f84..2d2dc920 100644 --- a/LEGO1/lego/legoomni/include/legoworld.h +++ b/LEGO1/lego/legoomni/include/legoworld.h @@ -60,6 +60,7 @@ class LegoWorld : public LegoEntity { void FUN_10073430(); MxS32 GetCurrPathInfo(LegoPathBoundary** p_path, MxS32& p_value); MxPresenter* FindPresenter(const char* p_presenter, const char* p_name); + MxCore* FUN_10021790(const MxAtomId& p_atom, MxS32 p_objectId); // SYNTHETIC: LEGO1 0x1001dee0 // LegoWorld::`scalar deleting destructor' diff --git a/LEGO1/lego/legoomni/src/entity/legoworld.cpp b/LEGO1/lego/legoomni/src/entity/legoworld.cpp index 8e5c7465..214339e8 100644 --- a/LEGO1/lego/legoomni/src/entity/legoworld.cpp +++ b/LEGO1/lego/legoomni/src/entity/legoworld.cpp @@ -163,6 +163,12 @@ MxPresenter* LegoWorld::FindPresenter(const char* p_presenter, const char* p_nam return NULL; } +// STUB: LEGO1 0x10021790 +MxCore* LegoWorld::FUN_10021790(const MxAtomId& p_atom, MxS32 p_objectId) +{ + return NULL; +} + // STUB: LEGO1 0x10021a70 void LegoWorld::VTable0x68(MxBool p_add) { diff --git a/LEGO1/lego/legoomni/src/main/legoomni.cpp b/LEGO1/lego/legoomni/src/main/legoomni.cpp index a8d06b89..640ee936 100644 --- a/LEGO1/lego/legoomni/src/main/legoomni.cpp +++ b/LEGO1/lego/legoomni/src/main/legoomni.cpp @@ -19,6 +19,7 @@ #include "mxdsfile.h" #include "mxomnicreateflags.h" #include "mxomnicreateparam.h" +#include "mxstreamer.h" #include "mxticklemanager.h" #include "mxtransitionmanager.h" @@ -605,6 +606,11 @@ void LegoOmni::AddWorld(LegoWorld* p_world) m_worldList->Append(p_world); } +// STUB: LEGO1 0x1005adb0 +void LegoOmni::DeleteEntity(LegoEntity* p_entity) +{ +} + // STUB: LEGO1 0x1005af10 void LegoOmni::RemoveWorld(const MxAtomId&, MxLong) { @@ -628,10 +634,32 @@ LegoEntity* LegoOmni::FindByEntityIdOrAtomId(const MxAtomId& p_atom, MxS32 p_ent return NULL; } -// STUB: LEGO1 0x1005b1d0 +// FUNCTION: LEGO1 0x1005b1d0 void LegoOmni::DeleteObject(MxDSAction& p_dsAction) { - // TODO + if (p_dsAction.GetAtomId().GetInternal() != NULL) { + LegoEntity* entity = FindByEntityIdOrAtomId(p_dsAction.GetAtomId(), p_dsAction.GetObjectId()); + if (entity) { + DeleteEntity(entity); + return; + } + + if (m_currentWorld != NULL) { + MxCore* entity2 = m_currentWorld->FUN_10021790(p_dsAction.GetAtomId(), p_dsAction.GetObjectId()); + m_currentWorld->EndAction(entity2); + + if (entity2->IsA("MxPresenter")) { + Streamer()->FUN_100b98f0(((MxPresenter*) entity2)->GetAction()); + ((MxPresenter*) entity2)->EndAction(); + + } + else { + delete entity2; + } + return; + } + } + MxOmni::DeleteObject(p_dsAction); } // FUNCTION: LEGO1 0x1005b2f0