summaryrefslogtreecommitdiff
path: root/src/newgrf_config.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2011-08-21 13:19:06 +0000
committerrubidium <rubidium@openttd.org>2011-08-21 13:19:06 +0000
commitc10d4157233109aab8794d2455481d45bd44b019 (patch)
tree8f0b0030c77e886e5ece27291cad5b74ec3a19b6 /src/newgrf_config.cpp
parent23e57203927e73d826aeae07332d27140651b098 (diff)
downloadopenttd-c10d4157233109aab8794d2455481d45bd44b019.tar.xz
(svn r22800) -Fix (r22796): don't run the scanning threaded when there is no reason to do so (no UI to update)
Diffstat (limited to 'src/newgrf_config.cpp')
-rw-r--r--src/newgrf_config.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/newgrf_config.cpp b/src/newgrf_config.cpp
index 0cce15f2e..c8385aca4 100644
--- a/src/newgrf_config.cpp
+++ b/src/newgrf_config.cpp
@@ -19,6 +19,8 @@
#include "window_func.h"
#include "progress.h"
#include "thread/thread.h"
+#include "blitter/factory.hpp"
+#include "network/network.h"
#include "fileio_func.h"
#include "fios.h"
@@ -694,9 +696,11 @@ void DoScanNewGRFFiles(void *callback)
*/
void ScanNewGRFFiles(NewGRFScanCallback *callback)
{
- if (!ThreadObject::New(&DoScanNewGRFFiles, callback, NULL)) {
+ if (BlitterFactoryBase::GetCurrentBlitter()->GetScreenDepth() == 0 || _network_dedicated || !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();
}
}