mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-04 06:00:15 +00:00
(svn r22800) -Fix (r22796): don't run the scanning threaded when there is no reason to do so (no UI to update)
This commit is contained in:
parent
cdb0d6cecc
commit
31777dcf1a
@ -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();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user