|
@@ -274,24 +274,25 @@ static const char * const _subdirs[] = {
|
|
|
"save" PATHSEP "autosave" PATHSEP,
|
|
|
"scenario" PATHSEP,
|
|
|
"scenario" PATHSEP "heightmap" PATHSEP,
|
|
|
"gm" PATHSEP,
|
|
|
"data" PATHSEP,
|
|
|
"baseset" PATHSEP,
|
|
|
"newgrf" PATHSEP,
|
|
|
"lang" PATHSEP,
|
|
|
"ai" PATHSEP,
|
|
|
"ai" PATHSEP "library" PATHSEP,
|
|
|
"game" PATHSEP,
|
|
|
"game" PATHSEP "library" PATHSEP,
|
|
|
"screenshot" PATHSEP,
|
|
|
};
|
|
|
assert_compile(lengthof(_subdirs) == NUM_SUBDIRS);
|
|
|
|
|
|
const char *_searchpaths[NUM_SEARCHPATHS];
|
|
|
TarList _tar_list[NUM_SUBDIRS];
|
|
|
TarFileList _tar_filelist[NUM_SUBDIRS];
|
|
|
|
|
|
typedef std::map<std::string, std::string> TarLinkList;
|
|
|
static TarLinkList _tar_linklist[NUM_SUBDIRS]; ///< List of directory links
|
|
|
|
|
|
/**
|
|
|
* Check whether the given file exists
|
|
@@ -1193,25 +1194,25 @@ void DeterminePaths(const char *exe)
|
|
|
DEBUG(misc, 3, "%s found as personal directory", _personal_dir);
|
|
|
|
|
|
_highscore_file = str_fmt("%shs.dat", _personal_dir);
|
|
|
extern char *_hotkeys_file;
|
|
|
_hotkeys_file = str_fmt("%shotkeys.cfg", _personal_dir);
|
|
|
|
|
|
/* Make the necessary folders */
|
|
|
#if !defined(__MORPHOS__) && !defined(__AMIGA__) && defined(WITH_PERSONAL_DIR)
|
|
|
FioCreateDirectory(_personal_dir);
|
|
|
#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, GAME_LIBRARY_DIR
|
|
|
SAVE_DIR, AUTOSAVE_DIR, SCENARIO_DIR, HEIGHTMAP_DIR, BASESET_DIR, NEWGRF_DIR, AI_DIR, AI_LIBRARY_DIR, GAME_DIR, GAME_LIBRARY_DIR, SCREENSHOT_DIR
|
|
|
};
|
|
|
|
|
|
for (uint i = 0; i < lengthof(default_subdirs); i++) {
|
|
|
char *dir = str_fmt("%s%s", _personal_dir, _subdirs[default_subdirs[i]]);
|
|
|
FioCreateDirectory(dir);
|
|
|
free(dir);
|
|
|
}
|
|
|
|
|
|
/* If we have network we make a directory for the autodownloading of content */
|
|
|
_searchpaths[SP_AUTODOWNLOAD_DIR] = str_fmt("%s%s", _personal_dir, "content_download" PATHSEP);
|
|
|
#ifdef ENABLE_NETWORK
|
|
|
FioCreateDirectory(_searchpaths[SP_AUTODOWNLOAD_DIR]);
|