From db4ea77ed9ac5990d3101aa10c648fc14f968ae8 Mon Sep 17 00:00:00 2001 From: notmatthewbeshay <92357869+NotMachow@users.noreply.github.com> Date: Tue, 10 Mar 2026 22:22:37 +1100 Subject: [PATCH] Use standard timer types in UIController --- .../Platform/Common/UI/UIController.cpp | 30 +++++++++---------- .../Platform/Common/UI/UIController.h | 4 +-- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Minecraft.Client/Platform/Common/UI/UIController.cpp b/Minecraft.Client/Platform/Common/UI/UIController.cpp index 9b5751c0e..cec52e2eb 100644 --- a/Minecraft.Client/Platform/Common/UI/UIController.cpp +++ b/Minecraft.Client/Platform/Common/UI/UIController.cpp @@ -50,7 +50,7 @@ CRITICAL_SECTION UIController::ms_reloadSkinCS; bool UIController::ms_bReloadSkinCSInitialised = false; -DWORD UIController::m_dwTrialTimerLimitSecs=DYNAMIC_CONFIG_DEFAULT_TRIAL_TIME; +std::uint32_t UIController::m_dwTrialTimerLimitSecs = DYNAMIC_CONFIG_DEFAULT_TRIAL_TIME; static void RADLINK WarningCallback(void *user_callback_data, Iggy *player, IggyResult code, const char *message) { @@ -898,7 +898,7 @@ void UIController::handleKeyPress(unsigned int iPad, unsigned int key) else if (down) { // Check is enough time has elapsed to be a repeat key - DWORD currentTime = GetTickCount(); + std::uint32_t currentTime = GetTickCount(); if(m_actionRepeatTimer[iPad][key] > 0 && currentTime > m_actionRepeatTimer[iPad][key]) { repeat = true; @@ -935,7 +935,7 @@ void UIController::handleKeyPress(unsigned int iPad, unsigned int key) else if (down) { // Check is enough time has elapsed to be a repeat key - DWORD currentTime = GetTickCount(); + std::uint32_t currentTime = GetTickCount(); if(m_actionRepeatTimer[iPad][key] > 0 && currentTime > m_actionRepeatTimer[iPad][key]) { repeat = true; @@ -2256,24 +2256,24 @@ void UIController::UpdateTrialTimer(unsigned int iPad) { WCHAR wcTime[20]; - DWORD dwTimeTicks=(DWORD)app.getTrialTimer(); + std::uint32_t timeTicks = (std::uint32_t)app.getTrialTimer(); - if(dwTimeTicks>m_dwTrialTimerLimitSecs) + if(timeTicks > m_dwTrialTimerLimitSecs) { - dwTimeTicks=m_dwTrialTimerLimitSecs; + timeTicks = m_dwTrialTimerLimitSecs; } - dwTimeTicks=m_dwTrialTimerLimitSecs-dwTimeTicks; + timeTicks = m_dwTrialTimerLimitSecs - timeTicks; #ifndef _CONTENT_PACKAGE if(true) #else // display the time - only if there's less than 3 minutes - if(dwTimeTicks<180) + if(timeTicks < 180) #endif { - int iMins=dwTimeTicks/60; - int iSeconds=dwTimeTicks%60; + int iMins = timeTicks / 60; + int iSeconds = timeTicks % 60; swprintf( wcTime, 20, L"%d:%02d",iMins,iSeconds); if(m_groups[(int)eUIGroup_Fullscreen]->getPressStartToPlay()) m_groups[(int)eUIGroup_Fullscreen]->getPressStartToPlay()->setTrialTimer(wcTime); } @@ -2283,7 +2283,7 @@ void UIController::UpdateTrialTimer(unsigned int iPad) } // are we out of time? - if((dwTimeTicks==0)) + if(timeTicks == 0) { // Trial over // bring up the pause menu to stop the trial over message box being called again? @@ -2298,14 +2298,14 @@ void UIController::UpdateTrialTimer(unsigned int iPad) void UIController::ReduceTrialTimerValue() { - DWORD dwTimeTicks=(int)app.getTrialTimer(); + std::uint32_t timeTicks = (std::uint32_t)app.getTrialTimer(); - if(dwTimeTicks>m_dwTrialTimerLimitSecs) + if(timeTicks > m_dwTrialTimerLimitSecs) { - dwTimeTicks=m_dwTrialTimerLimitSecs; + timeTicks = m_dwTrialTimerLimitSecs; } - m_dwTrialTimerLimitSecs-=dwTimeTicks; + m_dwTrialTimerLimitSecs -= timeTicks; } void UIController::ShowAutosaveCountdownTimer(bool show) diff --git a/Minecraft.Client/Platform/Common/UI/UIController.h b/Minecraft.Client/Platform/Common/UI/UIController.h index 84aa15b20..707e7de1a 100644 --- a/Minecraft.Client/Platform/Common/UI/UIController.h +++ b/Minecraft.Client/Platform/Common/UI/UIController.h @@ -32,7 +32,7 @@ private: static const int UI_REPEAT_KEY_DELAY_MS = 300; // How long from press until the first repeat static const int UI_REPEAT_KEY_REPEAT_RATE_MS = 100; // How long in between repeats - DWORD m_actionRepeatTimer[XUSER_MAX_COUNT][ACTION_MAX_MENU+1]; + std::uint32_t m_actionRepeatTimer[XUSER_MAX_COUNT][ACTION_MAX_MENU+1]; float m_fScreenWidth; float m_fScreenHeight; @@ -113,7 +113,7 @@ private: C4JRender::eViewportType m_currentRenderViewport; bool m_bCustomRenderPosition; - static DWORD m_dwTrialTimerLimitSecs; + static std::uint32_t m_dwTrialTimerLimitSecs; std::unordered_map m_substitutionTextures;