#include <GL/glut.h>
#include <stdlib.h>
+#include <stdio.h> // char related functions
+#include <string.h> // strcmp()
#include STL_STRING
#include STL_FSTREAM
#include <simgear/constants.h>
#include <simgear/debug/logstream.hxx>
#include <simgear/misc/props.hxx>
+#include <simgear/misc/sg_path.hxx>
//#include <simgear/math/fg_random.h>
//#include <simgear/math/polar3d.hxx>
load_fn = get_aileronval;
} else if (loadfn=="elevatorval") {
load_fn = get_elevatorval;
+ } else if (loadfn=="elevatortrimval") {
+ load_fn = get_elev_trimval;
} else if (loadfn=="rudderval") {
load_fn = get_rudderval;
} else if (loadfn=="throttleval") {
int readInstrument(const SGPropertyNode * node)
{
+ static const SGPropertyNode *startup_units_node
+ = fgGetNode("/sim/startup/units");
instr_item *HIptr;
- if ( fgGetString("/sim/startup/units") == "feet" ) {
+ if ( !strcmp(startup_units_node->getStringValue(), "feet") ) {
strcpy(units, " ft");
} else {
strcpy(units, " m");
// char scratch[128];
// HUD_TextList.add( fgText( "AUTOPILOT", 20, apY) );
// apY -= 15;
- if( current_autopilot->get_HeadingEnabled() ) {
+ if( globals->get_autopilot()->get_HeadingEnabled() ) {
HUD_TextList.add( fgText( 40, apY,
- current_autopilot->get_TargetHeadingStr()) );
+ globals->get_autopilot()->get_TargetHeadingStr()) );
apY -= 15;
}
- if( current_autopilot->get_AltitudeEnabled() ) {
+ if( globals->get_autopilot()->get_AltitudeEnabled() ) {
HUD_TextList.add( fgText( 40, apY,
- current_autopilot->get_TargetAltitudeStr()) );
+ globals->get_autopilot()->get_TargetAltitudeStr()) );
apY -= 15;
}
- if( current_autopilot->get_HeadingMode() ==
+ if( globals->get_autopilot()->get_HeadingMode() ==
FGAutopilot::FG_HEADING_WAYPOINT )
{
char *wpstr;
- wpstr = current_autopilot->get_TargetWP1Str();
+ wpstr = globals->get_autopilot()->get_TargetWP1Str();
if ( strlen( wpstr ) ) {
HUD_TextList.add( fgText( 40, apY, wpstr ) );
apY -= 15;
}
- wpstr = current_autopilot->get_TargetWP2Str();
+ wpstr = globals->get_autopilot()->get_TargetWP2Str();
if ( strlen( wpstr ) ) {
HUD_TextList.add( fgText( 40, apY, wpstr ) );
apY -= 15;
}
- wpstr = current_autopilot->get_TargetWP3Str();
+ wpstr = globals->get_autopilot()->get_TargetWP3Str();
if ( strlen( wpstr ) ) {
HUD_TextList.add( fgText( 40, apY, wpstr ) );
apY -= 15;