1
0
Fork 0

Fewer static properties in the main loop, minor code tidying.

This commit is contained in:
James Turner 2011-11-04 09:40:09 +00:00
parent 23ae77cedf
commit ecced6be78

View file

@ -106,19 +106,6 @@ extern int _bootstrap_OSInit;
// for the next move and update the display? // for the next move and update the display?
static void fgMainLoop( void ) { static void fgMainLoop( void ) {
static SGConstPropertyNode_ptr longitude
= fgGetNode("/position/longitude-deg");
static SGConstPropertyNode_ptr latitude
= fgGetNode("/position/latitude-deg");
static SGConstPropertyNode_ptr altitude
= fgGetNode("/position/altitude-ft");
static SGConstPropertyNode_ptr vn_fps
= fgGetNode("/velocities/speed-north-fps");
static SGConstPropertyNode_ptr ve_fps
= fgGetNode("/velocities/speed-east-fps");
static SGConstPropertyNode_ptr vd_fps
= fgGetNode("/velocities/speed-down-fps");
static SGPropertyNode_ptr frame_signal static SGPropertyNode_ptr frame_signal
= fgGetNode("/sim/signals/frame", true); = fgGetNode("/sim/signals/frame", true);
@ -145,11 +132,7 @@ static void fgMainLoop( void ) {
timeMgr->computeTimeDeltas(sim_dt, real_dt); timeMgr->computeTimeDeltas(sim_dt, real_dt);
// update magvar model // update magvar model
globals->get_mag()->update( longitude->getDoubleValue() globals->get_mag()->update( globals->get_aircraft_position(),
* SGD_DEGREES_TO_RADIANS,
latitude->getDoubleValue()
* SGD_DEGREES_TO_RADIANS,
altitude->getDoubleValue() * SG_FEET_TO_METER,
globals->get_time_params()->getJD() ); globals->get_time_params()->getJD() );
// Run ATC subsystem // Run ATC subsystem
@ -451,12 +434,7 @@ static void fgIdleFunction ( void ) {
// (should only be done for in-flight // (should only be done for in-flight
// startup) // startup)
// update magvar model // update magvar model
globals->get_mag()->update( fgGetDouble("/position/longitude-deg") globals->get_mag()->update( globals->get_aircraft_position(),
* SGD_DEGREES_TO_RADIANS,
fgGetDouble("/position/latitude-deg")
* SGD_DEGREES_TO_RADIANS,
fgGetDouble("/position/altitude-ft")
* SG_FEET_TO_METER,
globals->get_time_params()->getJD() ); globals->get_time_params()->getJD() );
double var = globals->get_mag()->get_magvar() * SGD_RADIANS_TO_DEGREES; double var = globals->get_mag()->get_magvar() * SGD_RADIANS_TO_DEGREES;
fgSetDouble("/instrumentation/heading-indicator/offset-deg", -var); fgSetDouble("/instrumentation/heading-indicator/offset-deg", -var);