summaryrefslogtreecommitdiff
path: root/src/gfx.cpp
diff options
context:
space:
mode:
authorPatric Stout <truebrain@openttd.org>2021-02-17 14:36:11 +0100
committerPatric Stout <github@truebrain.nl>2021-02-19 10:43:15 +0100
commitd437445c67bb76713614ae5a4242168c891b9978 (patch)
tree4c77c39fd1643f3936f763756286382c02e6ed86 /src/gfx.cpp
parent1f6fb8c2908ccd5de730a973d1276554a7abf4b6 (diff)
downloadopenttd-d437445c67bb76713614ae5a4242168c891b9978.tar.xz
Codechange: use std::chrono to track time in modal windows
Adding to _realtime_ticks in a random place is a bit of a hack, and by using modern C++, we can avoid this hack.
Diffstat (limited to 'src/gfx.cpp')
-rw-r--r--src/gfx.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/gfx.cpp b/src/gfx.cpp
index 786bbb25b..9f42a7b53 100644
--- a/src/gfx.cpp
+++ b/src/gfx.cpp
@@ -1470,9 +1470,8 @@ void DrawDirtyBlocks()
_modal_progress_paint_mutex.unlock();
_modal_progress_work_mutex.unlock();
- /* Wait a while and update _realtime_tick so we are given the rights */
+ /* Wait a while and hope the modal gives us a bit of time to draw the GUI. */
if (!IsFirstModalProgressLoop()) CSleep(MODAL_PROGRESS_REDRAW_TIMEOUT);
- _realtime_tick += MODAL_PROGRESS_REDRAW_TIMEOUT;
/* Modal progress thread may need blitter access while we are waiting for it. */
VideoDriver::GetInstance()->ReleaseBlitterLock();