]> 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 d9654f231e2341b00bb74c5a0ca6be6ad967c2a0..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
 
 #include <math.h>
 
-#include <GL/glut.h>
 #include <stdlib.h>
 #include <stdio.h>             // char related functions
 #include <string.h>            // strcmp()
 
 #include <simgear/constants.h>
 #include <simgear/debug/logstream.hxx>
-#include <simgear/misc/props.hxx>
+#include <simgear/props/props.hxx>
 #include <simgear/misc/sg_path.hxx>
-//#include <simgear/math/fg_random.h>
-//#include <simgear/math/polar3d.hxx>
 
 #include <Aircraft/aircraft.hxx>
 #include <Autopilot/newauto.hxx>
 #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>
-//#include <Time/fg_timer.hxx>
 
 #if defined ( __sun__ ) || defined ( __sgi )
 extern "C" {
@@ -245,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);
@@ -996,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;
@@ -1166,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];