diff --git a/stepmania/src/GameLoop.cpp b/stepmania/src/GameLoop.cpp index afcc57c4f5..2ccd38dcda 100644 --- a/stepmania/src/GameLoop.cpp +++ b/stepmania/src/GameLoop.cpp @@ -39,6 +39,12 @@ static bool UserQuit() void HandleInputEvents( float fDeltaTime ); +static float g_fUpdateRate = 1; +void GameLoop::SetUpdateRate( float fUpdateRate ) +{ + g_fUpdateRate = fUpdateRate; +} + static void CheckGameLoopTimerSkips( float fDeltaTime ) { if( !PREFSMAN->m_bLogSkips ) @@ -137,17 +143,7 @@ void GameLoop::GameLoop() CheckGameLoopTimerSkips( fDeltaTime ); - if( INPUTFILTER->IsBeingPressed( DeviceInput(DEVICE_KEYBOARD, KEY_TAB) ) ) - { - if( INPUTFILTER->IsBeingPressed( DeviceInput(DEVICE_KEYBOARD, KEY_ACCENT) ) ) - fDeltaTime = 0; /* both; stop time */ - else - fDeltaTime *= 4; - } - else if( INPUTFILTER->IsBeingPressed( DeviceInput(DEVICE_KEYBOARD, KEY_ACCENT) ) ) - { - fDeltaTime /= 4; - } + fDeltaTime *= g_fUpdateRate; CheckFocus(); diff --git a/stepmania/src/GameLoop.h b/stepmania/src/GameLoop.h index 8a9b6a93c8..befe796d10 100644 --- a/stepmania/src/GameLoop.h +++ b/stepmania/src/GameLoop.h @@ -6,6 +6,7 @@ namespace GameLoop { void GameLoop(); + void SetUpdateRate( float fUpdateRate ); void StartConcurrentRendering(); void FinishConcurrentRendering(); }; diff --git a/stepmania/src/ScreenDebugOverlay.cpp b/stepmania/src/ScreenDebugOverlay.cpp index 799e070a31..0d473ba9a6 100644 --- a/stepmania/src/ScreenDebugOverlay.cpp +++ b/stepmania/src/ScreenDebugOverlay.cpp @@ -24,6 +24,7 @@ #include "Profile.h" #include "SongManager.h" #include "SubscriptionManager.h" +#include "GameLoop.h" static bool g_bIsDisplayed = false; static bool g_bIsSlow = false; @@ -194,6 +195,23 @@ void ScreenDebugOverlay::Init() void ScreenDebugOverlay::Update( float fDeltaTime ) { + { + float fRate = 1; + if( INPUTFILTER->IsBeingPressed( DeviceInput(DEVICE_KEYBOARD, KEY_TAB) ) ) + { + if( INPUTFILTER->IsBeingPressed( DeviceInput(DEVICE_KEYBOARD, KEY_ACCENT) ) ) + fRate = 0; /* both; stop time */ + else + fRate *= 4; + } + else if( INPUTFILTER->IsBeingPressed( DeviceInput(DEVICE_KEYBOARD, KEY_ACCENT) ) ) + { + fRate /= 4; + } + + GameLoop::SetUpdateRate( fRate ); + } + bool bCenteringNeedsUpdate = g_fImageScaleCurrent != g_fImageScaleDestination; fapproach( g_fImageScaleCurrent, g_fImageScaleDestination, fDeltaTime ); if( bCenteringNeedsUpdate )