From 2a13c8623c4746e11a7514b21ffe9ba2d0008c5d Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Mon, 5 Apr 2021 19:55:53 +0100 Subject: [PATCH] Revert: 4c59dfb6, move DoPaletteAnimations back into GameLoop Race fix to follow --- src/gfx.cpp | 5 ----- src/gfx_func.h | 1 - src/openttd.cpp | 3 +++ src/video/null_v.cpp | 2 -- src/video/video_driver.cpp | 4 ---- 5 files changed, 3 insertions(+), 12 deletions(-) diff --git a/src/gfx.cpp b/src/gfx.cpp index 46ca0ffd0d..e16ec1064c 100644 --- a/src/gfx.cpp +++ b/src/gfx.cpp @@ -1279,11 +1279,6 @@ void DoPaletteAnimations() } } -void GameLoopPaletteAnimations() -{ - if (!_pause_mode && HasBit(_display_opt, DO_FULL_ANIMATION)) DoPaletteAnimations(); -} - /** * Determine a contrasty text colour for a coloured background. * @param background Background colour. diff --git a/src/gfx_func.h b/src/gfx_func.h index c6c8927b74..070e5effe0 100644 --- a/src/gfx_func.h +++ b/src/gfx_func.h @@ -44,7 +44,6 @@ #include "string_type.h" void GameLoop(); -void GameLoopPaletteAnimations(); void CreateConsole(); diff --git a/src/openttd.cpp b/src/openttd.cpp index fd17d1593b..45eaaf2a19 100644 --- a/src/openttd.cpp +++ b/src/openttd.cpp @@ -94,6 +94,7 @@ void CallLandscapeTick(); void IncreaseDate(); +void DoPaletteAnimations(); void MusicLoop(); void ResetMusic(); void CallWindowGameTickEvent(); @@ -1970,6 +1971,8 @@ void GameLoop() StateGameLoop(); } + if (!_pause_mode && HasBit(_display_opt, DO_FULL_ANIMATION)) DoPaletteAnimations(); + SoundDriver::GetInstance()->MainLoop(); MusicLoop(); } diff --git a/src/video/null_v.cpp b/src/video/null_v.cpp index 21e727da0e..e5fc79faee 100644 --- a/src/video/null_v.cpp +++ b/src/video/null_v.cpp @@ -51,14 +51,12 @@ void VideoDriver_Null::MainLoop() if (this->until_exit) { while (!_exit_game) { ::GameLoop(); - ::GameLoopPaletteAnimations(); ::InputLoop(); ::UpdateWindows(); } } else { for (int i = 0; i < this->ticks; i++) { ::GameLoop(); - ::GameLoopPaletteAnimations(); ::InputLoop(); ::UpdateWindows(); } diff --git a/src/video/video_driver.cpp b/src/video/video_driver.cpp index 243c999ca2..d3ac95e6ab 100644 --- a/src/video/video_driver.cpp +++ b/src/video/video_driver.cpp @@ -34,10 +34,6 @@ void VideoDriver::GameLoop() std::lock_guard lock(this->game_state_mutex); ::GameLoop(); - - // TODO: lock - ::GameLoopPaletteAnimations(); - // TODO: unlock } }