summaryrefslogtreecommitdiff
path: root/src/video/video_driver.cpp
diff options
context:
space:
mode:
authorPatric Stout <truebrain@openttd.org>2021-02-24 14:50:52 +0100
committerPatric Stout <github@truebrain.nl>2021-02-24 21:58:47 +0100
commit67d3c6aa7186fe54725d06cc246a95dc62a4bbfb (patch)
treefe745371c697cd2e572eddcf46449ddf101631b6 /src/video/video_driver.cpp
parentc409f45ddd12bbd399dcda4a33043ce261da4dc4 (diff)
downloadopenttd-67d3c6aa7186fe54725d06cc246a95dc62a4bbfb.tar.xz
Codechange: [Video] move InteractiveRandom() to the VideoDriver
Diffstat (limited to 'src/video/video_driver.cpp')
-rw-r--r--src/video/video_driver.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/video/video_driver.cpp b/src/video/video_driver.cpp
index d20879be9..bc9d28ff0 100644
--- a/src/video/video_driver.cpp
+++ b/src/video/video_driver.cpp
@@ -9,6 +9,7 @@
#include "../stdafx.h"
#include "../debug.h"
+#include "../core/random_func.hpp"
#include "../gfx_func.h"
#include "../progress.h"
#include "../thread.h"
@@ -24,6 +25,10 @@ bool VideoDriver::Tick()
auto delta = std::chrono::duration_cast<std::chrono::milliseconds>(cur_ticks - this->last_realtime_tick);
_realtime_tick += delta.count();
this->last_realtime_tick += delta;
+
+ /* Keep the interactive randomizer a bit more random by requesting
+ * new values when-ever we can. */
+ InteractiveRandom();
}
if (cur_ticks >= this->next_game_tick || (_fast_forward && !_pause_mode)) {