]> git.mxchange.org Git - flightgear.git/blobdiff - src/Cockpit/panel.cxx
Merge branch 'maint' into next
[flightgear.git] / src / Cockpit / panel.cxx
index 890b9a39dbb6961b54fed45fcb6bda2119d549a1..a7b860afa43aa4ac8433a640f0e4640f9021a5c8 100644 (file)
 #  include <config.h>
 #endif
 
-#ifdef HAVE_WINDOWS_H
-#  include <windows.h>
-#endif
-
 #include <stdio.h>     // sprintf
 #include <string.h>
+#include <iostream>
 
 #include <osg/CullFace>
 #include <osg/Depth>
 
 #include <simgear/compiler.h>
 
-#include SG_GLU_H
-
 #include <plib/fnt.h>
 
 #include <simgear/debug/logstream.hxx>
 #include <simgear/misc/sg_path.hxx>
 #include <simgear/scene/model/model.hxx>
+#include <osg/GLU>
 
 #include <Main/globals.hxx>
 #include <Main/fg_props.hxx>
@@ -98,18 +94,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.
@@ -118,7 +114,7 @@ fgPanelVisible ()
 map<string,osg::ref_ptr<osg::Texture2D> > FGTextureManager::_textureMap;
 
 osg::Texture2D*
-FGTextureManager::createTexture (const string &relativePath)
+FGTextureManager::createTexture (const string &relativePath, bool staticTexture)
 {
   osg::Texture2D* texture = _textureMap[relativePath].get();
   if (texture == 0) {
@@ -127,7 +123,7 @@ FGTextureManager::createTexture (const string &relativePath)
     SGPath tpath(globals->get_fg_root());
     tpath.append(relativePath);
 
-    texture = SGLoadTexture2D(tpath);
+    texture = SGLoadTexture2D(staticTexture, tpath);
 
     _textureMap[relativePath] = texture;
     if (!_textureMap[relativePath].valid())