From ae54934108849d22b21fb9bae6806bcf395465b2 Mon Sep 17 00:00:00 2001 From: Christian Semmler Date: Sat, 27 Jan 2024 16:51:47 -0500 Subject: [PATCH] Fixes --- .../lego/legoomni/include/legoinputmanager.h | 8 +++---- .../legoomni/src/input/legoinputmanager.cpp | 23 +++++++++++-------- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/LEGO1/lego/legoomni/include/legoinputmanager.h b/LEGO1/lego/legoomni/include/legoinputmanager.h index 902644da..ad52e1db 100644 --- a/LEGO1/lego/legoomni/include/legoinputmanager.h +++ b/LEGO1/lego/legoomni/include/legoinputmanager.h @@ -38,8 +38,8 @@ class LegoEventQueue : public MxQueue {}; // SIZE 0x18 class LegoNotifyList : public MxPtrList { protected: - // FUNCTION: LGEO1 0x10028830 - virtual MxS8 Compare(MxCore* p_element1, MxCore* p_element2) + // FUNCTION: LEGO1 0x10028830 + virtual MxS8 Compare(MxCore* p_element1, MxCore* p_element2) override { return p_element1 == p_element2 ? 0 : p_element1 < p_element2 ? -1 : 1; } @@ -102,7 +102,7 @@ class LegoInputManager : public MxPresenter { private: MxCriticalSection m_criticalSection; // 0x58 - LegoNotifyList* m_notifyList; // 0x5c + LegoNotifyList* m_keyboardNotifyList; // 0x5c LegoCameraController* m_camera; // 0x60 LegoWorld* m_world; // 0x64 LegoEventQueue* m_eventQueue; // 0x68 @@ -119,7 +119,7 @@ class LegoInputManager : public MxPresenter { IDirectInputDevice* m_directInputDevice; // 0x90 undefined m_unk0x94; // 0x94 undefined4 m_unk0x98; // 0x98 - undefined m_unk0x9c[0xF8]; // 0x9c + undefined m_unk0x9c[0xf8]; // 0x9c undefined m_unk0x194; // 0x194 MxBool m_unk0x195; // 0x195 MxS32 m_joyid; // 0x198 diff --git a/LEGO1/lego/legoomni/src/input/legoinputmanager.cpp b/LEGO1/lego/legoomni/src/input/legoinputmanager.cpp index ba5defe6..70094103 100644 --- a/LEGO1/lego/legoomni/src/input/legoinputmanager.cpp +++ b/LEGO1/lego/legoomni/src/input/legoinputmanager.cpp @@ -16,7 +16,7 @@ MxS32 g_unk0x100f31b4 = 0; // FUNCTION: LEGO1 0x1005b790 LegoInputManager::LegoInputManager() { - m_notifyList = NULL; + m_keyboardNotifyList = NULL; m_world = NULL; m_camera = NULL; m_eventQueue = NULL; @@ -57,16 +57,19 @@ LegoInputManager::~LegoInputManager() MxResult LegoInputManager::Create(HWND p_hwnd) { MxResult result = SUCCESS; - m_controlManager = new LegoControlManager(); - if (m_notifyList == NULL) - m_notifyList = new LegoNotifyList(); - if (m_eventQueue == NULL) - m_eventQueue = new LegoEventQueue(); + + m_controlManager = new LegoControlManager; + + if (!m_keyboardNotifyList) + m_keyboardNotifyList = new LegoNotifyList; + + if (!m_eventQueue) + m_eventQueue = new LegoEventQueue; CreateAndAcquireKeyboard(p_hwnd); GetJoystickId(); - if (m_notifyList == NULL || m_eventQueue == NULL || m_directInputDevice == NULL) { + if (!m_keyboardNotifyList || !m_eventQueue || !m_directInputDevice) { Destroy(); result = FAILURE; } @@ -79,9 +82,9 @@ void LegoInputManager::Destroy() { ReleaseDX(); - if (m_notifyList) - delete m_notifyList; - m_notifyList = NULL; + if (m_keyboardNotifyList) + delete m_keyboardNotifyList; + m_keyboardNotifyList = NULL; if (m_eventQueue) delete m_eventQueue;