]> git.mxchange.org Git - flightgear.git/blobdiff - src/GUI/gui_funcs.cxx
Moved random ground cover object management code (userdata.[ch]xx) over
[flightgear.git] / src / GUI / gui_funcs.cxx
index 6f64d99d619842b7dfaefab54621d1658ee2e9c9..8c17c1ebf640c5f1eac71a1dcf4fab0c3092992c 100644 (file)
@@ -100,7 +100,6 @@ SG_USING_STD(cout);
 
 // main.cxx hack, should come from an include someplace
 extern void fgInitVisuals( void );
-extern void fgReshape( int width, int height );
 extern void fgRenderFrame( void );
 
 extern void fgHUDalphaAdjust( puObject * );
@@ -119,10 +118,6 @@ extern void fgUpdateHUD( GLfloat x_start, GLfloat y_start,
                          GLfloat x_end, GLfloat y_end );
 #endif
 
-#if defined(FG_OLD_MENUBAR)
-extern puMenuBar    *mainMenuBar;
-#endif
-
 puDialogBox  *dialogBox = 0;
 puFrame      *dialogFrame = 0;
 puText       *dialogBoxMessage = 0;
@@ -247,28 +242,6 @@ void guiErrorMessage (const char *txt, const sg_throwable &throwable)
       mkDialog(msg.c_str());
 }
 
-#if defined(FG_OLD_MENUBAR)
-// Toggle the Menu and Mouse display state
-void guiToggleMenu(void)
-{
-    if( gui_menu_on ) {
-        // printf("Hiding Menu\n");
-        mainMenuBar->hide  ();
-#if defined(WIN32_CURSOR_TWEAKS_OFF)
-        if( mouse_mode == MOUSE_POINTER )
-            TurnCursorOff();
-#endif // WIN32_CURSOR_TWEAKS_OFF
-    } else {
-        // printf("Showing Menu\n");
-        mainMenuBar->reveal();
-#ifdef WIN32
-        TurnCursorOn();
-#endif // WIN32
-    }
-    gui_menu_on = ~gui_menu_on;
-}
-#endif // FG_OLD_MENUBAR
-
 // Intercept the Escape Key
 void ConfirmExitDialog(void)
 {
@@ -313,7 +286,7 @@ void SaveDialogOk(puObject*) {
     SaveDialogInput->getValue(&s);
 
     ofstream output(s);
-    cout << saveFile << endl;
+    // cout << saveFile << endl;
     if (output.good() && fgSaveFlight(output)) {
        output.close();
        mkDialog("Saved flight");
@@ -428,14 +401,6 @@ void guiTogglePanel(puObject *cb)
            fgGetInt("/sim/startup/ysize"));
 }
 
-#if defined(FG_OLD_MENUBAR)    
-//void MenuHideMenuCb(puObject *cb)
-void hideMenuCb (puObject *cb)
-{
-    guiToggleMenu();
-}
-#endif
-
 void goodBye(puObject *)
 {
     // SG_LOG( SG_INPUT, SG_ALERT,
@@ -580,7 +545,6 @@ void fgHiResDump()
     FILE *f;
     string message;
     bool show_pu_cursor = false;
-    bool show_menu = false;
     char *filename = new char [24];
     static int count = 1;
 
@@ -592,13 +556,6 @@ void fgHiResDump()
         fgSetBool("/sim/freeze/master", true);
     }
 
-#if defined(FG_OLD_MENUBAR)
-    if(gui_menu_on) {
-        show_menu = true;
-        guiToggleMenu();
-    }
-#endif
-       
     if ( !puCursorIsHidden() ) {
         show_pu_cursor = true;
         puHideCursor();
@@ -694,8 +651,8 @@ void fgHiResDump()
     GLfloat hud_row_step = 480.0 / nrows;
        
     bool do_panel = fgPanelVisible();
-    GLfloat panel_col_step = current_panel->getWidth() / ncols;
-    GLfloat panel_row_step = current_panel->getHeight() / nrows;
+    GLfloat panel_col_step = globals->get_current_panel()->getWidth() / ncols;
+    GLfloat panel_row_step = globals->get_current_panel()->getHeight() / nrows;
        
     /* Draw tiles */
     int more = 1;
@@ -708,7 +665,8 @@ void fgHiResDump()
             fgUpdateHUD( curColumn*hud_col_step,      curRow*hud_row_step,
                          (curColumn+1)*hud_col_step, (curRow+1)*hud_row_step );
         if (do_panel)
-            current_panel->update( curColumn*panel_col_step, panel_col_step,
+            globals->get_current_panel()->update(
+                                   curColumn*panel_col_step, panel_col_step,
                                    curRow*panel_row_step,    panel_row_step );
         more = trEndTile(tr);
 
@@ -758,11 +716,6 @@ void fgHiResDump()
 
     delete [] filename;
 
-#if defined(FG_OLD_MENUBAR)
-    if( show_menu )
-        guiToggleMenu();
-#endif
-
     if ( show_pu_cursor ) {
         puShowCursor();
     }
@@ -821,9 +774,6 @@ void printScreen ( puObject *obj ) {
        puHideCursor();
     }
     // BusyCursor( 0 );
-#if defined(FG_OLD_MENUBAR)
-    mainMenuBar->hide();
-#endif
 
     CGlPrinter p( CGlPrinter::PRINT_BITMAP );
     int cur_width = fgGetInt("/sim/startup/xsize");
@@ -831,11 +781,6 @@ void printScreen ( puObject *obj ) {
     p.Begin( "FlightGear", cur_width*3, cur_height*3 );
        p.End( hiResScreenCapture(3) );
 
-#if defined(FG_OLD_MENUBAR)
-    if( gui_menu_on ) {
-       mainMenuBar->reveal();
-    }
-#endif
     // BusyCursor(1);
     if ( show_pu_cursor ) {
        puShowCursor();
@@ -870,9 +815,6 @@ void fgDumpSnapShot () {
         fgSetBool("/sim/freeze/master", true);
     }
 
-#if defined(FG_OLD_MENUBAR)
-    mainMenuBar->hide();
-#endif
     TurnCursorOff();
     if ( !puCursorIsHidden() ) {
        show_pu_cursor = true;
@@ -916,11 +858,6 @@ void fgDumpSnapShot () {
     }
 
     TurnCursorOn();
-#if defined(FG_OLD_MENUBAR)
-    if( gui_menu_on ) {
-       mainMenuBar->reveal();
-    }
-#endif
 
     if ( !freeze ) {
         fgSetBool("/sim/freeze/master", false);