]> git.mxchange.org Git - flightgear.git/commitdiff
Hopefully final time cleanups.
authorcurt <curt>
Fri, 7 Jul 2000 21:52:45 +0000 (21:52 +0000)
committercurt <curt>
Fri, 7 Jul 2000 21:52:45 +0000 (21:52 +0000)
src/Main/bfi.cxx
src/Main/main.cxx
src/Main/options.cxx
src/Main/options.hxx

index c0a06a9871c7c1496708fcf9baaeea81b28d5cc5..180edc244577d004d712f085a40f57ef7ffab55c 100644 (file)
@@ -391,7 +391,7 @@ FGBFI::setTimeGMT (time_t time)
                                // FIXME: need to update lighting
                                // and solar system
   current_options.set_time_offset(time);
-  current_options.set_time_offset_type(SG_TIME_GMT_ABSOLUTE);
+  current_options.set_time_offset_type(fgOPTIONS::FG_TIME_GMT_ABSOLUTE);
   globals->get_time_params()->init( cur_fdm_state->get_Longitude(),
                                    cur_fdm_state->get_Latitude(),
                                    current_options.get_fg_root() );
index 638bf612ffc736f5aa755452b2f91494e42c6a85..fb71bb98c809562b133701ee9e9e4248f1571a73 100644 (file)
@@ -1322,25 +1322,25 @@ int main( int argc, char **argv ) {
 
     // Okay, we now have six possible scenarios
     switch ( current_options.get_time_offset_type() ) {
-    case SG_TIME_SYS_OFFSET:
+    case fgOPTIONS::FG_TIME_SYS_OFFSET:
        globals->set_warp( current_options.get_time_offset() );
        break;
-    case SG_TIME_GMT_OFFSET:
+    case fgOPTIONS::FG_TIME_GMT_OFFSET:
        globals->set_warp( current_options.get_time_offset() - 
                           (currGMT - systemLocalTime) );
        break;
-    case SG_TIME_LAT_OFFSET:
+    case fgOPTIONS::FG_TIME_LAT_OFFSET:
        globals->set_warp( current_options.get_time_offset() - 
                           (aircraftLocalTime - systemLocalTime) );
        break;
-    case SG_TIME_SYS_ABSOLUTE:
+    case fgOPTIONS::FG_TIME_SYS_ABSOLUTE:
        globals->set_warp( current_options.get_time_offset() - cur_time );
        //printf("warp = %d\n", warp); 
        break;
-    case SG_TIME_GMT_ABSOLUTE:
+    case fgOPTIONS::FG_TIME_GMT_ABSOLUTE:
        globals->set_warp( current_options.get_time_offset() - currGMT );
        break;
-    case SG_TIME_LAT_ABSOLUTE:
+    case fgOPTIONS::FG_TIME_LAT_ABSOLUTE:
        globals->set_warp( current_options.get_time_offset() - 
                           (aircraftLocalTime - systemLocalTime) - 
                           cur_time ); 
index 6e2ee313a875c2a1caf0d7800b3d324b0623ca5b..321d134dc8f5666ed3f7f6a3a948b540c52ea2fa 100644 (file)
@@ -201,7 +201,7 @@ fgOPTIONS::fgOPTIONS() :
     network_olk(false)
 {
     // set initial values/defaults
-    time_offset_type = SG_TIME_SYS_OFFSET;
+    time_offset_type = FG_TIME_SYS_OFFSET;
     char* envp = ::getenv( "FG_ROOT" );
 
     if ( envp != NULL ) {
@@ -774,22 +774,22 @@ int fgOPTIONS::parse_option( const string& arg ) {
        tile_diameter = tile_radius * 2 + 1;
     } else if ( arg.find( "--time-offset" ) != string::npos ) {
        time_offset = parse_time_offset( (arg.substr(14)) );
-       //time_offset_type = SG_TIME_SYS_OFFSET;
+       //time_offset_type = FG_TIME_SYS_OFFSET;
     } else if ( arg.find( "--time-match-real") != string::npos ) {
       //time_offset = parse_time_offset(arg.substr(18));
-       time_offset_type = SG_TIME_SYS_OFFSET;
+       time_offset_type = FG_TIME_SYS_OFFSET;
     } else if ( arg.find( "--time-match-local") != string::npos ) {
       //time_offset = parse_time_offset(arg.substr(18));
-       time_offset_type = SG_TIME_LAT_OFFSET;
+       time_offset_type = FG_TIME_LAT_OFFSET;
     } else if ( arg.find( "--start-date-sys=") != string::npos ) {
         time_offset = parse_date( (arg.substr(17)) );
-       time_offset_type = SG_TIME_SYS_ABSOLUTE;
+       time_offset_type = FG_TIME_SYS_ABSOLUTE;
     } else if ( arg.find( "--start-date-lat=") != string::npos ) {
         time_offset = parse_date( (arg.substr(17)) );
-       time_offset_type = SG_TIME_LAT_ABSOLUTE;
+       time_offset_type = FG_TIME_LAT_ABSOLUTE;
     } else if ( arg.find( "--start-date-gmt=") != string::npos ) {
         time_offset = parse_date( (arg.substr(17)) );
-       time_offset_type = SG_TIME_GMT_ABSOLUTE;
+       time_offset_type = FG_TIME_GMT_ABSOLUTE;
 
     } else if ( arg == "--hud-tris" ) {
        tris_or_culled = 0;     
index 90d02ad84c3ceb697719919d3a776c2e0985d3f9..185f89b69af03f71249dde4360f8d92ac008bd56 100644 (file)
@@ -114,6 +114,15 @@ public:
        FG_AUTO_COORD_ENABLED = 2
     };
 
+    enum fgTimingOffsetType {
+       FG_TIME_SYS_OFFSET   = 0,
+       FG_TIME_GMT_OFFSET   = 1,
+       FG_TIME_LAT_OFFSET   = 2,
+       FG_TIME_SYS_ABSOLUTE = 3,
+       FG_TIME_GMT_ABSOLUTE = 4,
+       FG_TIME_LAT_ABSOLUTE = 5
+    };
+
 private:
 
     // The flight gear "root" directory
@@ -186,8 +195,8 @@ private:
 
     // Time options
     int time_offset;           // Use this value to change time.
-    sgTimingOffsetType time_offset_type; // Will be set to one of the
-                               // SG_TIME_* enums, to deterine how
+    fgTimingOffsetType time_offset_type; // Will be set to one of the
+                               // FG_TIME_* enums, to deterine how
                                // time_offset should be used 
 
     // Serial port configuration strings
@@ -274,7 +283,7 @@ public:
     inline int get_tris_or_culled() const { return tris_or_culled; }
 
     inline int get_time_offset() const { return time_offset; }
-    inline sgTimingOffsetType  get_time_offset_type() const {
+    inline fgTimingOffsetType  get_time_offset_type() const {
        return time_offset_type;
     };
 
@@ -341,7 +350,7 @@ public:
     inline void set_units (int value) { units = value; }
     inline void set_tris_or_culled (int value) { tris_or_culled = value; }
     inline void set_time_offset (int value) { time_offset = value; }
-    inline void set_time_offset_type (sgTimingOffsetType value) {
+    inline void set_time_offset_type (fgTimingOffsetType value) {
        time_offset_type = value;
     }
     inline void cycle_view_mode() {