]> git.xonotic.org Git - xonotic/netradiant.git/blobdiff - radiant/qe3.cpp
easy-builder: make possible to check for more than one submodule
[xonotic/netradiant.git] / radiant / qe3.cpp
index 5360a0ab28368b41b0661d2b303c2198a053c148..bc1b6ed8a63f2363cbfe9604ca4b9bb488fb139b 100644 (file)
@@ -32,6 +32,7 @@
 // Leonardo Zide (leo@lokigames.com)
 //
 
+#include "defaults.h"
 #include "qe3.h"
 #include "globaldefs.h"
 
@@ -83,17 +84,22 @@ void QE_InitVFS(){
        const char* userRoot = g_qeglobals.m_userEnginePath.c_str();
        const char* globalRoot = EnginePath_get();
 
+       // editor builtin VFS
+       StringOutputStream editorGamePath( 256 );
+       editorGamePath << GlobalRadiant().getDataPath() << DEFAULT_EDITORVFS_DIRNAME;
+       GlobalFileSystem().initDirectory( editorGamePath.c_str() );
+
        // 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() );
@@ -101,14 +107,14 @@ void QE_InitVFS(){
        }
 
        // ~/.<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() );
@@ -167,11 +173,18 @@ bool ConfirmModified( const char* title ){
 }
 
 void bsp_init(){
+       // this is expected to not be used since
+       // ".[ExecutableType]" is replaced by "[ExecutableExt]"
+       const char *exe_ext = GDEF_OS_EXE_EXT;
+       build_set_variable( "ExecutableType", exe_ext[0] == '\0' ? exe_ext : exe_ext + 1 );
+       
+       build_set_variable( "ExecutableExt", GDEF_OS_EXE_EXT );
        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() );
 
        StringBuffer ExtraQ3map2Args;
@@ -183,6 +196,16 @@ void bsp_init(){
                        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 );
@@ -204,6 +227,7 @@ public:
 ArrayCommandListener(){
        m_array = g_ptr_array_new();
 }
+
 ~ArrayCommandListener(){
        g_ptr_array_free( m_array, TRUE );
 }