]> git.mxchange.org Git - flightgear.git/blobdiff - src/Cockpit/panel.cxx
make --enable-osgviewer the default
[flightgear.git] / src / Cockpit / panel.cxx
index 7274e5570ccbf2949643c1c23e3a13c1afa15480..5be11a20e142f61c2b05c2f34324b2c0db84fb72 100644 (file)
@@ -31,7 +31,7 @@
 #  include <config.h>
 #endif
 
-#ifdef HAVE_WINDOWS_H          
+#ifdef HAVE_WINDOWS_H
 #  include <windows.h>
 #endif
 
@@ -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.
@@ -118,7 +118,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 +127,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()) 
@@ -139,7 +139,11 @@ FGTextureManager::createTexture (const string &relativePath)
 }
 
 
-
+void FGTextureManager::addTexture(const string &relativePath,
+                                  osg::Texture2D* texture)
+{
+    _textureMap[relativePath] = texture;
+}
 \f
 ////////////////////////////////////////////////////////////////////////
 // Implementation of FGCropped Texture.