]> git.mxchange.org Git - flightgear.git/commitdiff
More tidying up of SGTime.
authorcurt <curt>
Fri, 7 Jul 2000 23:56:43 +0000 (23:56 +0000)
committercurt <curt>
Fri, 7 Jul 2000 23:56:43 +0000 (23:56 +0000)
src/Main/bfi.cxx
src/Main/main.cxx
src/Main/options.cxx
src/Time/tmp.cxx

index 180edc244577d004d712f085a40f57ef7ffab55c..1c0be117489796421c763e898d807a1176df4bc8 100644 (file)
@@ -397,8 +397,6 @@ FGBFI::setTimeGMT (time_t time)
                                    current_options.get_fg_root() );
   globals->get_time_params()->update( cur_fdm_state->get_Longitude(),
                                      cur_fdm_state->get_Latitude(),
-                                     cur_fdm_state->get_Altitude()
-                                     * FEET_TO_METER,
                                      globals->get_warp() );
   needReinit();
 }
index fb71bb98c809562b133701ee9e9e4248f1571a73..1a93b585d71bb33783efbacb3a1161e5c5f9699d 100644 (file)
@@ -798,7 +798,6 @@ static void fgMainLoop( void ) {
 
     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 ) {
@@ -1310,15 +1309,17 @@ int main( int argc, char **argv ) {
     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() ) {
@@ -1355,7 +1356,7 @@ int main( int argc, char **argv ) {
 
     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 );
 
index 321d134dc8f5666ed3f7f6a3a948b540c52ea2fa..15f4851c28207e791eafbc8a65b9a38b1a90d1ff 100644 (file)
@@ -433,12 +433,8 @@ long int fgOPTIONS::parse_date( const string& date)
        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);
index 988a5f3b315ff0a2a9d23feaeaa9906d395b1b05..5d7ff2d347a4b591ceac890e24ceeeb935973922 100644 (file)
@@ -25,6 +25,7 @@
 #  include <config.h>
 #endif
 
+#include <simgear/misc/fgpath.hxx>
 #include <simgear/magvar/magvar.hxx>
 
 #include <FDM/flight.hxx>
@@ -57,10 +58,12 @@ FGMagVar cur_magvar;
 
 // 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() );
 }