diff options
author | rubidium <rubidium@openttd.org> | 2011-11-14 21:30:37 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2011-11-14 21:30:37 +0000 |
commit | 6d991b3b10bad798f7e2afce1bc806dbdc3ced4b (patch) | |
tree | 49c462606a07d3243d66abb82b7467204753b705 /src/fileio.cpp | |
parent | 160294ff22a2b30fc75be1977117eac6910bdd82 (diff) | |
download | openttd-6d991b3b10bad798f7e2afce1bc806dbdc3ced4b.tar.xz |
(svn r23217) -Codechange: introduce the concept of scanning only in a limited set of sub directories
Diffstat (limited to 'src/fileio.cpp')
-rw-r--r-- | src/fileio.cpp | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/fileio.cpp b/src/fileio.cpp index c12ede866..2722b651d 100644 --- a/src/fileio.cpp +++ b/src/fileio.cpp @@ -645,14 +645,21 @@ uint TarScanner::DoScan(Subdirectory sd) return this->Scan(".tar", sd, false); } -/* static */ uint TarScanner::DoScan() +/* static */ uint TarScanner::DoScan(TarScanner::Mode mode) { DEBUG(misc, 1, "Scanning for tars"); TarScanner fs; - uint num = fs.DoScan(NEWGRF_DIR); - num += fs.DoScan(AI_DIR); - num += fs.DoScan(AI_LIBRARY_DIR); - num += fs.DoScan(SCENARIO_DIR); + uint num = 0; + if (mode & (TarScanner::BASESET | TarScanner::NEWGRF)) { + num += fs.DoScan(NEWGRF_DIR); + } + if (mode & TarScanner::AI) { + num += fs.DoScan(AI_DIR); + num += fs.DoScan(AI_LIBRARY_DIR); + } + if (mode & TarScanner::SCENARIO) { + num += fs.DoScan(SCENARIO_DIR); + } DEBUG(misc, 1, "Scan complete, found %d files", num); return num; } @@ -1190,8 +1197,6 @@ void DeterminePaths(const char *exe) _searchpaths[SP_AUTODOWNLOAD_DIR] = NULL; } #endif /* ENABLE_NETWORK */ - - TarScanner::DoScan(); } /** |