summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPatric Stout <truebrain@openttd.org>2021-02-19 11:03:15 +0100
committerPatric Stout <github@truebrain.nl>2021-02-19 11:34:00 +0100
commit932abe6d5cd2a0e0a63f36b9c970b5ef672972b7 (patch)
tree8259cace3cf2e35a4d4713d10191cacccdc74639 /src
parent15a0ac2735e38d14052b6cc4022df986c790dd75 (diff)
downloadopenttd-932abe6d5cd2a0e0a63f36b9c970b5ef672972b7.tar.xz
Fix fa170b9: [SDL2] forgot to use GetGameInterval where needed
Diffstat (limited to 'src')
-rw-r--r--src/video/sdl2_v.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/video/sdl2_v.cpp b/src/video/sdl2_v.cpp
index bdfdbdaf1..c8f239448 100644
--- a/src/video/sdl2_v.cpp
+++ b/src/video/sdl2_v.cpp
@@ -778,11 +778,11 @@ void VideoDriver_SDL::LoopOnce()
if (cur_ticks >= next_game_tick || (_fast_forward && !_pause_mode)) {
if (_fast_forward && !_pause_mode) {
- next_game_tick = cur_ticks + std::chrono::milliseconds(MILLISECONDS_PER_TICK);
+ next_game_tick = cur_ticks + this->GetGameInterval();
} else {
- next_game_tick += std::chrono::milliseconds(MILLISECONDS_PER_TICK);
+ next_game_tick += this->GetGameInterval();
/* Avoid next_game_tick getting behind more and more if it cannot keep up. */
- if (next_game_tick < cur_ticks - std::chrono::milliseconds(ALLOWED_DRIFT * MILLISECONDS_PER_TICK)) next_game_tick = cur_ticks;
+ if (next_game_tick < cur_ticks - ALLOWED_DRIFT * this->GetGameInterval()) next_game_tick = cur_ticks;
}
/* The gameloop is the part that can run asynchronously. The rest