]> git.mxchange.org Git - flightgear.git/blobdiff - src/Cockpit/panel.cxx
Some changes contributed by David Megginson to allow for more interesting
[flightgear.git] / src / Cockpit / panel.cxx
index 4b72ce0f2cb767f68d339e3fd2cbedf5d301ae12..7de4b43eabd447b888fb5371438e1b2a4d64ce4a 100644 (file)
 #include "panel.hxx"
 
 
+bool
+fgPanelVisible ()
+{
+  return ((current_options.get_panel_status()) &&
+         (current_options.get_view_mode() == fgOPTIONS::FG_VIEW_PILOT) &&
+         (current_view.get_view_offset() == 0.0));
+}
+
+
 \f
 ////////////////////////////////////////////////////////////////////////
 // Implementation of FGTextureManager.
@@ -125,7 +134,7 @@ FGPanel::FGPanel (int window_x, int window_y, int window_w, int window_h)
     _width(_winw), _height(int(_winh * 0.5768 + 1)),
     _x_offset(0), _y_offset(0), _view_height(int(_winh * 0.4232))
 {
-  setVisibility(current_options.get_panel_status());
+  setVisibility(fgPanelVisible());
 }
 
 
@@ -160,7 +169,7 @@ void
 FGPanel::update () const
 {
                                // Do nothing if the panel isn't visible.
-  if (!_visibility)
+  if (!fgPanelVisible())
     return;
 
                                // If the mouse is down, do something
@@ -202,9 +211,9 @@ FGPanel::update () const
   glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
   glBegin(GL_POLYGON);
   glTexCoord2f(0.0, 0.0); glVertex3f(_winx, _winy, 0);
-  glTexCoord2f(10.0, 0.0); glVertex3f(_winx + _width, _winy, 0);
-  glTexCoord2f(10.0, 5.0); glVertex3f(_winx + _width, _winy + _height, 0);
-  glTexCoord2f(0.0, 5.0); glVertex3f(_winx, _winy + _height, 0);
+  glTexCoord2f(1.0, 0.0); glVertex3f(_winx + _width, _winy, 0);
+  glTexCoord2f(1.0, 1.0); glVertex3f(_winx + _width, _winy + _height, 0);
+  glTexCoord2f(0.0, 1.0); glVertex3f(_winx, _winy + _height, 0);
   glEnd();
 
                                // Draw the instruments.