From 9eebe181617a8a2cda31015ceea1186e296d6598 Mon Sep 17 00:00:00 2001 From: Misha <106913236+MishaProductions@users.noreply.github.com> Date: Sun, 17 Dec 2023 12:28:11 -0500 Subject: [PATCH] fix incorrect location of functions (#341) --- LEGO1/helicopter.cpp | 2 +- LEGO1/legoomni.cpp | 17 +++++++++++++++++ LEGO1/legoomni.h | 3 +++ LEGO1/legoworld.cpp | 22 ---------------------- LEGO1/legoworld.h | 4 ---- LEGO1/score.cpp | 4 ++-- 6 files changed, 23 insertions(+), 29 deletions(-) diff --git a/LEGO1/helicopter.cpp b/LEGO1/helicopter.cpp index ed75b92d..2d13e011 100644 --- a/LEGO1/helicopter.cpp +++ b/LEGO1/helicopter.cpp @@ -102,7 +102,7 @@ MxU32 Helicopter::VTable0xcc() FUN_10015820(1, 0); TransitionManager()->StartTransition(MxTransitionManager::PIXELATION, 50, FALSE, TRUE); SetUnknownDC(4); - FUN_10015910(9); + PlayMusic(9); break; case 1: m_script = *g_act2mainScript; diff --git a/LEGO1/legoomni.cpp b/LEGO1/legoomni.cpp index 5ecbb286..ff695c63 100644 --- a/LEGO1/legoomni.cpp +++ b/LEGO1/legoomni.cpp @@ -112,6 +112,9 @@ const char* g_current = "current"; // GLOBAL: LEGO1 0x101020e8 void (*g_omniUserMessage)(const char*, int); +// GLOBAL: LEGO1 0x100f4c54 +MxBool g_isWorldActive; + // FUNCTION: LEGO1 0x10015700 LegoOmni* Lego() { @@ -196,6 +199,12 @@ GifManager* GetGifManager() return LegoOmni::GetInstance()->GetGifManager(); } +// STUB: LEGO1 0x10015820 +void FUN_10015820(MxU32, MxU32) +{ + // TODO +} + // FUNCTION: LEGO1 0x100158c0 LegoEntity* FindEntityByAtomIdOrEntityId(const MxAtomId& p_atom, MxS32 p_entityid) { @@ -225,6 +234,14 @@ void PlayMusic(MxU32 p_index) LegoOmni::GetInstance()->GetBackgroundAudioManager()->PlayMusic(action, 5, 4); } +// FUNCTION: LEGO1 0x100159c0 +void SetIsWorldActive(MxBool p_isWorldActive) +{ + if (!p_isWorldActive) + LegoOmni::GetInstance()->GetInputManager()->SetCamera(NULL); + g_isWorldActive = p_isWorldActive; +} + // STUB: LEGO1 0x1001a700 void FUN_1001a700() { diff --git a/LEGO1/legoomni.h b/LEGO1/legoomni.h index d671f6f4..4edaeb35 100644 --- a/LEGO1/legoomni.h +++ b/LEGO1/legoomni.h @@ -158,9 +158,12 @@ LegoPlantManager* PlantManager(); MxBool KeyValueStringParse(char*, const char*, const char*); LegoWorld* GetCurrentWorld(); GifManager* GetGifManager(); +void FUN_10015820(MxU32, MxU32); LegoEntity* FindEntityByAtomIdOrEntityId(const MxAtomId& p_atom, MxS32 p_entityid); MxDSAction& GetCurrentAction(); +void PlayMusic(MxU32 p_index); +void SetIsWorldActive(MxBool p_isWorldActive); void RegisterScripts(); void UnregisterScripts(); diff --git a/LEGO1/legoworld.cpp b/LEGO1/legoworld.cpp index f809e1a0..11467954 100644 --- a/LEGO1/legoworld.cpp +++ b/LEGO1/legoworld.cpp @@ -9,28 +9,6 @@ DECOMP_SIZE_ASSERT(LegoWorld, 0xf8); -MxBool g_isWorldActive; - -// STUB: LEGO1 0x10015820 -void FUN_10015820(MxU32, MxU32) -{ - // TODO -} - -// STUB: LEGO1 0x10015910 -void FUN_10015910(MxU32) -{ - // TODO -} - -// FUNCTION: LEGO1 0x100159c0 -void SetIsWorldActive(MxBool p_isWorldActive) -{ - if (!p_isWorldActive) - LegoOmni::GetInstance()->GetInputManager()->SetCamera(NULL); - g_isWorldActive = p_isWorldActive; -} - // STUB: LEGO1 0x1001ca40 LegoWorld::LegoWorld() { diff --git a/LEGO1/legoworld.h b/LEGO1/legoworld.h index 60989527..fadeea5c 100644 --- a/LEGO1/legoworld.h +++ b/LEGO1/legoworld.h @@ -64,10 +64,6 @@ protected: undefined m_unk0xf7; // 0xf7 }; -void FUN_10015820(MxU32, MxU32); -void FUN_10015910(MxU32); -void SetIsWorldActive(MxBool p_isWorldActive); - // SYNTHETIC: LEGO1 0x1001eed0 // MxPresenterListCursor::`scalar deleting destructor' diff --git a/LEGO1/score.cpp b/LEGO1/score.cpp index 9f22fd0d..dcc39f02 100644 --- a/LEGO1/score.cpp +++ b/LEGO1/score.cpp @@ -119,7 +119,7 @@ MxLong Score::FUN_10001510(MxEndActionNotificationParam& p_param) TransitionManager()->StartTransition(MxTransitionManager::PIXELATION, 0x32, 0, 0); break; case 0x1f5: - FUN_10015910(0xb); + PlayMusic(11); m_state->SetTutorialFlag(FALSE); } } @@ -145,7 +145,7 @@ void Score::Stop() Start(&action); } else - FUN_10015910(0xb); + PlayMusic(11); FUN_10015820(0, 7); }