{"-connect <address>", "Talk to a NetRadiant instance using a specific XML based protocol"},
{"-force", "Allow reading some broken/unsupported BSP files e.g. when decompiling, may also crash"},
{"-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)"},
+ {"-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)"},
{"-game <gamename>", "Load settings for the given game (default: quake3)"},
{"-subdivisions <F>", "multiplier for patch subdivisions quality"},
{"-threads <N>", "number of threads to use"},
/* path support */
#define MAX_BASE_PATHS 10
#define MAX_GAME_PATHS 10
+#define MAX_PAK_PATHS 200
char *homePath;
char installPath[ MAX_OS_PATH ];
char *basePaths[ MAX_BASE_PATHS ];
int numGamePaths;
char *gamePaths[ MAX_GAME_PATHS ];
+int numPakPaths;
+char *pakPaths[ MAX_PAK_PATHS ];
char *homeBasePath = NULL;
}
+/*
+ AddPakPath()
+ adds a pak path to the list
+ */
+
+void AddPakPath( char *path ){
+ /* dummy check */
+ if ( path == NULL || path[ 0 ] == '\0' || numPakPaths >= MAX_PAK_PATHS ) {
+ return;
+ }
+
+ /* add it to the list */
+ pakPaths[ numPakPaths ] = safe_malloc( strlen( path ) + 1 );
+ strcpy( pakPaths[ numPakPaths ], path );
+ CleanPath( pakPaths[ numPakPaths ] );
+ numPakPaths++;
+}
+
/*
homeBasePath = ".";
argv[ i ] = NULL;
}
+
+ /* -fs_pakpath */
+ else if ( strcmp( argv[ i ], "-fs_pakpath" ) == 0 ) {
+ if ( ++i >= *argc ) {
+ Error( "Out of arguments: No path specified after %s.", argv[ i - 1 ] );
+ }
+ argv[ i - 1 ] = NULL;
+ AddPakPath( argv[ i ] );
+ argv[ i ] = NULL;
+ }
+
}
/* remove processed arguments */
}
}
+ /* initialize vfs paths */
+ if ( numPakPaths > MAX_PAK_PATHS ) {
+ numPakPaths = MAX_PAK_PATHS;
+ }
+
+ /* walk the list of pak paths */
+ for ( i = 0; i < numPakPaths; i++ )
+ {
+ /* initialize this pak path */
+ vfsInitDirectory( pakPaths[ i ] );
+ }
+
/* done */
Sys_Printf( "\n" );
}