]> git.mxchange.org Git - flightgear.git/commitdiff
Added a --visibility= option.
authorcurt <curt>
Wed, 6 Dec 2000 04:13:16 +0000 (04:13 +0000)
committercurt <curt>
Wed, 6 Dec 2000 04:13:16 +0000 (04:13 +0000)
src/Main/fg_init.cxx
src/Main/options.cxx
src/Main/options.hxx

index dd571f349144eae1b8e6958b4b1d5542d2e205ac..70cb8137a4a7bb0322a73978cefeb7a13e2092f2 100644 (file)
@@ -622,13 +622,19 @@ bool fgInitSubsystems( void ) {
               current_aircraft.fdm_state->get_Longitude(),
               current_aircraft.fdm_state->get_Altitude() * FEET_TO_METER );
     FGLocalWeatherDatabase::theFGLocalWeatherDatabase = 
-       new FGLocalWeatherDatabase( position, globals->get_options()->get_fg_root() );
+       new FGLocalWeatherDatabase( position,
+                                   globals->get_options()->get_fg_root() );
     // cout << theFGLocalWeatherDatabase << endl;
     // cout << "visibility = " 
     //      << theFGLocalWeatherDatabase->getWeatherVisibility() << endl;
 
     WeatherDatabase = FGLocalWeatherDatabase::theFGLocalWeatherDatabase;
-     
+    
+    double init_vis = globals->get_options()->get_default_visibility();
+    if ( init_vis > 0 ) {
+       WeatherDatabase->setWeatherVisibility( init_vis );
+    }
+
     // register the periodic update of the weather
     global_events.Register( "weather update", fgUpdateWeatherDatabase,
                             fgEVENT::FG_EVENT_READY, 30000);
index 42817c8531fbe61748f7c8060d253e0bb764572a..ff379206ac0ef4a100560e2436ac067e28a13345 100644 (file)
@@ -190,6 +190,7 @@ FGOptions::FGOptions() :
     bpp(16),
     view_mode(FG_VIEW_PILOT),
     default_view_offset(0),
+    visibility(-1.0),
 
     // HUD options
     units(FG_UNITS_FEET),
@@ -943,6 +944,10 @@ int FGOptions::parse_option( const string& arg ) {
        pilot_view->set_view_offset( default_view_offset );
        pilot_view->set_goal_view_offset( default_view_offset );
     // $$$ end - added VS Renganathan, 14 Oct 2K
+    } else if ( arg.find( "--visibility=" ) != string::npos ) {
+       visibility = atof( arg.substr( 13 ) );
+    } else if ( arg.find( "--visibility-miles=" ) != string::npos ) {
+       visibility = atof( arg.substr( 19 ) ) * 5280.0 * FEET_TO_METER;
     } else if ( arg.find( "--wp=" ) != string::npos ) {
        parse_wp( arg.substr( 5 ) );
     } else if ( arg.find( "--flight-plan=") != string::npos) {
@@ -1180,6 +1185,9 @@ void FGOptions::usage ( void ) {
     cout << "\t\tas an offset from straight ahead.  Allowable values are"
         << endl;
     cout << "\t\tLEFT, RIGHT, CENTER, or a specific number of degrees" << endl;
+    cout << "\t--visibility=xxx:  specify initial visibility in meters" << endl;
+    cout << "\t--visibility-miles=xxx:  specify initial visibility in miles"
+        << endl;
     cout << endl;
 
     cout << "Scenery Options:" << endl;
index 3905a796a19d8738ee3620cc98645659a3371ad0..3d1fac29135f9a641ff49c7c67f4c085c456f323 100644 (file)
@@ -194,6 +194,7 @@ private:
     fgViewMode view_mode; // view mode
     double default_view_offset;        // default forward view offset (for use by
                                // multi-display configuration
+    double visibility; // visibilty in meters
 
     // HUD options
     int units;         // feet or meters
@@ -296,6 +297,7 @@ public:
     inline double get_default_view_offset() const {
        return default_view_offset;
     }
+    inline double get_default_visibility() const { return visibility; }
 
     inline int get_units() const { return units; }
     inline int get_tris_or_culled() const { return tris_or_culled; }
@@ -393,9 +395,6 @@ private:
 };
 
 
-// extern FGOptions current_options;
-
-
 #endif /* _OPTIONS_HXX */