# include <windows.h>
#endif
-#include <GL/glut.h>
-
#include <stdlib.h>
#include <stdio.h>
#include <string.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 <GUI/gui.h>
#include "cockpit.hxx"
+#include "hud.hxx"
// This is a structure that contains all data related to
float get_agl( void )
{
+ static const SGPropertyNode *startup_units_node
+ = fgGetNode("/sim/startup/units");
+
float agl;
- if ( !strcmp("/sim/startup/units", "feet") ) {
+ if ( !strcmp(startup_units_node->getStringValue(), "feet") ) {
agl = (current_aircraft.fdm_state->get_Altitude()
- - scenery.get_cur_elev() * SG_METER_TO_FEET);
+ - globals->get_scenery()->get_cur_elev() * SG_METER_TO_FEET);
} else {
agl = (current_aircraft.fdm_state->get_Altitude() * SG_FEET_TO_METER
- - scenery.get_cur_elev());
+ - globals->get_scenery()->get_cur_elev());
}
return agl;
float get_climb_rate( void )
{
+ static const SGPropertyNode *startup_units_node
+ = fgGetNode("/sim/startup/units");
+
float climb_rate;
- if ( !strcmp("/sim/startup/units", "feet") ) {
+ if ( !strcmp(startup_units_node->getStringValue(), "feet") ) {
climb_rate = current_aircraft.fdm_state->get_Climb_Rate() * 60.0;
} else {
climb_rate = current_aircraft.fdm_state->get_Climb_Rate() * SG_FEET_TO_METER * 60.0;