summaryrefslogtreecommitdiff
path: root/src/progress.h
diff options
context:
space:
mode:
authorPatric Stout <truebrain@openttd.org>2021-03-09 14:53:51 +0100
committerPatric Stout <github@truebrain.nl>2021-03-10 13:41:18 +0100
commit970fedd78cef3f5ef7a26fcaf4fd9db0f6abbe4b (patch)
treeb894a4b222a74f9d8e80832e36bd21d9a16f4f9e /src/progress.h
parent098d5b22395e123e4990b73a2ad7bf703adf068b (diff)
downloadopenttd-970fedd78cef3f5ef7a26fcaf4fd9db0f6abbe4b.tar.xz
Add: make modal windows update more smooth
Basically, modal windows had their own thread-locking for what drawing was possible. This is a bit nonsense now we have a game-thread. And it makes much more sense to do things like NewGRFScan and GenerateWorld in the game-thread, and not in a thread next to the game-thread. This commit changes that: it removes the threads for NewGRFScan and GenerateWorld, and just runs the code in the game-thread. On regular intervals it allows the draw-thread to do a tick, which gives a much smoother look and feel. It does slow down NewGRFScan and GenerateWorld ever so slightly as it spends more time on drawing. But the slowdown is not measureable on my machines (with 700+ NewGRFs / 4kx4k map and a Debug build). Running without a game-thread means NewGRFScan and GenerateWorld are now blocking.
Diffstat (limited to 'src/progress.h')
-rw-r--r--src/progress.h18
1 files changed, 0 insertions, 18 deletions
diff --git a/src/progress.h b/src/progress.h
index 59a61c678..765020635 100644
--- a/src/progress.h
+++ b/src/progress.h
@@ -10,10 +10,6 @@
#ifndef PROGRESS_H
#define PROGRESS_H
-#include <mutex>
-
-static const uint MODAL_PROGRESS_REDRAW_TIMEOUT = 200; ///< Timeout between redraws
-
/**
* Check if we are currently in a modal progress state.
* @return Are we in the modal state?
@@ -24,20 +20,6 @@ static inline bool HasModalProgress()
return _in_modal_progress;
}
-/**
- * Check if we can use a thread for modal progress.
- * @return Threading usable?
- */
-static inline bool UseThreadedModelProgress()
-{
- extern bool _use_threaded_modal_progress;
- return _use_threaded_modal_progress;
-}
-
-bool IsFirstModalProgressLoop();
void SetModalProgress(bool state);
-extern std::mutex _modal_progress_work_mutex;
-extern std::mutex _modal_progress_paint_mutex;
-
#endif /* PROGRESS_H */