diff options
author | rubidium <rubidium@openttd.org> | 2011-08-21 12:53:13 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2011-08-21 12:53:13 +0000 |
commit | dc5f44883be808208befd54d05fceac38f9a6ac7 (patch) | |
tree | 3d08e441254e6f9e2039bb151cdef5e1e4e528d8 /src/newgrf_config.cpp | |
parent | 2987bcc79be454569ff9b22eaa4731736650e19e (diff) | |
download | openttd-dc5f44883be808208befd54d05fceac38f9a6ac7.tar.xz |
(svn r22797) -Add: progress bar for scanning NewGRFs
Diffstat (limited to 'src/newgrf_config.cpp')
-rw-r--r-- | src/newgrf_config.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/newgrf_config.cpp b/src/newgrf_config.cpp index fae656be5..0cce15f2e 100644 --- a/src/newgrf_config.cpp +++ b/src/newgrf_config.cpp @@ -543,7 +543,11 @@ public: static uint DoScan() { GRFFileScanner fs; - return fs.Scan(".grf", DATA_DIR); + int ret = fs.Scan(".grf", DATA_DIR); + /* The number scanned and the number returned may not be the same; + * duplicate NewGRFs and base sets are ignored in the return value. */ + _settings_client.gui.last_newgrf_count = fs.num_scanned; + return ret; } }; @@ -588,7 +592,7 @@ bool GRFFileScanner::AddFile(const char *filename, size_t basepath_length) const char *name = NULL; if (c->name != NULL) name = GetGRFStringFromGRFText(c->name->text); if (name == NULL) name = c->filename; - DEBUG(grf, 0, "Scanning %i: %s", this->num_scanned, name); + UpdateNewGRFScanStatus(this->num_scanned, name); _modal_progress_work_mutex->BeginCritical(); _modal_progress_paint_mutex->EndCritical(); |