]> git.mxchange.org Git - flightgear.git/blobdiff - src/Cockpit/hud.cxx
Boris Koenig:
[flightgear.git] / src / Cockpit / hud.cxx
index f2b2bcc588b4e88138614c09f99dcab05b95effd..9212f6e5fcf408898c40fe0b7fddebc4dca0f924 100644 (file)
@@ -44,6 +44,8 @@
 #include <stdio.h>             // char related functions
 #include <string.h>            // strcmp()
 
+#include <GL/glu.h>
+
 #include <simgear/constants.h>
 #include <simgear/debug/logstream.hxx>
 #include <simgear/props/props.hxx>
@@ -453,6 +455,7 @@ readLabel(const SGPropertyNode * node)
         }
     }
 
+#ifdef ENABLE_SP_FMDS
     if ( loadfn== "aux1" ) {
         load_fn = get_aux1;
     } else if ( loadfn == "aux2" ) {
@@ -489,7 +492,9 @@ readLabel(const SGPropertyNode * node)
         load_fn = get_aux17;
     } else if ( loadfn == "aux18" ) {
         load_fn = get_aux18;
-    } else if ( loadfn == "ax" ) {
+    } else
+#endif
+      if ( loadfn == "ax" ) {
         load_fn = get_Ax;
     } else if ( loadfn == "speed" ) {
         load_fn = get_speed;
@@ -1106,6 +1111,7 @@ void drawHUD()
     static char hud_wp0_text[256];
     static char hud_wp1_text[256];
     static char hud_wp2_text[256];
+    static char hud_alt_text[256];
 
     if( antialiased_node->getBoolValue() ) {
         glEnable(GL_LINE_SMOOTH);
@@ -1213,7 +1219,14 @@ void drawHUD()
     }
   
     if ( strcmp( altitude_enabled->getStringValue(), "altitude-hold" ) == 0 ) {
-        HUD_TextList.add( fgText( 40, apY, (char *)fgGetString("/autopilot/settings/altitude-ft") ) );
+        snprintf( hud_alt_text, 256, "alt = %.0f\n",
+                  fgGetDouble("/autopilot/settings/target-altitude-ft") );
+        HUD_TextList.add( fgText( 40, apY, hud_alt_text ) );
+        apY -= 15;
+    } else if ( strcmp( altitude_enabled->getStringValue(), "agl-hold" ) == 0 ){
+        snprintf( hud_alt_text, 256, "agl = %.0f\n",
+                  fgGetDouble("/autopilot/settings/target-agl-ft") );
+        HUD_TextList.add( fgText( 40, apY, hud_alt_text ) );
         apY -= 15;
     }