diff --git a/radiant/main.cpp b/radiant/main.cpp index b69ec2b9..8d60d5ce 100644 --- a/radiant/main.cpp +++ b/radiant/main.cpp @@ -673,12 +673,6 @@ int main( int argc, char* argv[] ){ gtk_main(); - // avoid saving prefs when the app is minimized - if ( g_pParentWnd->IsSleeping() ) { - globalOutputStream() << "Shutdown while sleeping, not saving prefs\n"; - g_preferences_globals.disable_ini = true; - } - Map_Free(); if ( !Map_Unnamed( g_map ) ) { diff --git a/radiant/mainframe.cpp b/radiant/mainframe.cpp index f07e7148..be0879e3 100644 --- a/radiant/mainframe.cpp +++ b/radiant/mainframe.cpp @@ -1007,10 +1007,6 @@ void Restart(){ } -void thunk_OnSleep(){ - g_pParentWnd->OnSleep(); -} - void OpenUpdateURL(){ // build the URL StringOutputStream URL( 256 ); @@ -1918,13 +1914,6 @@ GtkMenuItem* create_file_menu(){ create_menu_item_with_mnemonic( menu, "_New Map", "NewMap" ); menu_separator( menu ); -#if 0 - //++timo temporary experimental stuff for sleep mode.. - create_menu_item_with_mnemonic( menu, "_Sleep", "Sleep" ); - menu_separator( menu ); - // end experimental -#endif - create_menu_item_with_mnemonic( menu, "_Open...", "OpenMap" ); create_menu_item_with_mnemonic( menu, "_Import...", "ImportMap" ); menu_separator( menu ); @@ -2679,8 +2668,6 @@ MainFrame::MainFrame() : m_window( 0 ), m_idleRedrawStatusText( RedrawStatusText m_pStatusLabel[n] = 0; } - m_bSleeping = false; - Create(); } @@ -2712,109 +2699,6 @@ void MainFrame::SetActiveXY( XYWnd* p ){ } -void MainFrame::ReleaseContexts(){ -#if 0 - if ( m_pXYWnd ) { - m_pXYWnd->DestroyContext(); - } - if ( m_pYZWnd ) { - m_pYZWnd->DestroyContext(); - } - if ( m_pXZWnd ) { - m_pXZWnd->DestroyContext(); - } - if ( m_pCamWnd ) { - m_pCamWnd->DestroyContext(); - } - if ( m_pTexWnd ) { - m_pTexWnd->DestroyContext(); - } - if ( m_pZWnd ) { - m_pZWnd->DestroyContext(); - } -#endif -} - -void MainFrame::CreateContexts(){ -#if 0 - if ( m_pCamWnd ) { - m_pCamWnd->CreateContext(); - } - if ( m_pXYWnd ) { - m_pXYWnd->CreateContext(); - } - if ( m_pYZWnd ) { - m_pYZWnd->CreateContext(); - } - if ( m_pXZWnd ) { - m_pXZWnd->CreateContext(); - } - if ( m_pTexWnd ) { - m_pTexWnd->CreateContext(); - } - if ( m_pZWnd ) { - m_pZWnd->CreateContext(); - } -#endif -} - -#ifdef _DEBUG -//#define DBG_SLEEP -#endif - -void MainFrame::OnSleep(){ -#if 0 - m_bSleeping ^= 1; - if ( m_bSleeping ) { - // useful when trying to debug crashes in the sleep code - globalOutputStream() << "Going into sleep mode..\n"; - - globalOutputStream() << "Dispatching sleep msg..."; - DispatchRadiantMsg( RADIANT_SLEEP ); - globalOutputStream() << "Done.\n"; - - gtk_window_iconify( m_window ); - GlobalSelectionSystem().setSelectedAll( false ); - - GlobalShaderCache().unrealise(); - Shaders_Free(); - GlobalOpenGL_debugAssertNoErrors(); - ScreenUpdates_Disable(); - - // release contexts - globalOutputStream() << "Releasing contexts..."; - ReleaseContexts(); - globalOutputStream() << "Done.\n"; - } - else - { - globalOutputStream() << "Waking up\n"; - - gtk_window_deiconify( m_window ); - - // create contexts - globalOutputStream() << "Creating contexts..."; - CreateContexts(); - globalOutputStream() << "Done.\n"; - - globalOutputStream() << "Making current on camera..."; - m_pCamWnd->MakeCurrent(); - globalOutputStream() << "Done.\n"; - - globalOutputStream() << "Reloading shaders..."; - Shaders_Load(); - GlobalShaderCache().realise(); - globalOutputStream() << "Done.\n"; - - ScreenUpdates_Enable(); - - globalOutputStream() << "Dispatching wake msg..."; - DispatchRadiantMsg( RADIANT_WAKEUP ); - globalOutputStream() << "Done\n"; - } -#endif -} - void MainFrame_toggleFullscreen(){ GtkWindow* wnd = MainFrame_getWindow(); @@ -3543,7 +3427,6 @@ void FocusAllViews(){ void MainFrame_Construct(){ GlobalCommands_insert( "OpenManual", FreeCaller(), Accelerator( GDK_F1 ) ); - GlobalCommands_insert( "Sleep", FreeCaller(), Accelerator( 'P', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) ); GlobalCommands_insert( "NewMap", FreeCaller() ); GlobalCommands_insert( "OpenMap", FreeCaller(), Accelerator( 'O', (GdkModifierType)GDK_CONTROL_MASK ) ); GlobalCommands_insert( "ImportMap", FreeCaller() ); diff --git a/radiant/mainframe.h b/radiant/mainframe.h index 93c9ef59..c9066894 100644 --- a/radiant/mainframe.h +++ b/radiant/mainframe.h @@ -87,8 +87,6 @@ CamWnd* m_pCamWnd; ZWnd* m_pZWnd; XYWnd* m_pActiveXY; -bool m_bSleeping; - GtkWidget *m_pStatusLabel[c_count_status]; @@ -99,11 +97,6 @@ IdleDraw m_idleRedrawStatusText; public: -bool IsSleeping(){ - return m_bSleeping; -} -void OnSleep(); - void SetStatusText( CopiedString& status_text, const char* pText ); void UpdateStatusText(); void RedrawStatusText(); @@ -132,9 +125,6 @@ CamWnd* GetCamWnd(){ return m_pCamWnd; } -void ReleaseContexts(); -void CreateContexts(); - EViewStyle CurrentStyle(){ return m_nCurrentStyle; }; diff --git a/radiant/watchbsp.cpp b/radiant/watchbsp.cpp index 4edc7f34..5039963c 100644 --- a/radiant/watchbsp.cpp +++ b/radiant/watchbsp.cpp @@ -168,8 +168,6 @@ bool g_WatchBSP_Enabled = true; // do we stop the compilation process if we come accross a leak? bool g_WatchBSP_LeakStop = true; bool g_WatchBSP_RunQuake = false; -// store prefs setting for automatic sleep mode activation -bool g_WatchBSP_DoSleep = true; // timeout when beginning a step (in seconds) // if we don't get a connection quick enough we assume something failed and go back to idling int g_WatchBSP_Timeout = 10; @@ -179,10 +177,8 @@ void Build_constructPreferences( PreferencesPage& page ){ GtkWidget* monitorbsp = page.appendCheckBox( "", "Enable Build Process Monitoring", g_WatchBSP_Enabled ); GtkWidget* leakstop = page.appendCheckBox( "", "Stop Compilation on Leak", g_WatchBSP_LeakStop ); GtkWidget* runengine = page.appendCheckBox( "", "Run Engine After Compile", g_WatchBSP_RunQuake ); - GtkWidget* sleep = page.appendCheckBox ( "", "Sleep When Running the Engine", g_WatchBSP_DoSleep ); Widget_connectToggleDependency( leakstop, monitorbsp ); Widget_connectToggleDependency( runengine, monitorbsp ); - Widget_connectToggleDependency( sleep, runengine ); } void Build_constructPage( PreferenceGroup& group ){ PreferencesPage page( group.createPage( "Build", "Build Preferences" ) ); @@ -203,7 +199,6 @@ void BuildMonitor_Construct(){ GlobalPreferenceSystem().registerPreference( "WatchBSP", BoolImportStringCaller( g_WatchBSP_Enabled ), BoolExportStringCaller( g_WatchBSP_Enabled ) ); GlobalPreferenceSystem().registerPreference( "RunQuake2Run", BoolImportStringCaller( g_WatchBSP_RunQuake ), BoolExportStringCaller( g_WatchBSP_RunQuake ) ); GlobalPreferenceSystem().registerPreference( "LeakStop", BoolImportStringCaller( g_WatchBSP_LeakStop ), BoolExportStringCaller( g_WatchBSP_LeakStop ) ); - GlobalPreferenceSystem().registerPreference( "SleepMode", BoolImportStringCaller( g_WatchBSP_DoSleep ), BoolExportStringCaller( g_WatchBSP_DoSleep ) ); Build_registerPreferencesPage(); } @@ -706,13 +701,6 @@ void CWatchBSP::RoutineProcessing(){ { // launch the engine .. OMG if ( g_WatchBSP_RunQuake ) { -#if 0 - // do we enter sleep mode before? - if ( g_WatchBSP_DoSleep ) { - globalOutputStream() << "Going into sleep mode..\n"; - g_pParentWnd->OnSleep(); - } -#endif globalOutputStream() << "Running engine...\n"; StringOutputStream cmd( 256 ); // build the command line