]> git.mxchange.org Git - flightgear.git/blobdiff - src/Cockpit/hud.cxx
The code to find the highest hit below you didn't work quite right when
[flightgear.git] / src / Cockpit / hud.cxx
index 4f7ddfdedc7a6b29d2f8775f944e4f93b9451446..18e0ef636308373a45f1d7501301c80cf3577744 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()
@@ -55,9 +54,6 @@
 #include <GUI/gui.h>
 #include <Main/globals.hxx>
 #include <Main/fg_props.hxx>
-#ifdef FG_NETWORK_OLK
-#include <NetworkOLK/network.h>
-#endif
 #include <Scenery/scenery.hxx>
 
 #if defined ( __sun__ ) || defined ( __sgi )
@@ -242,11 +238,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 +991,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;
@@ -1163,12 +1162,6 @@ void drawHUD()
 
     HUD_TextList.add( fgText(40, 10, get_formated_gmt_time(), 0) );
 
-#ifdef FG_NETWORK_OLK
-    if ( net_hud_display ) {
-        net_hud_update();
-    }
-#endif
-
 
     int apY = 480 - 80;
     // char scratch[128];