#include <Include/general.hxx>
#include <FDM/ADA.hxx>
#include <Main/globals.hxx>
+#include <Main/fg_props.hxx>
#include <Scenery/scenery.hxx>
#include <Time/fg_timer.hxx>
#include <GUI/gui.h>
{
// Make an explicit function call.
float speed = current_aircraft.fdm_state->get_V_calibrated_kts()
- * globals->get_options()->get_speed_up();
+ * fgGetInt("/sim/speed-up"); // FIXME: inefficient
return( speed );
}
// f->get_Latitude() * RAD_TO_ARCSEC);
float altitude;
- if ( globals->get_options()->get_units() == FGOptions::FG_UNITS_FEET ) {
+ if ( fgGetString("/sim/startup/units") == "feet" ) {
altitude = current_aircraft.fdm_state->get_Altitude();
} else {
altitude = (current_aircraft.fdm_state->get_Altitude() * FEET_TO_METER);
{
float agl;
- if ( globals->get_options()->get_units() == FGOptions::FG_UNITS_FEET ) {
+ if ( fgGetString("/sim/startup/units") == "feet" ) {
agl = (current_aircraft.fdm_state->get_Altitude()
- scenery.cur_elev * METER_TO_FEET);
} else {
float get_climb_rate( void )
{
float climb_rate;
- if ( globals->get_options()->get_units() == FGOptions::FG_UNITS_FEET ) {
+ if ( fgGetString("/sim/startup/units") == "feet" ) {
climb_rate = current_aircraft.fdm_state->get_Climb_Rate() * 60.0;
} else {
climb_rate = current_aircraft.fdm_state->get_Climb_Rate() * FEET_TO_METER * 60.0;
"Cockpit: code " << ac_cockpit->code() << " status "
<< ac_cockpit->status() );
- int iwidth = globals->get_options()->get_xsize();
- int iheight = globals->get_options()->get_ysize();
+ // FIXME: inefficient
+ int iwidth = fgGetInt("/sim/startup/xsize");
+ // FIXME: inefficient
+ int iheight = fgGetInt("/sim/startup/ysize");
float width = iwidth;
float height = iheight;
- if ( globals->get_options()->get_hud_status() ) {
+ // FIXME: inefficient
+ if ( fgGetBool("/sim/hud/visibility") ) {
// This will check the global hud linked list pointer.
// If these is anything to draw it will.
fgUpdateHUD();
glMatrixMode( GL_PROJECTION );
glPushMatrix();
glLoadIdentity();
- gluOrtho2D( 0, globals->get_options()->get_xsize(),
- 0, globals->get_options()->get_ysize() );
+ gluOrtho2D( 0, fgGetInt("/sim/startup/xsize"),
+ 0, fgGetInt("/sim/startup/ysize") );
glMatrixMode( GL_MODELVIEW );
glPushMatrix();
glLoadIdentity();
#endif // #ifdef DISPLAY_COUNTER
glViewport( 0, 0,
- globals->get_options()->get_xsize(),
- globals->get_options()->get_ysize() );
+ fgGetInt("/sim/startup/xsize"),
+ fgGetInt("/sim/startup/ysize") );
- if (current_panel != 0)
- current_panel->update();
}