From be4c351d7d6cbc0f625cf8d9d5b03f444e05f808 Mon Sep 17 00:00:00 2001 From: Christian Semmler Date: Sun, 9 Jun 2024 13:39:22 -0400 Subject: [PATCH] Rename Start/StopTimer to Pause/Resume (#1007) * Rename Start/StopTimer to Pause/Resume * Fix --- ISLE/isleapp.cpp | 8 +++--- LEGO1/lego/legoomni/include/legomain.h | 28 +++++++++---------- .../legoomni/src/entity/legonavcontroller.cpp | 6 ++-- .../legoomni/src/input/legoinputmanager.cpp | 4 +-- LEGO1/lego/legoomni/src/main/legomain.cpp | 8 +++--- LEGO1/omni/include/mxomni.h | 28 +++++++++---------- LEGO1/omni/src/main/mxomni.cpp | 14 +++++----- 7 files changed, 48 insertions(+), 48 deletions(-) diff --git a/ISLE/isleapp.cpp b/ISLE/isleapp.cpp index 9b2a6512..a22f685b 100644 --- a/ISLE/isleapp.cpp +++ b/ISLE/isleapp.cpp @@ -162,7 +162,7 @@ void IsleApp::Close() Lego()->RemoveWorld(ds.GetAtomId(), ds.GetObjectId()); Lego()->DeleteObject(ds); TransitionManager()->SetWaitIndicator(NULL); - Lego()->StopTimer(); + Lego()->Resume(); while (Streamer()->Close(NULL) == SUCCESS) { } @@ -318,7 +318,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine g_reqEnableRMDevice = FALSE; VideoManager()->EnableRMDevice(); g_rmDisabled = FALSE; - Lego()->StopTimer(); + Lego()->Resume(); } if (g_closed) { @@ -468,7 +468,7 @@ LRESULT WINAPI WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) } else if (!valid) { g_rmDisabled = TRUE; - Lego()->StartTimer(); + Lego()->Pause(); VideoManager()->DisableRMDevice(); } } @@ -832,7 +832,7 @@ inline void IsleApp::Tick(BOOL sleepIfNotNextFrame) } if (m_frameDelta + g_lastFrameTime < currentTime) { - if (!Lego()->IsTimerRunning()) { + if (!Lego()->IsPaused()) { TickleManager()->Tickle(); } g_lastFrameTime = currentTime; diff --git a/LEGO1/lego/legoomni/include/legomain.h b/LEGO1/lego/legoomni/include/legomain.h index e3264e06..98245c5c 100644 --- a/LEGO1/lego/legoomni/include/legomain.h +++ b/LEGO1/lego/legoomni/include/legomain.h @@ -75,33 +75,33 @@ public: }; LegoOmni(); - ~LegoOmni() override; // vtable+00 + ~LegoOmni() override; - MxLong Notify(MxParam& p_param) override; // vtable+04 + MxLong Notify(MxParam& p_param) override; // vtable+0x04 // FUNCTION: LEGO1 0x10058aa0 - inline const char* ClassName() const override // vtable+0c + inline const char* ClassName() const override // vtable+0x0c { // STRING: LEGO1 0x100f671c return "LegoOmni"; } // FUNCTION: LEGO1 0x10058ab0 - inline MxBool IsA(const char* p_name) const override // vtable+10 + inline MxBool IsA(const char* p_name) const override // vtable+0x10 { return !strcmp(p_name, LegoOmni::ClassName()) || MxOmni::IsA(p_name); } - void Init() override; // vtable+14 - MxResult Create(MxOmniCreateParam& p_param) override; // vtable+18 - void Destroy() override; // vtable+1c - MxResult Start(MxDSAction* p_dsAction) override; // vtable+20 - void DeleteObject(MxDSAction& p_dsAction) override; // vtable+24 - MxBool DoesEntityExist(MxDSAction& p_dsAction) override; // vtable+28 - MxEntity* AddToWorld(const char* p_id, MxS32 p_entityId, MxPresenter* p_presenter) override; // vtable+30 - void NotifyCurrentEntity(const MxNotificationParam& p_param) override; // vtable+34 - void StartTimer() override; // vtable+38 - void StopTimer() override; // vtable+3c + void Init() override; // vtable+0x14 + MxResult Create(MxOmniCreateParam& p_param) override; // vtable+0x18 + void Destroy() override; // vtable+0x1c + MxResult Start(MxDSAction* p_dsAction) override; // vtable+0x20 + void DeleteObject(MxDSAction& p_dsAction) override; // vtable+0x24 + MxBool DoesEntityExist(MxDSAction& p_dsAction) override; // vtable+0x28 + MxEntity* AddToWorld(const char* p_id, MxS32 p_entityId, MxPresenter* p_presenter) override; // vtable+0x30 + void NotifyCurrentEntity(const MxNotificationParam& p_param) override; // vtable+0x34 + void Pause() override; // vtable+0x38 + void Resume() override; // vtable+0x3c LegoWorld* FindWorld(const MxAtomId& p_atom, MxS32 p_entityid); LegoROI* FindROI(const char* p_name); diff --git a/LEGO1/lego/legoomni/src/entity/legonavcontroller.cpp b/LEGO1/lego/legoomni/src/entity/legonavcontroller.cpp index 70c2bb88..24ac051b 100644 --- a/LEGO1/lego/legoomni/src/entity/legonavcontroller.cpp +++ b/LEGO1/lego/legoomni/src/entity/legonavcontroller.cpp @@ -607,11 +607,11 @@ MxLong LegoNavController::Notify(MxParam& p_param) switch (((LegoEventNotificationParam&) p_param).GetKey()) { case VK_PAUSE: - if (Lego()->IsTimerRunning()) { - Lego()->StopTimer(); + if (Lego()->IsPaused()) { + Lego()->Resume(); } else { - Lego()->StartTimer(); + Lego()->Pause(); } break; case VK_ESCAPE: { diff --git a/LEGO1/lego/legoomni/src/input/legoinputmanager.cpp b/LEGO1/lego/legoomni/src/input/legoinputmanager.cpp index e99bdeec..8f1e196b 100644 --- a/LEGO1/lego/legoomni/src/input/legoinputmanager.cpp +++ b/LEGO1/lego/legoomni/src/input/legoinputmanager.cpp @@ -370,7 +370,7 @@ MxBool LegoInputManager::ProcessOneEvent(LegoEventNotificationParam& p_param) MxBool processRoi; if (p_param.GetType() == c_notificationKeyPress) { - if (!Lego()->IsTimerRunning() || p_param.GetKey() == VK_PAUSE) { + if (!Lego()->IsPaused() || p_param.GetKey() == VK_PAUSE) { if (p_param.GetKey() == VK_SHIFT) { if (m_unk0x195) { m_unk0x80 = FALSE; @@ -396,7 +396,7 @@ MxBool LegoInputManager::ProcessOneEvent(LegoEventNotificationParam& p_param) } } else { - if (!Lego()->IsTimerRunning()) { + if (!Lego()->IsPaused()) { processRoi = TRUE; if (m_unk0x335 != 0) { diff --git a/LEGO1/lego/legoomni/src/main/legomain.cpp b/LEGO1/lego/legoomni/src/main/legomain.cpp index ba6d7d84..e6c2cdc1 100644 --- a/LEGO1/lego/legoomni/src/main/legomain.cpp +++ b/LEGO1/lego/legoomni/src/main/legomain.cpp @@ -579,15 +579,15 @@ MxLong LegoOmni::Notify(MxParam& p_param) } // FUNCTION: LEGO1 0x1005b640 -void LegoOmni::StartTimer() +void LegoOmni::Pause() { - MxOmni::StartTimer(); + MxOmni::Pause(); SetAppCursor(e_cursorNo); } // FUNCTION: LEGO1 0x1005b650 -void LegoOmni::StopTimer() +void LegoOmni::Resume() { - MxOmni::StopTimer(); + MxOmni::Resume(); SetAppCursor(e_cursorArrow); } diff --git a/LEGO1/omni/include/mxomni.h b/LEGO1/omni/include/mxomni.h index cb32e8c6..40777113 100644 --- a/LEGO1/omni/include/mxomni.h +++ b/LEGO1/omni/include/mxomni.h @@ -39,21 +39,21 @@ public: MxOmni(); ~MxOmni() override; - MxLong Notify(MxParam& p_param) override; // vtable+04 - virtual void Init(); // vtable+14 - virtual MxResult Create(MxOmniCreateParam& p_param); // vtable+18 - virtual void Destroy(); // vtable+1c - virtual MxResult Start(MxDSAction* p_dsAction); // vtable+20 - virtual void DeleteObject(MxDSAction& p_dsAction); // vtable+24 - virtual MxBool DoesEntityExist(MxDSAction& p_dsAction); // vtable+28 - virtual MxResult CreatePresenter(MxStreamController* p_controller, MxDSAction& p_action); // vtable+2c - virtual MxEntity* AddToWorld(const char*, MxS32, MxPresenter*); // vtable+30 - virtual void NotifyCurrentEntity(const MxNotificationParam& p_param); // vtable+34 - virtual void StartTimer(); // vtable+38 - virtual void StopTimer(); // vtable+3c + MxLong Notify(MxParam& p_param) override; // vtable+0x04 + virtual void Init(); // vtable+0x14 + virtual MxResult Create(MxOmniCreateParam& p_param); // vtable+0x18 + virtual void Destroy(); // vtable+0x1c + virtual MxResult Start(MxDSAction* p_dsAction); // vtable+0x20 + virtual void DeleteObject(MxDSAction& p_dsAction); // vtable+0x24 + virtual MxBool DoesEntityExist(MxDSAction& p_dsAction); // vtable+0x28 + virtual MxResult CreatePresenter(MxStreamController* p_controller, MxDSAction& p_action); // vtable+0x2c + virtual MxEntity* AddToWorld(const char*, MxS32, MxPresenter*); // vtable+0x30 + virtual void NotifyCurrentEntity(const MxNotificationParam& p_param); // vtable+0x34 + virtual void Pause(); // vtable+0x38 + virtual void Resume(); // vtable+0x3c // FUNCTION: LEGO1 0x10058a90 - virtual MxBool IsTimerRunning() { return m_timerRunning; } // vtable+40 + virtual MxBool IsPaused() { return m_paused; } // vtable+0x40 static void SetInstance(MxOmni* p_instance); static MxBool ActionSourceEquals(MxDSAction* p_action, const char* p_name); @@ -115,7 +115,7 @@ protected: MxStreamer* m_streamer; // 0x40 MxAtomSet* m_atomSet; // 0x44 MxCriticalSection m_criticalSection; // 0x48 - MxBool m_timerRunning; // 0x64 + MxBool m_paused; // 0x64 }; #endif // MXOMNI_H diff --git a/LEGO1/omni/src/main/mxomni.cpp b/LEGO1/omni/src/main/mxomni.cpp index 29196431..9e16a557 100644 --- a/LEGO1/omni/src/main/mxomni.cpp +++ b/LEGO1/omni/src/main/mxomni.cpp @@ -68,7 +68,7 @@ void MxOmni::Init() m_timer = NULL; m_streamer = NULL; m_atomSet = NULL; - m_timerRunning = FALSE; + m_paused = FALSE; } // FUNCTION: LEGO1 0x100af0b0 @@ -409,21 +409,21 @@ MxBool MxOmni::DoesEntityExist(MxDSAction& p_dsAction) } // FUNCTION: LEGO1 0x100b09d0 -void MxOmni::StartTimer() +void MxOmni::Pause() { - if (m_timerRunning == FALSE && m_timer != NULL && m_soundManager != NULL) { + if (m_paused == FALSE && m_timer != NULL && m_soundManager != NULL) { m_timer->Start(); m_soundManager->Pause(); - m_timerRunning = TRUE; + m_paused = TRUE; } } // FUNCTION: LEGO1 0x100b0a00 -void MxOmni::StopTimer() +void MxOmni::Resume() { - if (m_timerRunning != FALSE && m_timer != NULL && m_soundManager != NULL) { + if (m_paused != FALSE && m_timer != NULL && m_soundManager != NULL) { m_timer->Stop(); m_soundManager->Resume(); - m_timerRunning = FALSE; + m_paused = FALSE; } }