summaryrefslogtreecommitdiff
path: root/src/newgrf_config.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-06-17 15:48:57 +0000
committerrubidium <rubidium@openttd.org>2007-06-17 15:48:57 +0000
commit347c28b71ac754aee20f8eeeae1df1a3b9a49d10 (patch)
tree8bc2a050b44170ed785af66e6e9045d429c789db /src/newgrf_config.cpp
parent5fdde681c2aff0976eef8cea59422332527b3a65 (diff)
downloadopenttd-347c28b71ac754aee20f8eeeae1df1a3b9a49d10.tar.xz
(svn r10182) -Codechange: rewrite most part of the file loading/searching to be more flexible.
-Codechange: add support for personal directories on Windows. -Fix [FS#153, FS#193, FS#502, FS#816, FS#854]: fix issues related to fixed names, fixed places of files/directories and application bundles.
Diffstat (limited to 'src/newgrf_config.cpp')
-rw-r--r--src/newgrf_config.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/newgrf_config.cpp b/src/newgrf_config.cpp
index 6d6709c6b..74ec3b837 100644
--- a/src/newgrf_config.cpp
+++ b/src/newgrf_config.cpp
@@ -363,14 +363,16 @@ static uint ScanPath(const char *path, int basepath_length)
/* Scan for all NewGRFs */
void ScanNewGRFFiles()
{
- uint num;
+ Searchpath sp;
+ char path[MAX_PATH];
+ uint num = 0;
ClearGRFConfigList(&_all_grfs);
DEBUG(grf, 1, "Scanning for NewGRFs");
- num = ScanPath(_paths.data_dir, strlen(_paths.data_dir));
- if (_paths.second_data_dir != NULL) {
- num += ScanPath(_paths.second_data_dir, strlen(_paths.second_data_dir));
+ FOR_ALL_SEARCHPATHS(sp) {
+ FioAppendDirectory(path, MAX_PATH, sp, DATA_DIR);
+ num += ScanPath(path, strlen(path));
}
DEBUG(grf, 1, "Scan complete, found %d files", num);
}