t->update( cur_fdm_state->get_Longitude(),
cur_fdm_state->get_Latitude(),
- cur_fdm_state->get_Altitude()* FEET_TO_METER,
globals->get_warp() );
if ( globals->get_warp_delta() != 0 ) {
guiInit();
// Initialize time
- SGTime *t = new SGTime( current_options.get_fg_root() );
- t->init( 0.0, 0.0, current_options.get_fg_root() );
+ FGPath zone( current_options.get_fg_root() );
+ zone.append( "Timezone" );
+ SGTime *t = new SGTime( zone.str() );
+ t->init( 0.0, 0.0, zone.str() );
// Handle potential user specified time offsets
time_t cur_time = t->get_cur_time();
- time_t currGMT = t->get_gmt( gmtime(&cur_time) );
- time_t systemLocalTime = t->get_gmt( localtime(&cur_time) );
+ time_t currGMT = sgTimeGetGMT( gmtime(&cur_time) );
+ time_t systemLocalTime = sgTimeGetGMT( localtime(&cur_time) );
time_t aircraftLocalTime =
- t->get_gmt( fgLocaltime(&cur_time, t->get_zonename() ) );
+ sgTimeGetGMT( fgLocaltime(&cur_time, t->get_zonename() ) );
// Okay, we now have six possible scenarios
switch ( current_options.get_time_offset_type() ) {
globals->set_warp_delta( 0 );
- t->update( 0.0, 0.0, 0.0, globals->get_warp() );
+ t->update( 0.0, 0.0, globals->get_warp() );
globals->set_time_params( t );
num[i] = '\0';
gmt.tm_sec = atoi(num);
}
- time_t theTime = globals->get_time_params()->get_gmt(gmt.tm_year,
- gmt.tm_mon,
- gmt.tm_mday,
- gmt.tm_hour,
- gmt.tm_min,
- gmt.tm_sec);
+ time_t theTime = sgTimeGetGMT( gmt.tm_year, gmt.tm_mon, gmt.tm_mday,
+ gmt.tm_hour, gmt.tm_min, gmt.tm_sec );
//printf ("Date is %s\n", ctime(&theTime));
//printf ("in seconds that is %d\n", theTime);
//exit(1);
# include <config.h>
#endif
+#include <simgear/misc/fgpath.hxx>
#include <simgear/magvar/magvar.hxx>
#include <FDM/flight.hxx>
// periodic time updater wrapper
void fgUpdateLocalTime() {
+ FGPath zone( current_options.get_fg_root() );
+ zone.append( "Timezone" );
globals->get_time_params()->updateLocal( cur_fdm_state->get_Longitude(),
cur_fdm_state->get_Latitude(),
- current_options.get_fg_root() );
+ zone.str() );
}