From c81c6e5eb7a0e991039b7662868e87a8d2fe3415 Mon Sep 17 00:00:00 2001 From: Patric Stout Date: Wed, 17 Feb 2021 15:04:46 +0100 Subject: Add: draw the screen at a steady pace, also during fast-forward During fast-forward, the game was drawing as fast as it could. This means that the fast-forward was limited also by how fast we could draw, something that people in general don't expect. To give an extreme case, if you are fully zoomed out on a busy map, fast-forward would be mostly limited because of the time it takes to draw the screen. By decoupling the draw-tick and game-tick, we can keep the pace of the draw-tick the same while speeding up the game-tick. To use the extreme case as example again, if you are fully zoomed out now, the screen only redraws 33.33 times per second, fast-forwarding or not. This means fast-forward is much more likely to go at the same speed, no matter what you are looking at. --- src/video/null_v.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/video/null_v.cpp') diff --git a/src/video/null_v.cpp b/src/video/null_v.cpp index 49f394153..35dd7b075 100644 --- a/src/video/null_v.cpp +++ b/src/video/null_v.cpp @@ -10,6 +10,7 @@ #include "../stdafx.h" #include "../gfx_func.h" #include "../blitter/factory.hpp" +#include "../window_func.h" #include "null_v.h" #include "../safeguards.h" @@ -48,6 +49,7 @@ void VideoDriver_Null::MainLoop() for (i = 0; i < this->ticks; i++) { GameLoop(); + InputLoop(); UpdateWindows(); } } -- cgit v1.2.3-54-g00ecf