From f2ba0cbb0ae1c32d37c9eeacb7e91d195b6f6df4 Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Sun, 1 May 2011 18:49:33 +0200 Subject: [PATCH] support passing the home path to q3map2 as -fs_home (home dir only, ends with /. to request a dotdir name) and -fs_homepath (full path, including /.gamename) --- radiant/map.cpp | 2 ++ radiant/qe3.cpp | 1 + tools/quake3/q3map2/path_init.c | 15 +++++++++++---- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/radiant/map.cpp b/radiant/map.cpp index 57245990..ec412965 100644 --- a/radiant/map.cpp +++ b/radiant/map.cpp @@ -1690,6 +1690,8 @@ tryDecompile: output.push_string((type && *type) ? type : "quake3"); output.push_string(" -fs_basepath \""); output.push_string(EnginePath_get()); + output.push_string(" -fs_homepath \""); + output.push_string(g_qeglobals.m_userEnginePath.c_str()); output.push_string("\" -fs_game "); output.push_string(gamename_get()); output.push_string(" -convert -format "); diff --git a/radiant/qe3.cpp b/radiant/qe3.cpp index 1b3d060e..19d1d37c 100644 --- a/radiant/qe3.cpp +++ b/radiant/qe3.cpp @@ -171,6 +171,7 @@ void bsp_init() build_set_variable("RadiantPath", AppPath_get()); build_set_variable("ExecutableType", RADIANT_EXECUTABLE); build_set_variable("EnginePath", EnginePath_get()); + build_set_variable("UserEnginePath", g_qeglobals.m_userEnginePath.c_str()); build_set_variable("MonitorAddress", (g_WatchBSP_Enabled) ? "127.0.0.1:39000" : ""); build_set_variable("GameName", gamename_get()); diff --git a/tools/quake3/q3map2/path_init.c b/tools/quake3/q3map2/path_init.c index 40afaf8d..e3250aee 100644 --- a/tools/quake3/q3map2/path_init.c +++ b/tools/quake3/q3map2/path_init.c @@ -450,10 +450,6 @@ void InitPaths( int *argc, char **argv ) Error( "Out of arguments: No path specified after %s.", argv[ i - 1 ] ); argv[ i - 1 ] = NULL; homePath = argv[i]; - /* do we want to do this: - if(!homeBasePath) - homeBasePath = "."; // if only -fs_home is set, this shall be the FULL path! - */ argv[ i ] = NULL; } @@ -466,6 +462,17 @@ void InitPaths( int *argc, char **argv ) homeBasePath = argv[i]; argv[ i ] = NULL; } + + /* -fs_homepath - sets both of them */ + else if( strcmp( argv[ i ], "-fs_homepath" ) == 0 ) + { + if( ++i >= *argc ) + Error( "Out of arguments: No path specified after %s.", argv[ i - 1 ] ); + argv[ i - 1 ] = NULL; + homePath = argv[i]; + homeBasePath = "."; + argv[ i ] = NULL; + } } /* remove processed arguments */ -- 2.39.2