diff options
author | truebrain <truebrain@openttd.org> | 2011-12-19 20:54:37 +0000 |
---|---|---|
committer | truebrain <truebrain@openttd.org> | 2011-12-19 20:54:37 +0000 |
commit | b4f832f29f44dcd48e8f0806d47ce78b1963d639 (patch) | |
tree | c637dffb7be81c82611b7345785899768b7917ac /src/fileio.cpp | |
parent | 12aa5b6a583aa7ca9092ec6c77e7b12677cdd6a4 (diff) | |
download | openttd-b4f832f29f44dcd48e8f0806d47ce78b1963d639.tar.xz |
(svn r23605) -Add: GAME_DIR and CONTENT_TYPE_GAME, and read gamescript from that directory
Diffstat (limited to 'src/fileio.cpp')
-rw-r--r-- | src/fileio.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/fileio.cpp b/src/fileio.cpp index 82b2f7c7e..95f3a1594 100644 --- a/src/fileio.cpp +++ b/src/fileio.cpp @@ -281,6 +281,7 @@ static const char * const _subdirs[] = { "lang" PATHSEP, "ai" PATHSEP, "ai" PATHSEP "library" PATHSEP, + "game" PATHSEP, }; assert_compile(lengthof(_subdirs) == NUM_SUBDIRS); @@ -675,6 +676,9 @@ uint TarScanner::DoScan(Subdirectory sd) num += fs.DoScan(AI_DIR); num += fs.DoScan(AI_LIBRARY_DIR); } + if (mode & TarScanner::GAME) { + num += fs.DoScan(GAME_DIR); + } if (mode & TarScanner::SCENARIO) { num += fs.DoScan(SCENARIO_DIR); } @@ -1195,7 +1199,7 @@ void DeterminePaths(const char *exe) #endif static const Subdirectory default_subdirs[] = { - SAVE_DIR, AUTOSAVE_DIR, SCENARIO_DIR, HEIGHTMAP_DIR, BASESET_DIR, NEWGRF_DIR, AI_DIR, AI_LIBRARY_DIR + SAVE_DIR, AUTOSAVE_DIR, SCENARIO_DIR, HEIGHTMAP_DIR, BASESET_DIR, NEWGRF_DIR, AI_DIR, AI_LIBRARY_DIR, GAME_DIR }; for (uint i = 0; i < lengthof(default_subdirs); i++) { @@ -1210,7 +1214,7 @@ void DeterminePaths(const char *exe) FioCreateDirectory(_searchpaths[SP_AUTODOWNLOAD_DIR]); /* Create the directory for each of the types of content */ - const Subdirectory dirs[] = { SCENARIO_DIR, HEIGHTMAP_DIR, BASESET_DIR, NEWGRF_DIR, AI_DIR, AI_LIBRARY_DIR }; + const Subdirectory dirs[] = { SCENARIO_DIR, HEIGHTMAP_DIR, BASESET_DIR, NEWGRF_DIR, AI_DIR, AI_LIBRARY_DIR, GAME_DIR }; for (uint i = 0; i < lengthof(dirs); i++) { char *tmp = str_fmt("%s%s", _searchpaths[SP_AUTODOWNLOAD_DIR], _subdirs[dirs[i]]); FioCreateDirectory(tmp); |