]> git.mxchange.org Git - flightgear.git/commitdiff
Add an autohide property for the 2D panel.
authortimoore <timoore>
Sun, 9 Sep 2007 23:21:20 +0000 (23:21 +0000)
committertimoore <timoore>
Sun, 9 Sep 2007 23:21:20 +0000 (23:21 +0000)
Author:Csaba Halasz

src/Cockpit/panel.cxx
src/Cockpit/panel.hxx
src/Cockpit/panel_io.cxx

index 890b9a39dbb6961b54fed45fcb6bda2119d549a1..86b82903e9f7128fc8ae40d4f0851af2acfe1543 100644 (file)
@@ -98,18 +98,18 @@ get_aspect_adjust (int xsize, int ysize)
 bool
 fgPanelVisible ()
 {
-     if (globals->get_current_panel() == 0)
+     const FGPanel* current = globals->get_current_panel();
+     if (current == 0)
        return false;
-     if (globals->get_current_panel()->getVisibility() == 0)
+     if (current->getVisibility() == 0)
        return false;
      if (globals->get_viewmgr()->get_current() != 0)
        return false;
-     if (globals->get_current_view()->getHeadingOffset_deg() * SGD_DEGREES_TO_RADIANS != 0)
+     if (current->getAutohide() && globals->get_current_view()->getHeadingOffset_deg() * SGD_DEGREES_TO_RADIANS != 0)
        return false;
      return true;
 }
 
-
 \f
 ////////////////////////////////////////////////////////////////////////
 // Implementation of FGTextureManager.
index 2b04559f4de027e3f06b3c76b81034b2c68d6034..af113c977649df4794d9dbe569e3dc1071be800c 100644 (file)
@@ -191,6 +191,9 @@ public:
 
   virtual void setDepthTest (bool enable);
 
+  bool getAutohide(void) const { return _autohide; };
+  void setAutohide(bool enable) { _autohide = enable; };
+
 private:
   void setupVirtualCockpit();
   void cleanupVirtualCockpit();
@@ -218,6 +221,7 @@ private:
                                // List of instruments in panel.
   instrument_list_type _instruments;
   bool _enable_depth_test;
+  bool _autohide;
 };
 
 
index ad33b109d6a87806a1e10d13564579fe10d1a6a3..d017fb93c8e0987d1df6ba4a5cd8f650ed999ebb 100644 (file)
@@ -680,6 +680,8 @@ readPanel (const SGPropertyNode * root)
   if (!fgHasNode("/sim/panel/y-offset"))
     fgSetInt("/sim/panel/y-offset", root->getIntValue("y-offset", 0));
 
+  panel->setAutohide(root->getBoolValue("autohide", true));
+
   //
   // Assign the background texture, if any, or a bogus chequerboard.
   //