(svn r23605) -Add: GAME_DIR and CONTENT_TYPE_GAME, and read gamescript from that directory

This commit is contained in:
truebrain
2011-12-19 20:54:37 +00:00
parent 12aa5b6a58
commit b4f832f29f
7 changed files with 19 additions and 4 deletions

View File

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