]> git.mxchange.org Git - flightgear.git/blobdiff - src/Cockpit/cockpit.cxx
Olaf Flebbe: MSVC fix.
[flightgear.git] / src / Cockpit / cockpit.cxx
index 8b49ca916485f4062b61c98e21a3372f6597e97d..549a1f815126324719b74087298ca0a68fec39b5 100644 (file)
@@ -207,10 +207,10 @@ float get_agl( void )
 
     if ( !strcmp(startup_units_node->getStringValue(), "feet") ) {
         agl = (current_aircraft.fdm_state->get_Altitude()
-               - globals->get_scenery()->get_cur_elev() * SG_METER_TO_FEET);
+               - current_aircraft.fdm_state->get_Runway_altitude());
     } else {
-        agl = (current_aircraft.fdm_state->get_Altitude() * SG_FEET_TO_METER
-               - globals->get_scenery()->get_cur_elev());
+        agl = (current_aircraft.fdm_state->get_Altitude()
+               - current_aircraft.fdm_state->get_Runway_altitude()) * SG_FEET_TO_METER;
     }
 
     return agl;
@@ -728,35 +728,6 @@ void fgCockpitUpdate( void ) {
         fgUpdateHUD();
     }
 
-    if ( fgGetBool( "/sim/hud/draw-fps", false ) ) {
-        char buf[64];
-        float fps = get_frame_rate();
-        sprintf(buf,"%-5.1f", fps);
-
-        glMatrixMode( GL_PROJECTION );
-        glPushMatrix();
-        glLoadIdentity();
-        gluOrtho2D( 0, iwidth, 0, iheight );
-        glMatrixMode( GL_MODELVIEW );
-        glPushMatrix();
-        glLoadIdentity();
-
-        glDisable( GL_DEPTH_TEST );
-        glDisable( GL_LIGHTING );
-        
-        glColor3f( 0.9, 0.4, 0.2 );
-
-        guiFnt.drawString( buf,
-                          int(width - guiFnt.getStringWidth(buf) - 10),
-                           10 );
-        glEnable( GL_DEPTH_TEST );
-        glEnable( GL_LIGHTING );
-        glMatrixMode( GL_PROJECTION );
-        glPopMatrix();
-        glMatrixMode( GL_MODELVIEW );
-        glPopMatrix();
-    }
-    
     glViewport( 0, 0, iwidth, iheight );
 }