]> git.mxchange.org Git - flightgear.git/blobdiff - src/Cockpit/panel.cxx
Add an autohide property for the 2D panel.
[flightgear.git] / src / Cockpit / panel.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.