]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - radiant/mainframe.cpp
unvanquished filesystem
[xonotic/netradiant.git] / radiant / mainframe.cpp
index e2739a1106eff243da8d8e90b2a7acb233091e8c..8989da307ea3585e3a549c8cd0ff688a2deb4565 100644 (file)
@@ -146,22 +146,33 @@ glwindow_globals_t g_glwindow_globals;
 
 
 // VFS
+
+bool g_vfsInitialized = false;
+
+void VFS_Init(){
+       if ( g_vfsInitialized ) return;
+       QE_InitVFS();
+       GlobalFileSystem().initialise();
+       g_vfsInitialized = true;
+}
+void VFS_Shutdown(){
+       if ( !g_vfsInitialized ) return;
+       GlobalFileSystem().shutdown();
+       g_vfsInitialized = false;
+}
+void VFS_Restart(){
+       VFS_Shutdown();
+       VFS_Init();
+}
+
 class VFSModuleObserver : public ModuleObserver
 {
-std::size_t m_unrealised;
 public:
-VFSModuleObserver() : m_unrealised( 1 ){
-}
 void realise(){
-       if ( --m_unrealised == 0 ) {
-               QE_InitVFS();
-               GlobalFileSystem().initialise();
-       }
+       VFS_Init();
 }
 void unrealise(){
-       if ( ++m_unrealised == 1 ) {
-               GlobalFileSystem().shutdown();
-       }
+       VFS_Shutdown();
 }
 };
 
@@ -200,6 +211,8 @@ void HomePaths_Realise(){
                                g_qeglobals.m_userEnginePath = path.c_str();
                                break;
                        }
+                       path.clear();
+                       path << DirectoryCleaned( g_get_home_dir() ) << prefix << "/";
 #endif
 
 #if defined( WIN32 )
@@ -511,6 +524,7 @@ void gamemode_set( const char* gamemode ){
        }
 }
 
+
 #include "os/dir.h"
 
 class CLoadModule
@@ -530,7 +544,9 @@ void operator()( const char* name ) const {
 };
 
 const char* const c_library_extension =
-#if defined( WIN32 )
+#if defined( CMAKE_SHARED_MODULE_SUFFIX )
+    CMAKE_SHARED_MODULE_SUFFIX
+#elif defined( WIN32 )
        "dll"
 #elif defined ( __APPLE__ )
        "dylib"
@@ -2205,10 +2221,10 @@ void PatchInspector_registerShortcuts(){
 void Patch_registerShortcuts(){
        command_connect_accelerator( "InvertCurveTextureX" );
        command_connect_accelerator( "InvertCurveTextureY" );
-       command_connect_accelerator( "IncPatchColumn" );
-       command_connect_accelerator( "IncPatchRow" );
-       command_connect_accelerator( "DecPatchColumn" );
-       command_connect_accelerator( "DecPatchRow" );
+       command_connect_accelerator( "PatchInsertInsertColumn" );
+       command_connect_accelerator( "PatchInsertInsertRow" );
+       command_connect_accelerator( "PatchDeleteLastColumn" );
+       command_connect_accelerator( "PatchDeleteLastRow" );
        command_connect_accelerator( "NaturalizePatch" );
        //command_connect_accelerator("CapCurrentCurve");
 }
@@ -3324,10 +3340,10 @@ void MainFrame_Construct(){
                const char* ENGINEPATH_ATTRIBUTE =
 #if defined( WIN32 )
                        "enginepath_win32"
-#elif defined( __linux__ ) || defined ( __FreeBSD__ )
-                       "enginepath_linux"
 #elif defined( __APPLE__ )
                        "enginepath_macos"
+#elif defined( __linux__ ) || defined ( __FreeBSD__ )
+                       "enginepath_linux"
 #else
 #error "unknown platform"
 #endif