(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.
This commit is contained in:
rubidium
2007-06-17 15:48:57 +00:00
parent 4e4b152adb
commit 3c7a85fe94
25 changed files with 427 additions and 274 deletions

View File

@@ -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);
}