X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fnetradiant.git;a=blobdiff_plain;f=radiant%2Fmainframe.cpp;h=8abd6e2a5e8a86286d209bf5232d50242edf27b6;hp=a91dccdd93f8245ba377fc7b9b5ba71436ac142e;hb=586f4c520c9e451697d91135833be6646f902f2b;hpb=24bca49fde9b8b930e6dff8fbc21c7ce78916c68 diff --git a/radiant/mainframe.cpp b/radiant/mainframe.cpp index a91dccdd..8abd6e2a 100644 --- a/radiant/mainframe.cpp +++ b/radiant/mainframe.cpp @@ -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(); } }; @@ -513,6 +524,7 @@ void gamemode_set( const char* gamemode ){ } } + #include "os/dir.h" class CLoadModule @@ -532,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" @@ -941,32 +955,12 @@ void thunk_OnSleep(){ g_pParentWnd->OnSleep(); } -void OpenUpdateURL(){ - // build the URL - StringOutputStream URL( 256 ); - URL << "http://www.icculus.org/netradiant/?cmd=update&data=dlupdate&query_dlup=1"; -#ifdef WIN32 - URL << "&OS_dlup=1"; -#elif defined( __APPLE__ ) - URL << "&OS_dlup=2"; -#else - URL << "&OS_dlup=3"; -#endif - URL << "&Version_dlup=" RADIANT_VERSION; - g_GamesDialog.AddPacksURL( URL ); - OpenURL( URL.c_str() ); -} - -// open the Q3Rad manual void OpenHelpURL(){ - // at least on win32, AppPath + "docs/index.html" - StringOutputStream help( 256 ); - help << AppPath_get() << "docs/index.html"; - OpenURL( help.c_str() ); + OpenURL( "https://gitlab.com/xonotic/xonotic/wikis/Mapping" ); } void OpenBugReportURL(){ - OpenURL( "http://www.icculus.org/netradiant/?cmd=bugs" ); + OpenURL( "https://gitlab.com/xonotic/netradiant/issues" ); } @@ -1833,7 +1827,6 @@ GtkMenuItem* create_file_menu(){ menu_separator( menu ); MRU_constructMenu( menu ); menu_separator( menu ); - create_menu_item_with_mnemonic( menu, "Check for NetRadiant update (web)", "CheckForUpdate" ); // FIXME create_menu_item_with_mnemonic( menu, "E_xit", "Exit" ); return file_menu_item; @@ -3193,7 +3186,6 @@ void MainFrame_Construct(){ GlobalCommands_insert( "SaveRegion", FreeCaller() ); GlobalCommands_insert( "RefreshReferences", FreeCaller() ); GlobalCommands_insert( "ProjectSettings", FreeCaller() ); - GlobalCommands_insert( "CheckForUpdate", FreeCaller() ); GlobalCommands_insert( "Exit", FreeCaller() ); GlobalCommands_insert( "Undo", FreeCaller(), Accelerator( 'Z', (GdkModifierType)GDK_CONTROL_MASK ) );