summaryrefslogtreecommitdiff
path: root/src/newgrf_config.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2011-08-24 12:18:53 +0000
committerrubidium <rubidium@openttd.org>2011-08-24 12:18:53 +0000
commit70179db81e5a7fff78b558de9f39521c44a16886 (patch)
treea5c98947d09effd5e5005211b82c18769e4845b3 /src/newgrf_config.cpp
parent38ad276acc6f108162c4255b837d4c450b91f23d (diff)
downloadopenttd-70179db81e5a7fff78b558de9f39521c44a16886.tar.xz
(svn r22820) -Codechange: perform a full (re)draw cycle in the first draw during progress instead of waiting 200ms
Diffstat (limited to 'src/newgrf_config.cpp')
-rw-r--r--src/newgrf_config.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/newgrf_config.cpp b/src/newgrf_config.cpp
index 69bcf6f7a..ad73f5b3d 100644
--- a/src/newgrf_config.cpp
+++ b/src/newgrf_config.cpp
@@ -629,14 +629,7 @@ static int CDECL GRFSorter(GRFConfig * const *p1, GRFConfig * const *p2)
*/
void DoScanNewGRFFiles(void *callback)
{
- /* First set the modal progress. This ensures that it will eventually let go of the paint mutex. */
- SetModalProgress(true);
- _modal_progress_paint_mutex->BeginCritical();
-
- /* Only then can we really start, especially by marking the whole screen dirty. Get those other windows hidden!. */
- MarkWholeScreenDirty();
_modal_progress_work_mutex->BeginCritical();
- _modal_progress_paint_mutex->EndCritical();
ClearGRFConfigList(&_all_grfs);
@@ -694,12 +687,19 @@ void DoScanNewGRFFiles(void *callback)
*/
void ScanNewGRFFiles(NewGRFScanCallback *callback)
{
+ /* First set the modal progress. This ensures that it will eventually let go of the paint mutex. */
+ SetModalProgress(true);
+ /* Only then can we really start, especially by marking the whole screen dirty. Get those other windows hidden!. */
+ MarkWholeScreenDirty();
+
if (!_video_driver->HasGUI() || !ThreadObject::New(&DoScanNewGRFFiles, callback, NULL)) {
_modal_progress_work_mutex->EndCritical();
_modal_progress_paint_mutex->EndCritical();
DoScanNewGRFFiles(callback);
_modal_progress_paint_mutex->BeginCritical();
_modal_progress_work_mutex->BeginCritical();
+ } else {
+ UpdateNewGRFScanStatus(0, NULL);
}
}