From 535fdb5c89f22944e9276aaa3d6777defc947a17 Mon Sep 17 00:00:00 2001 From: Patric Stout Date: Fri, 26 Feb 2021 13:01:12 +0000 Subject: [PATCH] Codechange: remove _realtime_tick variable (cherry picked from commit fe451b8dc76caf87f09b120b9d57b7f4eff5d46c) # Conflicts: # src/debug.cpp # src/debug.h # src/video/video_driver.cpp --- src/debug.cpp | 2 -- src/debug.h | 3 --- src/video/video_driver.cpp | 7 ------- src/video/video_driver.hpp | 1 - 4 files changed, 13 deletions(-) diff --git a/src/debug.cpp b/src/debug.cpp index 80ce694b65..f88d13f116 100644 --- a/src/debug.cpp +++ b/src/debug.cpp @@ -60,8 +60,6 @@ std::string _loadgame_DBGL_data; bool _save_DBGC_data = false; std::string _loadgame_DBGC_data; -uint32 _realtime_tick = 0; - struct DebugLevel { const char *name; int *level; diff --git a/src/debug.h b/src/debug.h index d14fa7b06f..f13a5ebca3 100644 --- a/src/debug.h +++ b/src/debug.h @@ -131,9 +131,6 @@ void CDECL ShowInfoF(const char *str, ...) WARN_FORMAT(1, 2); const char *GetLogPrefix(); -/** The real time in the game. */ -extern uint32 _realtime_tick; - void ClearDesyncMsgLog(); void LogDesyncMsg(std::string msg); char *DumpDesyncMsgLog(char *buffer, const char *last); diff --git a/src/video/video_driver.cpp b/src/video/video_driver.cpp index 5405e40528..d769651245 100644 --- a/src/video/video_driver.cpp +++ b/src/video/video_driver.cpp @@ -19,13 +19,6 @@ bool VideoDriver::Tick() { auto cur_ticks = std::chrono::steady_clock::now(); - /* If more than a millisecond has passed, increase the _realtime_tick. */ - if (cur_ticks - this->last_realtime_tick > std::chrono::milliseconds(1)) { - auto delta = std::chrono::duration_cast(cur_ticks - this->last_realtime_tick); - _realtime_tick += delta.count(); - this->last_realtime_tick += delta; - } - if (cur_ticks >= this->next_game_tick || (_fast_forward && !_pause_mode)) { if (_fast_forward && !_pause_mode) { this->next_game_tick = cur_ticks + this->GetGameInterval(); diff --git a/src/video/video_driver.hpp b/src/video/video_driver.hpp index 0d30a59433..fad40b4e65 100644 --- a/src/video/video_driver.hpp +++ b/src/video/video_driver.hpp @@ -210,7 +210,6 @@ protected: return std::chrono::microseconds(1000000 / _settings_client.gui.refresh_rate); } - std::chrono::steady_clock::time_point last_realtime_tick; std::chrono::steady_clock::time_point next_game_tick; std::chrono::steady_clock::time_point next_draw_tick; };