diff --git a/LEGO1/lego/legoomni/include/legoomni.h b/LEGO1/lego/legoomni/include/legoomni.h index 0d31d48b..bcfd38c0 100644 --- a/LEGO1/lego/legoomni/include/legoomni.h +++ b/LEGO1/lego/legoomni/include/legoomni.h @@ -104,6 +104,7 @@ class LegoOmni : public MxOmni { void FUN_1005b4f0(MxBool p_disable, MxU16 p_flags); void CreateBackgroundAudio(); void RemoveWorld(const MxAtomId&, MxLong); + undefined4 FUN_1005b490(char* p_worldName); static MxS32 GetCurrPathInfo(LegoPathBoundary**, MxS32&); static void CreateInstance(); diff --git a/LEGO1/lego/legoomni/include/legoworld.h b/LEGO1/lego/legoomni/include/legoworld.h index 5ac75643..28f8a627 100644 --- a/LEGO1/lego/legoomni/include/legoworld.h +++ b/LEGO1/lego/legoomni/include/legoworld.h @@ -65,6 +65,7 @@ class LegoWorld : public LegoEntity { virtual void Enable(MxBool p_enable); // vtable+0x68 inline LegoCameraController* GetCamera() { return m_cameraController; } + inline void SetUnknown0xec(undefined4 p_unk0xec) { m_unk0xec = p_unk0xec; } inline undefined4 GetUnknown0xec() { return m_unk0xec; } inline MxCoreSet& GetUnknown0xd0() { return m_set0xd0; } diff --git a/LEGO1/lego/legoomni/src/entity/legoworldpresenter.cpp b/LEGO1/lego/legoomni/src/entity/legoworldpresenter.cpp index d4e002de..174f5a9c 100644 --- a/LEGO1/lego/legoomni/src/entity/legoworldpresenter.cpp +++ b/LEGO1/lego/legoomni/src/entity/legoworldpresenter.cpp @@ -1,5 +1,6 @@ #include "legoworldpresenter.h" +#include "define.h" #include "legoanimationmanager.h" #include "legobuildingmanager.h" #include "legoentity.h" @@ -16,6 +17,7 @@ #include "mxobjectfactory.h" #include "mxpresenter.h" #include "mxstl/stlcompat.h" +#include "mxutil.h" // GLOBAL: LEGO1 0x100f75d4 undefined4 g_legoWorldPresenterQuality = 1; @@ -147,6 +149,11 @@ void LegoWorldPresenter::StartingTickle() ProgressTickleState(e_streaming); } +// STUB: LEGO1 0x10066b40 +void LoadWorld(char* p_worldName, LegoWorld* p_world) +{ +} + // FUNCTION: LEGO1 0x10067a70 void LegoWorldPresenter::VTable0x60(MxPresenter* p_presenter) { @@ -170,7 +177,21 @@ void LegoWorldPresenter::VTable0x60(MxPresenter* p_presenter) } } -// STUB: LEGO1 0x10067b00 +// FUNCTION: LEGO1 0x10067b00 void LegoWorldPresenter::ParseExtra() { + char data[1024]; + char output[1024]; + MxU16 len = m_action->GetExtraLength(); + *((MxU16*) &data[0]) = m_action->GetExtraLength(); + if (len != 0) { + memcpy(data, m_action->GetExtraData(), len); + data[len] = 0; + + if (KeyValueStringParse(output, g_strWORLD, data)) { + char* worldName = strtok(output, g_parseExtraTokens); + LoadWorld(worldName, (LegoWorld*) m_entity); + ((LegoWorld*) m_entity)->SetUnknown0xec(Lego()->FUN_1005b490(worldName)); + } + } } diff --git a/LEGO1/lego/legoomni/src/main/legoomni.cpp b/LEGO1/lego/legoomni/src/main/legoomni.cpp index f0663105..08ea6368 100644 --- a/LEGO1/lego/legoomni/src/main/legoomni.cpp +++ b/LEGO1/lego/legoomni/src/main/legoomni.cpp @@ -754,6 +754,12 @@ MxS32 LegoOmni::GetCurrPathInfo(LegoPathBoundary** p_path, MxS32& p_value) return ::CurrentWorld()->GetCurrPathInfo(p_path, p_value); } +// STUB: LEGO1 0x1005b490 +undefined4 LegoOmni::FUN_1005b490(char* p_worldName) +{ + return -1; +} + // FUNCTION: LEGO1 0x1005b4f0 void LegoOmni::FUN_1005b4f0(MxBool p_disable, MxU16 p_flags) {