]> git.mxchange.org Git - flightgear.git/blobdiff - src/GUI/gui.cxx
Patch from Andy Ross to allow virtual panel to tilt with mouse view:
[flightgear.git] / src / GUI / gui.cxx
index 8bd6f6c16791f8cddfd08800ed2fc5cc605d73e7..3ecbcb6c955a29f8033cabf0576d2018c356966f 100644 (file)
@@ -68,7 +68,6 @@
 #include <Main/fg_io.hxx>
 #include <Main/globals.hxx>
 #include <Main/fg_props.hxx>
-#include <Main/options.hxx>
 #include <Main/viewmgr.hxx>
 
 #ifdef FG_NETWORK_OLK
@@ -85,6 +84,7 @@
 #include "apt_dlg.hxx"
 #include "net_dlg.hxx"
 #include "sgVec3Slider.hxx"
+#include "prop_picker.hxx"
 
 SG_USING_STD(string);
 
@@ -449,8 +449,8 @@ void helpCb (puObject *)
        
 #if defined(FX) && !defined(WIN32)
 #  if defined(XMESA_FX_FULLSCREEN) && defined(XMESA_FX_WINDOW)
-    if ( global_fullscreen ) {
-        global_fullscreen = false;
+    if ( globals->get_fullscreen() ) {
+        globals->set_fullscreen(false);
         XMesaSetFXmode( XMESA_FX_WINDOW );
     }
 #  endif
@@ -493,9 +493,13 @@ void fgHiResDump()
     char *filename = new char [24];
     static int count = 1;
 
-    int freeze = globals->get_freeze();
-    if(!freeze)
-        globals->set_freeze( true );
+    static const SGPropertyNode *master_freeze
+       = fgGetNode("/sim/freeze/master");
+
+    bool freeze = master_freeze->getBoolValue();
+    if ( !freeze ) {
+        fgSetBool("/sim/freeze/master", true);
+    }
 
     if(gui_menu_on) {
         show_menu = true;
@@ -521,8 +525,8 @@ void fgHiResDump()
     glMatrixMode(GL_MODELVIEW);
     glLoadIdentity();
     ssgSetCamera( (sgVec4 *)globals->get_current_view()->get_VIEW() );
-    float fov = globals->get_current_view()->get_fov();
-    ssgSetFOV(fov, fov * globals->get_current_view()->get_fov_ratio());
+    ssgSetFOV( globals->get_current_view()->get_h_fov(),
+              globals->get_current_view()->get_v_fov() );
     // ssgSetNearFar( 10.0f, 120000.0f );
     ssgSetNearFar( 0.5f, 1200000.0f );
 
@@ -668,8 +672,9 @@ void fgHiResDump()
         puShowCursor();
     }
 
-    if(!freeze)
-        globals->set_freeze( false );
+    if ( !freeze ) {
+        fgSetBool("/sim/freeze/master", false);
+    }
 }
 #endif // #if defined( TR_HIRES_SNAP)
 
@@ -722,7 +727,7 @@ void printScreen ( puObject *obj ) {
        show_pu_cursor = true;
        puHideCursor();
     }
-    BusyCursor( 0 );
+    // BusyCursor( 0 );
     mainMenuBar->hide();
 
     CGlPrinter p( CGlPrinter::PRINT_BITMAP );
@@ -734,7 +739,7 @@ void printScreen ( puObject *obj ) {
     if( gui_menu_on ) {
        mainMenuBar->reveal();
     }
-    BusyCursor(1);
+    // BusyCursor(1);
     if ( show_pu_cursor ) {
        puShowCursor();
     }
@@ -760,9 +765,13 @@ void fgDumpSnapShot () {
     string message;
     static int count = 1;
 
-    int freeze = globals->get_freeze();
-    if(!freeze)
-        globals->set_freeze( true );
+    static const SGPropertyNode *master_freeze
+       = fgGetNode("/sim/freeze/master");
+
+    bool freeze = master_freeze->getBoolValue();
+    if ( !freeze ) {
+        fgSetBool("/sim/freeze/master", true);
+    }
 
     mainMenuBar->hide();
     TurnCursorOff();
@@ -812,8 +821,9 @@ void fgDumpSnapShot () {
        mainMenuBar->reveal();
     }
 
-    if(!freeze)
-        globals->set_freeze( false );
+    if ( !freeze ) {
+        fgSetBool("/sim/freeze/master", false);
+    }
 }
 
 #ifdef FG_NETWORK_OLK
@@ -882,12 +892,14 @@ puCallback editSubmenuCb        [] = {
 
 extern void fgHUDalphaAdjust( puObject * );
 char *viewSubmenu               [] = {
+    "Properties",
     "HUD Alpha",
     "Pilot Offset",
     /* "Cockpit View > ", "View >","------------", */
     "Toggle Panel...", NULL
 };
 puCallback viewSubmenuCb        [] = {
+    prop_pickerView,
     fgHUDalphaAdjust,
     PilotOffsetAdjust,
     /* notCb, notCb, NULL, */
@@ -1022,6 +1034,7 @@ void guiInit()
     // Set up our Dialog Boxes
     ConfirmExitDialogInit();
     NewAirportInit();
+       
 #ifdef FG_NETWORK_OLK
     NewNetIdInit();
     NewNetFGDInit();