From 347c28b71ac754aee20f8eeeae1df1a3b9a49d10 Mon Sep 17 00:00:00 2001 From: rubidium Date: Sun, 17 Jun 2007 15:48:57 +0000 Subject: (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. --- src/newgrf_config.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/newgrf_config.cpp') 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); } -- cgit v1.2.3-70-g09d2