]> git.mxchange.org Git - flightgear.git/blobdiff - src/Cockpit/hud.cxx
Don't scale elevator by 0.5.
[flightgear.git] / src / Cockpit / hud.cxx
index 4f7ddfdedc7a6b29d2f8775f944e4f93b9451446..3b3285dfa5299487faf2d3b3e1c2b02b0a8f6c02 100644 (file)
@@ -21,7 +21,7 @@
 // $Id$
 
 #include <simgear/compiler.h>
-#include <simgear/misc/exception.hxx>
+#include <simgear/structure/exception.hxx>
 
 #include STL_STRING
 #include STL_FSTREAM
@@ -40,7 +40,6 @@
 
 #include <math.h>
 
-#include <GL/glut.h>
 #include <stdlib.h>
 #include <stdio.h>             // char related functions
 #include <string.h>            // strcmp()
@@ -242,11 +241,13 @@ readLadder(const SGPropertyNode * node)
     // The factor assumes a base of 55 degrees per 640 pixels.
     // Invert to convert the "compression" factor to a
     // pixels-per-degree number.
-    if( HUD_style == 1)
+    if(fgGetBool("/sim/hud/enable3d", true))
     {
-//        if(factor == 0)
+        if (HUD_style == 1)
+        {
             factor = 1;
-        factor = (640./55.) / factor;
+            factor = (640./55.) / factor;
+        }
     }
 
     SG_LOG(SG_INPUT, SG_INFO, "Done reading instrument " << name);
@@ -993,7 +994,8 @@ static void set_hud_color(float r, float g, float b) {
 //
 void fgUpdateHUD( void ) {
        
-    if( HUD_style == 1)
+    static const SGPropertyNode *enable3d_node = fgGetNode("/sim/hud/enable3d");
+    if( HUD_style == 1 && enable3d_node->getBoolValue() )
     {
         fgUpdateHUDVirtual();
         return;