mirror of https://github.com/FWGS/xash3d-fwgs
engine: check XASH3D_GAME if -game argument wasn't found, do not override default base directory
Clarify that `--gamedir` configure option and `XASH_GAMEDIR` macro specify base directory
This commit is contained in:
parent
64726f13e1
commit
6d98d2c7c3
|
@ -221,7 +221,13 @@ void FS_Init( const char *basedir )
|
|||
COM_StripDirectorySlash( rodir );
|
||||
|
||||
if( !Sys_GetParmFromCmdLine( "-game", gamedir ))
|
||||
Q_strncpy( gamedir, basedir, sizeof( gamedir )); // gamedir == basedir
|
||||
{
|
||||
char *env = getenv( "XASH3D_GAME" );
|
||||
if( env )
|
||||
Q_strncpy( gamedir, env, sizeof( gamedir ));
|
||||
else
|
||||
Q_strncpy( gamedir, basedir, sizeof( gamedir )); // gamedir == basedir
|
||||
}
|
||||
|
||||
FS_LoadProgs();
|
||||
|
||||
|
|
|
@ -23,9 +23,8 @@ GNU General Public License for more details.
|
|||
#include "build.h"
|
||||
#include "common.h"
|
||||
|
||||
#define E_GAME "XASH3D_GAME" // default env dir to start from
|
||||
#ifndef XASH_GAMEDIR
|
||||
#define XASH_GAMEDIR "valve"
|
||||
#define XASH_GAMEDIR "valve" // !!! Replace with your default (base) game directory !!!
|
||||
#endif
|
||||
|
||||
#if XASH_WIN32
|
||||
|
@ -47,12 +46,7 @@ static void Sys_ChangeGame( const char *progname )
|
|||
|
||||
static int Sys_Start( void )
|
||||
{
|
||||
const char *game = getenv( E_GAME );
|
||||
|
||||
if( !game )
|
||||
game = XASH_GAMEDIR;
|
||||
|
||||
Q_strncpy( szGameDir, game, sizeof( szGameDir ));
|
||||
Q_strncpy( szGameDir, XASH_GAMEDIR, sizeof( szGameDir ));
|
||||
|
||||
#if XASH_EMSCRIPTEN
|
||||
#ifdef EMSCRIPTEN_LIB_FS
|
||||
|
@ -73,7 +67,7 @@ static int Sys_Start( void )
|
|||
IOS_LaunchDialog();
|
||||
#endif
|
||||
|
||||
return Host_Main( szArgc, szArgv, game, 0, Sys_ChangeGame );
|
||||
return Host_Main( szArgc, szArgv, szGameDir, 0, Sys_ChangeGame );
|
||||
}
|
||||
|
||||
int main( int argc, char **argv )
|
||||
|
|
|
@ -44,9 +44,8 @@ __declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1;
|
|||
#error // port me!
|
||||
#endif
|
||||
|
||||
#define E_GAME "XASH3D_GAME" // default env dir to start from
|
||||
#ifndef XASH_GAMEDIR
|
||||
#define XASH_GAMEDIR "valve"
|
||||
#define XASH_GAMEDIR "valve" // !!! Replace with your default (base) game directory !!!
|
||||
#endif
|
||||
|
||||
typedef void (*pfnChangeGame)( const char *progname );
|
||||
|
@ -151,7 +150,6 @@ _inline int Sys_Start( void )
|
|||
{
|
||||
int ret;
|
||||
pfnChangeGame changeGame = NULL;
|
||||
const char *game = getenv( E_GAME );
|
||||
|
||||
#if XASH_SAILFISH
|
||||
const char *home = getenv( "HOME" );
|
||||
|
@ -166,10 +164,7 @@ _inline int Sys_Start( void )
|
|||
#endif // XASH_AURORAOS
|
||||
#endif // XASH_SAILFISH
|
||||
|
||||
if( !game )
|
||||
game = XASH_GAMEDIR;
|
||||
|
||||
strncpy( szGameDir, game, sizeof( szGameDir ) - 1 );
|
||||
strncpy( szGameDir, XASH_GAMEDIR, sizeof( szGameDir ) - 1 );
|
||||
|
||||
Sys_LoadEngine();
|
||||
|
||||
|
|
2
wscript
2
wscript
|
@ -116,7 +116,7 @@ def options(opt):
|
|||
help = 'build Xash Dedicated Server [default: %(default)s]')
|
||||
|
||||
grp.add_option('--gamedir', action = 'store', dest = 'GAMEDIR', default = 'valve',
|
||||
help = 'engine default game directory [default: %(default)s]')
|
||||
help = 'engine default (base) game directory [default: %(default)s]')
|
||||
|
||||
grp.add_option('-8', '--64bits', action = 'store_true', dest = 'ALLOW64', default = False,
|
||||
help = 'allow targetting 64-bit engine(Linux/Windows/OSX x86 only) [default: %(default)s]')
|
||||
|
|
Loading…
Reference in New Issue