@@ -16,13 +16,13 @@
#include "../thread.h"
#include "../window_func.h"
#include "video_driver.hpp"
bool _video_hw_accel; ///< Whether to consider hardware accelerated video drivers.
bool VideoDriver::Tick()
void VideoDriver::Tick()
{
auto cur_ticks = std::chrono::steady_clock::now();
if (cur_ticks >= this->next_game_tick) {
this->next_game_tick += this->GetGameInterval();
/* Avoid next_game_tick getting behind more and more if it cannot keep up. */
@@ -63,18 +63,16 @@ bool VideoDriver::Tick()
ChangeGameSpeed(false);
this->fast_forward_via_key = false;
}
::InputLoop();
UpdateWindows();
this->CheckPaletteAnim();
return true;
this->Paint();
return false;
void VideoDriver::SleepTillNextTick()
/* See how much time there is till we have to process the next event, and try to hit that as close as possible. */
auto next_tick = std::min(this->next_draw_tick, this->next_game_tick);