}
};
+bool g_disableEnginePath = false;
+bool g_disableHomePath = false;
+
void Paths_constructPreferences( PreferencesPage& page ){
page.appendPathEntry( "Engine Path", true, make_property<EnginePath>(g_strEnginePath) );
+ page.appendCheckBox(
+ "", "Do not use Engine Path",
+ g_disableEnginePath
+ );
+
+ page.appendCheckBox(
+ "", "Do not use Home Path",
+ g_disableHomePath
+ );
+
for ( int i = 0; i < g_pakPathCount; i++ ) {
std::string label = "Pak Path " + std::to_string(i);
switch (i) {
GlobalPreferenceSystem().registerPreference( "EnginePath", make_property_string( g_strEnginePath ) );
+ GlobalPreferenceSystem().registerPreference( "DisableEnginePath", make_property_string( g_disableEnginePath ) );
+ GlobalPreferenceSystem().registerPreference( "DisableHomePath", make_property_string( g_disableHomePath ) );
+
for ( int i = 0; i < g_pakPathCount; i++ ) {
std::string label = "PakPath" + std::to_string(i);
GlobalPreferenceSystem().registerPreference( label.c_str(), make_property_string( g_strPakPath[i] ) );
const char* EnginePath_get();
const char* QERApp_GetGamePath();
+extern bool g_disableEnginePath;
+extern bool g_disableHomePath;
+
const int g_pakPathCount = 5;
extern CopiedString g_strPakPath[g_pakPathCount];
const char* PakPath_get( int num );
}
}
+ // extra switches
+ if ( g_disableEnginePath ) {
+ output.push_string( " -fs_nobasepath " );
+ }
+
+ if ( g_disableHomePath ) {
+ output.push_string( " -fs_nohomepath " );
+ }
+
output.push_string( " -fs_game " );
output.push_string( gamename_get() );
output.push_string( " -convert -format " );
// if we have a mod dir
if ( !string_equal( gamename, basegame ) ) {
// ~/.<gameprefix>/<fs_game>
- if ( userRoot ) {
+ if ( userRoot && !g_disableHomePath ) {
StringOutputStream userGamePath( 256 );
userGamePath << userRoot << gamename << '/';
GlobalFileSystem().initDirectory( userGamePath.c_str() );
}
// <fs_basepath>/<fs_game>
- {
+ if ( !g_disableEnginePath ) {
StringOutputStream globalGamePath( 256 );
globalGamePath << globalRoot << gamename << '/';
GlobalFileSystem().initDirectory( globalGamePath.c_str() );
}
// ~/.<gameprefix>/<fs_main>
- if ( userRoot ) {
+ if ( userRoot && !g_disableHomePath ) {
StringOutputStream userBasePath( 256 );
userBasePath << userRoot << basegame << '/';
GlobalFileSystem().initDirectory( userBasePath.c_str() );
}
// <fs_basepath>/<fs_main>
- {
+ if ( !g_disableEnginePath ) {
StringOutputStream globalBasePath( 256 );
globalBasePath << globalRoot << basegame << '/';
GlobalFileSystem().initDirectory( globalBasePath.c_str() );
ExtraQ3map2Args.push_string( "\"" );
}
}
+
+ // extra switches
+ if ( g_disableEnginePath ) {
+ ExtraQ3map2Args.push_string( " -fs_nobasepath " );
+ }
+
+ if ( g_disableHomePath ) {
+ ExtraQ3map2Args.push_string( " -fs_nohomepath " );
+ }
+
build_set_variable( "ExtraQ3map2Args", ExtraQ3map2Args.c_str() );
const char* mapname = Map_Name( g_map );
{"-fs_basepath <path>", "Sets the given path as main directory of the game (can be used more than once to look in multiple paths)"},
{"-fs_game <gamename>", "Sets a different game directory name (default for Q3A: baseq3, can be used more than once)"},
{"-fs_homebase <dir>", "Specifies where the user home directory name is on Linux (default for Q3A: .q3a)"},
- {"-fs_pakpath <dir>", "Specify a package directory (can be used more than once to look in multiple paths)"},
+ {"-fs_homepath <path>", "Sets the given path as home directory name"},
+ {"-fs_nobasepath", "Do not load base paths in VFS"},
+ {"-fs_nohomepath", "Do not load home path in VFS"},
+ {"-fs_pakpath <path>", "Specify a package directory (can be used more than once to look in multiple paths)"},
{"-game <gamename>", "Load settings for the given game (default: quake3)"},
{"-subdivisions <F>", "multiplier for patch subdivisions quality"},
{"-threads <N>", "number of threads to use"},
int i, j, k, len, len2;
char temp[ MAX_OS_PATH ];
+ int noBasePath = 0;
+ int noHomePath = 0;
/* note it */
Sys_FPrintf( SYS_VRB, "--- InitPaths ---\n" );
argv[ i ] = NULL;
}
+ /* -fs_nobasepath */
+ else if ( strcmp( argv[ i ], "-fs_nobasepath" ) == 0 ) {
+ noBasePath = 1;
+ argv[ i ] = NULL;
+ }
+
/* -fs_basepath */
else if ( strcmp( argv[ i ], "-fs_basepath" ) == 0 ) {
if ( ++i >= *argc ) {
argv[ i ] = NULL;
}
+ /* -fs_nohomepath */
+ else if ( strcmp( argv[ i ], "-fs_nohomepath" ) == 0 ) {
+ noHomePath = 1;
+ argv[ i ] = NULL;
+ }
+
/* -fs_homebase */
else if ( strcmp( argv[ i ], "-fs_homebase" ) == 0 ) {
if ( ++i >= *argc ) {
AddGamePath( game->gamePath );
/* if there is no base path set, figure it out */
- if ( numBasePaths == 0 ) {
+ if ( numBasePaths == 0 && noBasePath == 0 ) {
/* this is another crappy replacement for SetQdirFromPath() */
len2 = strlen( game->magic );
for ( i = 0; i < *argc && numBasePaths == 0; i++ )
}
}
- /* this only affects unix */
- if ( homeBasePath ) {
- AddHomeBasePath( homeBasePath );
+ if ( noBasePath == 1 ) {
+ numBasePaths = 0;
}
- else{
- AddHomeBasePath( game->homeBasePath );
+
+ if ( noHomePath == 0 ) {
+ /* this only affects unix */
+ if ( homeBasePath ) {
+ AddHomeBasePath( homeBasePath );
+ }
+ else{
+ AddHomeBasePath( game->homeBasePath );
+ }
}
/* initialize vfs paths */