Changeset View
Changeset View
Standalone View
Standalone View
source/ps/GameSetup/GameSetup.cpp
Show First 20 Lines • Show All 179 Lines • ▼ Show 20 Lines | static void InitVfs(const CmdLineArgs& args, int flags) | ||||
const OsPath readonlyConfig = paths.RData()/"config"/""; | const OsPath readonlyConfig = paths.RData()/"config"/""; | ||||
// Mount these dirs with highest priority so that mods can't overwrite them. | // Mount these dirs with highest priority so that mods can't overwrite them. | ||||
g_VFS->Mount(L"cache/", paths.Cache(), VFS_MOUNT_ARCHIVABLE, VFS_MAX_PRIORITY); // (adding XMBs to archive speeds up subsequent reads) | g_VFS->Mount(L"cache/", paths.Cache(), VFS_MOUNT_ARCHIVABLE, VFS_MAX_PRIORITY); // (adding XMBs to archive speeds up subsequent reads) | ||||
if (readonlyConfig != paths.Config()) | if (readonlyConfig != paths.Config()) | ||||
g_VFS->Mount(L"config/", readonlyConfig, 0, VFS_MAX_PRIORITY-1); | g_VFS->Mount(L"config/", readonlyConfig, 0, VFS_MAX_PRIORITY-1); | ||||
g_VFS->Mount(L"config/", paths.Config(), 0, VFS_MAX_PRIORITY); | g_VFS->Mount(L"config/", paths.Config(), 0, VFS_MAX_PRIORITY); | ||||
g_VFS->Mount(L"screenshots/", paths.UserData()/"screenshots"/"", 0, VFS_MAX_PRIORITY); | |||||
g_VFS->Mount(L"saves/", paths.UserData()/"saves"/"", VFS_MOUNT_WATCH, VFS_MAX_PRIORITY); | g_VFS->Mount(L"saves/", paths.UserData()/"saves"/"", VFS_MOUNT_WATCH, VFS_MAX_PRIORITY); | ||||
// Engine localization files (regular priority, these can be overwritten). | // Engine localization files (regular priority, these can be overwritten). | ||||
g_VFS->Mount(L"l10n/", paths.RData()/"l10n"/""); | g_VFS->Mount(L"l10n/", paths.RData()/"l10n"/""); | ||||
// Mods will be mounted later. | // Mods will be mounted later. | ||||
// note: don't bother with g_VFS->TextRepresentation - directories | // note: don't bother with g_VFS->TextRepresentation - directories | ||||
▲ Show 20 Lines • Show All 345 Lines • ▼ Show 20 Lines | bool Init(const CmdLineArgs& args, int flags) | ||||
// Set up the console early, so that debugging | // Set up the console early, so that debugging | ||||
// messages can be logged to it. (The console's size | // messages can be logged to it. (The console's size | ||||
// and fonts are set later in InitPs()) | // and fonts are set later in InitPs()) | ||||
g_Console = new CConsole(); | g_Console = new CConsole(); | ||||
// g_ConfigDB, command line args, globals | // g_ConfigDB, command line args, globals | ||||
CONFIG_Init(args); | CONFIG_Init(args); | ||||
// Mount this after the config was initialized | |||||
CStr screenshotpath; | |||||
CFG_GET_VAL("videorendering.path", screenshotpath); | |||||
if (g_VFS->Mount(L"screenshots/", OsPath(screenshotpath), VFS_MOUNT_MUST_EXIST, VFS_MAX_PRIORITY) == ERR::VFS_DIR_NOT_FOUND) | |||||
Stan: Fun fact the path depends on where you start the executable and if it doesn't find it it writes… | |||||
LOGERROR("Screenshot directory does not exist! Check the options and restart."); | |||||
// Using a global object for the context is a workaround until Simulation and AI use | // Using a global object for the context is a workaround until Simulation and AI use | ||||
// their own threads and also their own contexts. | // their own threads and also their own contexts. | ||||
const int contextSize = 384 * 1024 * 1024; | const int contextSize = 384 * 1024 * 1024; | ||||
const int heapGrowthBytesGCTrigger = 20 * 1024 * 1024; | const int heapGrowthBytesGCTrigger = 20 * 1024 * 1024; | ||||
g_ScriptContext = ScriptContext::CreateContext(contextSize, heapGrowthBytesGCTrigger); | g_ScriptContext = ScriptContext::CreateContext(contextSize, heapGrowthBytesGCTrigger); | ||||
// On the first Init (INIT_MODS), check for command-line arguments | // On the first Init (INIT_MODS), check for command-line arguments | ||||
// or use the default mods from the config and enable those. | // or use the default mods from the config and enable those. | ||||
▲ Show 20 Lines • Show All 720 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
Fun fact the path depends on where you start the executable and if it doesn't find it it writes it in the public mod :D