]> git.mxchange.org Git - flightgear.git/blobdiff - src/Cockpit/cockpit.cxx
A couple more straggling instrumentation clean ups.
[flightgear.git] / src / Cockpit / cockpit.cxx
index 0415b86a8219afa70c605517db0e81627f42b779..97f844da90bd181a919d7136bfbad3e092deba73 100644 (file)
@@ -29,7 +29,9 @@
 #  include <windows.h>
 #endif
 
-#include GLUT_H
+#include <simgear/compiler.h>
+
+#include SG_GLU_H
 
 #include <stdlib.h>
 #include <stdio.h>
 #include <simgear/constants.h>
 #include <simgear/debug/logstream.hxx>
 #include <simgear/math/polar3d.hxx>
-#include <simgear/misc/props.hxx>
+#include <simgear/props/props.hxx>
 #include <simgear/timing/sg_time.hxx>
 
 #include <Aircraft/aircraft.hxx>
 #include <Include/general.hxx>
-#include <FDM/ADA.hxx>
+#ifdef ENABLE_SP_FMDS
+#include <FDM/SP/ADA.hxx>
+#endif
 #include <Main/globals.hxx>
 #include <Main/fg_props.hxx>
 #include <Main/viewmgr.hxx>
@@ -278,6 +282,15 @@ float get_view_direction( void )
     return view;
 }
 
+// Added by Markus Hof on 5. Jan 2004
+float get_dme( void )
+{
+    static const SGPropertyNode * dme_node =
+        fgGetNode("/radios/dme/distance-nm");
+
+    return dme_node->getFloatValue();
+}
+
 // $$$ begin - added, VS Renganathan 13 Oct 2K
 // #ifdef FIGHTER_HUD
 float get_Vx   ( void )
@@ -328,6 +341,7 @@ float get_anzg   ( void )
     return anzg;
 }
 
+#ifdef ENABLE_SP_FMDS
 int get_iaux1 (void)
 {
     FGADA *fdm = (FGADA *)current_aircraft.fdm_state;
@@ -507,7 +521,7 @@ float get_aux18 (void)
     FGADA *fdm = (FGADA *)current_aircraft.fdm_state;
     return fdm->get_faux(10);
 }
-// #endif
+#endif
 // $$$ end - added, VS Renganathan 13 Oct 2K
 
 
@@ -714,15 +728,9 @@ void fgCockpitUpdate( void ) {
         fgUpdateHUD();
     }
 
-#define DISPLAY_COUNTER
-#ifdef DISPLAY_COUNTER
-    else
-    {
+    if ( fgGetBool( "/sim/hud/draw-fps", false ) ) {
         char buf[64];
-        float fps    =       get_frame_rate();
-//      float tris   = fps * get_vfc_tris_drawn();
-//      float culled = fps * get_vfc_tris_culled();
-//      sprintf(buf,"%-4.1f  %7.0f  %7.0f", fps, tris, culled);
+        float fps = get_frame_rate();
         sprintf(buf,"%-5.1f", fps);
 
         glMatrixMode( GL_PROJECTION );
@@ -748,7 +756,6 @@ void fgCockpitUpdate( void ) {
         glMatrixMode( GL_MODELVIEW );
         glPopMatrix();
     }
-#endif // #ifdef DISPLAY_COUNTER
     
     glViewport( 0, 0, iwidth, iheight );
 }