From: curt Date: Sun, 22 Jul 2001 19:51:16 +0000 (+0000) Subject: Move FGControls declaration to globals.hxx X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=96b88e539f769c0e0d70d112d7f98f6843760e10;p=flightgear.git Move FGControls declaration to globals.hxx --- diff --git a/src/Aircraft/aircraft.cxx b/src/Aircraft/aircraft.cxx index 08bcaf8da..886cc149d 100644 --- a/src/Aircraft/aircraft.cxx +++ b/src/Aircraft/aircraft.cxx @@ -26,6 +26,8 @@ #include #include +#include
+ #include "aircraft.hxx" // This is a record containing all the info for the aircraft currently @@ -38,7 +40,7 @@ void fgAircraftInit( void ) { SG_LOG( SG_AIRCRAFT, SG_INFO, "Initializing Aircraft structure" ); current_aircraft.fdm_state = cur_fdm_state; - current_aircraft.controls = &controls; + current_aircraft.controls = globals->get_controls(); } @@ -60,10 +62,10 @@ void fgAircraftOutputCurrent(fgAIRCRAFT *a) { SG_LOG( SG_FLIGHT, SG_DEBUG, "Kts = " << f->get_V_equiv_kts() - << " Elev = " << controls.get_elevator() - << " Aileron = " << controls.get_aileron() - << " Rudder = " << controls.get_rudder() - << " Power = " << controls.get_throttle( 0 ) ); + << " Elev = " << globals->get_controls()->get_elevator() + << " Aileron = " << globals->get_controls()->get_aileron() + << " Rudder = " << globals->get_controls()->get_rudder() + << " Power = " << globals->get_controls()->get_throttle( 0 ) ); } diff --git a/src/Autopilot/newauto.cxx b/src/Autopilot/newauto.cxx index 2198459c3..2d27bf059 100644 --- a/src/Autopilot/newauto.cxx +++ b/src/Autopilot/newauto.cxx @@ -207,10 +207,10 @@ void FGAutopilot::MakeTargetWPStr( double distance ) { void FGAutopilot::update_old_control_values() { - old_aileron = controls.get_aileron(); - old_elevator = controls.get_elevator(); - old_elevator_trim = controls.get_elevator_trim(); - old_rudder = controls.get_rudder(); + old_aileron = globals->get_controls()->get_aileron(); + old_elevator = globals->get_controls()->get_elevator(); + old_elevator_trim = globals->get_controls()->get_elevator_trim(); + old_rudder = globals->get_controls()->get_rudder(); } @@ -514,8 +514,8 @@ int FGAutopilot::run() { double AileronSet = -turn / 2.0; if ( AileronSet < -1.0 ) { AileronSet = -1.0; } if ( AileronSet > 1.0 ) { AileronSet = 1.0; } - controls.set_aileron( AileronSet ); - controls.set_rudder( AileronSet / 4.0 ); + globals->get_controls()->set_aileron( AileronSet ); + globals->get_controls()->set_rudder( AileronSet / 4.0 ); } else { // steer towards the target heading @@ -580,8 +580,8 @@ int FGAutopilot::run() { MaxAileron ); } - controls.set_aileron( AileronSet ); - controls.set_rudder( AileronSet / 4.0 ); + globals->get_controls()->set_aileron( AileronSet ); + globals->get_controls()->set_rudder( AileronSet / 4.0 ); // controls.set_rudder( 0.0 ); } } @@ -698,7 +698,7 @@ int FGAutopilot::run() { total_adj = -1.0; } - controls.set_elevator( total_adj ); + globals->get_controls()->set_elevator( total_adj ); } // auto throttle @@ -737,7 +737,8 @@ int FGAutopilot::run() { total_adj = 0.0; } - controls.set_throttle( FGControls::ALL_ENGINES, total_adj ); + globals->get_controls()->set_throttle( FGControls::ALL_ENGINES, + total_adj ); } #ifdef THIS_CODE_IS_NOT_USED @@ -769,10 +770,10 @@ int FGAutopilot::run() { // stash this runs control settings // update_old_control_values(); - old_aileron = controls.get_aileron(); - old_elevator = controls.get_elevator(); - old_elevator_trim = controls.get_elevator_trim(); - old_rudder = controls.get_rudder(); + old_aileron = globals->get_controls()->get_aileron(); + old_elevator = globals->get_controls()->get_elevator(); + old_elevator_trim = globals->get_controls()->get_elevator_trim(); + old_rudder = globals->get_controls()->get_rudder(); // for cross track error old_lat = lat; diff --git a/src/Cockpit/cockpit.cxx b/src/Cockpit/cockpit.cxx index 79b071802..f8e822b3f 100644 --- a/src/Cockpit/cockpit.cxx +++ b/src/Cockpit/cockpit.cxx @@ -45,6 +45,7 @@ #include #include
#include
+#include
#include #include