summaryrefslogtreecommitdiff
path: root/src/fileio.cpp
diff options
context:
space:
mode:
authortruebrain <truebrain@openttd.org>2011-12-19 20:56:59 +0000
committertruebrain <truebrain@openttd.org>2011-12-19 20:56:59 +0000
commit963802e9a7cb67f51cb7e6ffe9d33a02cfe93821 (patch)
treed8b2d5c1c2d90c7cb1a02403cea942ab52c2e501 /src/fileio.cpp
parent83f2785f54de1c31267c5586464c97fb39f95b5a (diff)
downloadopenttd-963802e9a7cb67f51cb7e6ffe9d33a02cfe93821.tar.xz
(svn r23612) -Add: allow importing libraries in the same way as AI does, only with GS prefix (and in game/library)
Diffstat (limited to 'src/fileio.cpp')
-rw-r--r--src/fileio.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/fileio.cpp b/src/fileio.cpp
index 95f3a1594..34d896197 100644
--- a/src/fileio.cpp
+++ b/src/fileio.cpp
@@ -282,6 +282,7 @@ static const char * const _subdirs[] = {
"ai" PATHSEP,
"ai" PATHSEP "library" PATHSEP,
"game" PATHSEP,
+ "game" PATHSEP "library" PATHSEP,
};
assert_compile(lengthof(_subdirs) == NUM_SUBDIRS);
@@ -678,6 +679,7 @@ uint TarScanner::DoScan(Subdirectory sd)
}
if (mode & TarScanner::GAME) {
num += fs.DoScan(GAME_DIR);
+ num += fs.DoScan(GAME_LIBRARY_DIR);
}
if (mode & TarScanner::SCENARIO) {
num += fs.DoScan(SCENARIO_DIR);
@@ -1199,7 +1201,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, GAME_DIR
+ SAVE_DIR, AUTOSAVE_DIR, SCENARIO_DIR, HEIGHTMAP_DIR, BASESET_DIR, NEWGRF_DIR, AI_DIR, AI_LIBRARY_DIR, GAME_DIR, GAME_LIBRARY_DIR
};
for (uint i = 0; i < lengthof(default_subdirs); i++) {
@@ -1214,7 +1216,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, GAME_DIR };
+ const Subdirectory dirs[] = { SCENARIO_DIR, HEIGHTMAP_DIR, BASESET_DIR, NEWGRF_DIR, AI_DIR, AI_LIBRARY_DIR, GAME_DIR, GAME_LIBRARY_DIR };
for (uint i = 0; i < lengthof(dirs); i++) {
char *tmp = str_fmt("%s%s", _searchpaths[SP_AUTODOWNLOAD_DIR], _subdirs[dirs[i]]);
FioCreateDirectory(tmp);