From 312626c5f01a4491765ec696a387a10ee13a0c7c Mon Sep 17 00:00:00 2001 From: curt Date: Fri, 7 Jul 2000 21:52:45 +0000 Subject: [PATCH] Hopefully final time cleanups. --- src/Main/bfi.cxx | 2 +- src/Main/main.cxx | 12 ++++++------ src/Main/options.cxx | 14 +++++++------- src/Main/options.hxx | 17 +++++++++++++---- 4 files changed, 27 insertions(+), 18 deletions(-) diff --git a/src/Main/bfi.cxx b/src/Main/bfi.cxx index c0a06a987..180edc244 100644 --- a/src/Main/bfi.cxx +++ b/src/Main/bfi.cxx @@ -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() ); diff --git a/src/Main/main.cxx b/src/Main/main.cxx index 638bf612f..fb71bb98c 100644 --- a/src/Main/main.cxx +++ b/src/Main/main.cxx @@ -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 ); diff --git a/src/Main/options.cxx b/src/Main/options.cxx index 6e2ee313a..321d134dc 100644 --- a/src/Main/options.cxx +++ b/src/Main/options.cxx @@ -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; diff --git a/src/Main/options.hxx b/src/Main/options.hxx index 90d02ad84..185f89b69 100644 --- a/src/Main/options.hxx +++ b/src/Main/options.hxx @@ -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() { -- 2.39.5