Change: Only resort town directory window on population change if necessary
[openttd-github.git] / src / progress.h
blob59a61c678eede0982497104379bfc88d95d5ee5d
1 /*
2 * This file is part of OpenTTD.
3 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
4 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
5 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
6 */
8 /** @file progress.h Functions related to modal progress. */
10 #ifndef PROGRESS_H
11 #define PROGRESS_H
13 #include <mutex>
15 static const uint MODAL_PROGRESS_REDRAW_TIMEOUT = 200; ///< Timeout between redraws
17 /**
18 * Check if we are currently in a modal progress state.
19 * @return Are we in the modal state?
21 static inline bool HasModalProgress()
23 extern bool _in_modal_progress;
24 return _in_modal_progress;
27 /**
28 * Check if we can use a thread for modal progress.
29 * @return Threading usable?
31 static inline bool UseThreadedModelProgress()
33 extern bool _use_threaded_modal_progress;
34 return _use_threaded_modal_progress;
37 bool IsFirstModalProgressLoop();
38 void SetModalProgress(bool state);
40 extern std::mutex _modal_progress_work_mutex;
41 extern std::mutex _modal_progress_paint_mutex;
43 #endif /* PROGRESS_H */