diff options
author | Patric Stout <truebrain@openttd.org> | 2021-03-09 20:26:01 +0100 |
---|---|---|
committer | Patric Stout <github@truebrain.nl> | 2021-03-10 13:41:18 +0100 |
commit | b349ef6e714db1a3097f813b25373188ac627e2c (patch) | |
tree | 3e4762c8acfd4df29b80c5d505a26843de1aeeca | |
parent | 970fedd78cef3f5ef7a26fcaf4fd9db0f6abbe4b (diff) | |
download | openttd-b349ef6e714db1a3097f813b25373188ac627e2c.tar.xz |
Fix: don't update framerates when a modal window is open
Otherwise the numbers are all over the place when a modal window
just closed.
-rw-r--r-- | src/openttd.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/openttd.cpp b/src/openttd.cpp index 2d37c8e3a..035e8e5ae 100644 --- a/src/openttd.cpp +++ b/src/openttd.cpp @@ -1347,8 +1347,8 @@ void StateGameLoop() StateGameLoop_LinkGraphPauseControl(); } - /* don't execute the state loop during pause */ - if (_pause_mode != PM_UNPAUSED) { + /* Don't execute the state loop during pause or when modal windows are open. */ + if (_pause_mode != PM_UNPAUSED || HasModalProgress()) { PerformanceMeasurer::Paused(PFE_GAMELOOP); PerformanceMeasurer::Paused(PFE_GL_ECONOMY); PerformanceMeasurer::Paused(PFE_GL_TRAINS); @@ -1357,7 +1357,7 @@ void StateGameLoop() PerformanceMeasurer::Paused(PFE_GL_AIRCRAFT); PerformanceMeasurer::Paused(PFE_GL_LANDSCAPE); - UpdateLandscapingLimits(); + if (!HasModalProgress()) UpdateLandscapingLimits(); #ifndef DEBUG_DUMP_COMMANDS Game::GameLoop(); #endif @@ -1366,7 +1366,6 @@ void StateGameLoop() PerformanceMeasurer framerate(PFE_GAMELOOP); PerformanceAccumulator::Reset(PFE_GL_LANDSCAPE); - if (HasModalProgress()) return; Layouter::ReduceLineCache(); |