diff --git a/LEGO1/lego/legoomni/include/legoinputmanager.h b/LEGO1/lego/legoomni/include/legoinputmanager.h index 03086cd3..251c52b5 100644 --- a/LEGO1/lego/legoomni/include/legoinputmanager.h +++ b/LEGO1/lego/legoomni/include/legoinputmanager.h @@ -46,7 +46,7 @@ class LegoInputManager : public MxPresenter { MxResult GetJoystickState(MxU32* p_joystickX, MxU32* p_joystickY, DWORD* p_buttonsState, MxU32* p_povPosition); void SetTimer(); void KillTimer(); - void FUN_1005cff0(); + void EnableInputProcessing(); void SetCamera(LegoCameraController* p_camera); void ClearCamera(); void SetWorld(LegoWorld* p_world); @@ -58,10 +58,10 @@ class LegoInputManager : public MxPresenter { inline void SetUseJoystick(MxBool p_useJoystick) { m_useJoystick = p_useJoystick; } inline void SetJoystickIndex(MxS32 p_joystickIndex) { m_joystickIndex = p_joystickIndex; } - inline void AllowEventProcessing() + inline void DisableInputProcessing() { - m_unk0x88 = 1; - m_unk0x336 = 0; + m_unk0x88 = TRUE; + m_unk0x336 = FALSE; } inline LegoControlManager* GetControlManager() { return m_controlManager; } diff --git a/LEGO1/lego/legoomni/include/legoomni.h b/LEGO1/lego/legoomni/include/legoomni.h index a22ce725..55166b37 100644 --- a/LEGO1/lego/legoomni/include/legoomni.h +++ b/LEGO1/lego/legoomni/include/legoomni.h @@ -62,6 +62,12 @@ extern MxAtomId* g_nocdSourceName; // SIZE 0x140 class LegoOmni : public MxOmni { public: + enum { + c_disableInput = 0x01, + c_disable3d = 0x02, + c_clearScreen = 0x04 + }; + __declspec(dllexport) void CreateBackgroundAudio(); __declspec(dllexport) void RemoveWorld(const MxAtomId&, MxLong); __declspec(dllexport) static int GetCurrPathInfo(LegoPathBoundary**, MxS32&); @@ -99,7 +105,7 @@ class LegoOmni : public MxOmni { LegoEntity* FindByEntityIdOrAtomId(const MxAtomId& p_atom, MxS32 p_entityid); void AddWorld(LegoWorld* p_world); - void FUN_1005b4f0(MxBool p_is3d, MxU32 p_flags); + void FUN_1005b4f0(MxBool p_disable, MxU16 p_flags); LegoVideoManager* GetVideoManager() { return (LegoVideoManager*) m_videoManager; } LegoSoundManager* GetSoundManager() { return (LegoSoundManager*) m_soundManager; } @@ -163,7 +169,7 @@ LegoPlantManager* PlantManager(); LegoWorld* GetCurrentWorld(); LegoUnkSaveDataWriter* GetUnkSaveDataWriter(); GifManager* GetGifManager(); -void FUN_10015820(MxBool p_is3d, MxU32 p_flags); +void FUN_10015820(MxBool p_disable, MxU16 p_flags); void FUN_10015860(const char*, MxU8); LegoEntity* FindEntityByAtomIdOrEntityId(const MxAtomId& p_atom, MxS32 p_entityid); MxDSAction& GetCurrentAction(); diff --git a/LEGO1/lego/legoomni/src/entity/legoworldpresenter.cpp b/LEGO1/lego/legoomni/src/entity/legoworldpresenter.cpp index 180c86e8..9406bf0b 100644 --- a/LEGO1/lego/legoomni/src/entity/legoworldpresenter.cpp +++ b/LEGO1/lego/legoomni/src/entity/legoworldpresenter.cpp @@ -45,7 +45,7 @@ LegoWorldPresenter::~LegoWorldPresenter() } if (result == FALSE) { - FUN_10015820(0, 7); + FUN_10015820(0, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen); } if (m_entity) { diff --git a/LEGO1/lego/legoomni/src/infocenter/infocenter.cpp b/LEGO1/lego/legoomni/src/infocenter/infocenter.cpp index 0cba8908..4c575243 100644 --- a/LEGO1/lego/legoomni/src/infocenter/infocenter.cpp +++ b/LEGO1/lego/legoomni/src/infocenter/infocenter.cpp @@ -304,7 +304,7 @@ void Infocenter::VTable0x50() PlayDialogue(c_letsGetStartedDialogue); PlayMusic(11); - FUN_10015820(0, 7); + FUN_10015820(0, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen); return; default: PlayMusic(11); @@ -313,7 +313,7 @@ void Infocenter::VTable0x50() case 8: PlayMusic(11); PlayDialogue(c_exitConfirmationDialogue); - FUN_10015820(0, 7); + FUN_10015820(0, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen); return; case 0xf: if (m_infocenterState->GetInfocenterBufferElement(0) == 0) { @@ -322,7 +322,7 @@ void Infocenter::VTable0x50() PlayDialogue(c_clickOnInfomanDialogue); PlayMusic(11); - FUN_10015820(0, 7); + FUN_10015820(0, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen); return; } break; @@ -334,7 +334,7 @@ void Infocenter::VTable0x50() break; default: m_infocenterState->SetUnknown0x74(11); - FUN_10015820(0, 7); + FUN_10015820(0, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen); return; } } @@ -469,7 +469,7 @@ void Infocenter::StopCutscene() VideoManager()->EnableFullScreenMovie(FALSE); InputManager()->SetUnknown335(FALSE); SetAppCursor(0); // Restore cursor to arrow - FUN_10015820(0, 7); + FUN_10015820(0, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen); } // FUNCTION: LEGO1 0x10070d00 diff --git a/LEGO1/lego/legoomni/src/infocenter/score.cpp b/LEGO1/lego/legoomni/src/infocenter/score.cpp index ce593ac1..639c9da5 100644 --- a/LEGO1/lego/legoomni/src/infocenter/score.cpp +++ b/LEGO1/lego/legoomni/src/infocenter/score.cpp @@ -147,7 +147,7 @@ void Score::VTable0x50() else PlayMusic(11); - FUN_10015820(0, 7); + FUN_10015820(0, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen); } // FUNCTION: LEGO1 0x100016d0 diff --git a/LEGO1/lego/legoomni/src/input/legoinputmanager.cpp b/LEGO1/lego/legoomni/src/input/legoinputmanager.cpp index ea8e8274..87c72a63 100644 --- a/LEGO1/lego/legoomni/src/input/legoinputmanager.cpp +++ b/LEGO1/lego/legoomni/src/input/legoinputmanager.cpp @@ -279,7 +279,7 @@ void LegoInputManager::KillTimer() } // FUNCTION: LEGO1 0x1005cff0 -void LegoInputManager::FUN_1005cff0() +void LegoInputManager::EnableInputProcessing() { m_unk0x88 = FALSE; g_unk0x100f31b0 = -1; diff --git a/LEGO1/lego/legoomni/src/isle/isle.cpp b/LEGO1/lego/legoomni/src/isle/isle.cpp index 0da6189f..e4a60fb1 100644 --- a/LEGO1/lego/legoomni/src/isle/isle.cpp +++ b/LEGO1/lego/legoomni/src/isle/isle.cpp @@ -166,7 +166,7 @@ void Isle::VTable0x50() FUN_1003ef00(TRUE); FUN_10032620(); m_act1state->FUN_10034d00(); - FUN_10015820(0, 7); + FUN_10015820(0, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen); } } diff --git a/LEGO1/lego/legoomni/src/main/legoomni.cpp b/LEGO1/lego/legoomni/src/main/legoomni.cpp index d767bd38..0f297e04 100644 --- a/LEGO1/lego/legoomni/src/main/legoomni.cpp +++ b/LEGO1/lego/legoomni/src/main/legoomni.cpp @@ -207,9 +207,9 @@ GifManager* GetGifManager() } // FUNCTION: LEGO1 0x10015820 -void FUN_10015820(MxBool p_is3d, MxU32 p_flags) +void FUN_10015820(MxBool p_disable, MxU16 p_flags) { - LegoOmni::GetInstance()->FUN_1005b4f0(p_is3d, p_flags); + LegoOmni::GetInstance()->FUN_1005b4f0(p_disable, p_flags); } // STUB: LEGO1 0x10015860 @@ -681,23 +681,25 @@ MxS32 LegoOmni::GetCurrPathInfo(LegoPathBoundary** p_path, MxS32& p_value) } // FUNCTION: LEGO1 0x1005b4f0 -void LegoOmni::FUN_1005b4f0(MxBool p_is3d, MxU32 p_flags) +void LegoOmni::FUN_1005b4f0(MxBool p_disable, MxU16 p_flags) { - if (p_is3d) { - if (p_flags & 1) { - m_inputMgr->AllowEventProcessing(); + if (p_disable) { + if (p_flags & c_disableInput) { + m_inputMgr->DisableInputProcessing(); } - if (p_flags & 2) { + if (p_flags & c_disable3d) { ((LegoVideoManager*) m_videoManager)->SetRender3D(FALSE); } - if (p_flags & 4) { + if (p_flags & c_clearScreen) { m_videoManager->GetDisplaySurface()->ClearScreen(); } } else { - m_inputMgr->FUN_1005cff0(); + m_inputMgr->EnableInputProcessing(); + ((LegoVideoManager*) m_videoManager)->SetRender3D(TRUE); + ((LegoVideoManager*) m_videoManager)->VTable0x34(0, 0, 0, 0); } }