#include <stdio.h> // char related functions
#include <string.h> // strcmp()
+#include SG_GLU_H
+
#include <simgear/constants.h>
#include <simgear/debug/logstream.hxx>
#include <simgear/props/props.hxx>
#include <Main/fg_props.hxx>
#include <Scenery/scenery.hxx>
-#if defined ( __sun__ ) || defined ( __sgi )
+#if defined (__sun) || defined ( __sgi )
extern "C" {
extern void *memmove(void *, const void *, size_t);
}
}
}
+#ifdef ENABLE_SP_FMDS
if ( loadfn== "aux1" ) {
load_fn = get_aux1;
} else if ( loadfn == "aux2" ) {
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;
return p;
} //end readTBI
+static instr_item *
+readRunway(const SGPropertyNode * node) {
+ name = node->getStringValue("name");
+ x = node->getIntValue("x");
+ y = node->getIntValue("y");
+ width = node->getIntValue("width");
+ height = node->getIntValue("height");
+ scaling = node->getDoubleValue("scale");
+ working = node->getBoolValue("working",true);
+ runway_instr *ri = new runway_instr(x,y,width,height,scaling,working);
+ double scale = node->getDoubleValue("arrow_scale",1.0);
+ ri->setDrawArrow((scale>0)?true:false);
+ ri->setDrawArrowAlways((scale>0)?node->getBoolValue("arrow_always"):false);
+ ri->setStippleOutline(node->getIntValue("outer_stipple",0xFFFF));
+ ri->setStippleCenterline(node->getIntValue("center_stipple",0xFFFF));
+ ri->setArrowRotationRadius(node->getDoubleValue("arrow_radius"));
+ ri->setArrowScale(scale);
+ ri->setLineScale(node->getDoubleValue("line_scale",1.0));
+ ri->setScaleDist(node->getDoubleValue("scale_dist_nm"));
+ SG_LOG(SG_INPUT, SG_INFO, "Done reading instrument " << name);
+ return (instr_item *) ri;
+}
+
int readInstrument(const SGPropertyNode * node)
{
}//for - tbis
}
+
+ const SGPropertyNode * rwy_group = node->getNode("runways");
+ if (rwy_group != 0) {
+ int nRwy = rwy_group->nChildren();
+ for (int j = 0; j < nRwy; j++) {
+ SG_LOG( SG_COCKPIT, SG_DEBUG,
+ "************** Reading runway properties" );
+ HIptr = readRunway(rwy_group->getChild(j));
+ HUD_deque.insert( HUD_deque.begin(), HIptr);
+
+ }//for - runways
+ }
return 0;
}//end readinstrument
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);
}
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;
}