Added a --visibility= option.
This commit is contained in:
parent
f37f2f73ce
commit
31b9c763df
3 changed files with 18 additions and 5 deletions
|
@ -622,13 +622,19 @@ bool fgInitSubsystems( void ) {
|
||||||
current_aircraft.fdm_state->get_Longitude(),
|
current_aircraft.fdm_state->get_Longitude(),
|
||||||
current_aircraft.fdm_state->get_Altitude() * FEET_TO_METER );
|
current_aircraft.fdm_state->get_Altitude() * FEET_TO_METER );
|
||||||
FGLocalWeatherDatabase::theFGLocalWeatherDatabase =
|
FGLocalWeatherDatabase::theFGLocalWeatherDatabase =
|
||||||
new FGLocalWeatherDatabase( position, globals->get_options()->get_fg_root() );
|
new FGLocalWeatherDatabase( position,
|
||||||
|
globals->get_options()->get_fg_root() );
|
||||||
// cout << theFGLocalWeatherDatabase << endl;
|
// cout << theFGLocalWeatherDatabase << endl;
|
||||||
// cout << "visibility = "
|
// cout << "visibility = "
|
||||||
// << theFGLocalWeatherDatabase->getWeatherVisibility() << endl;
|
// << theFGLocalWeatherDatabase->getWeatherVisibility() << endl;
|
||||||
|
|
||||||
WeatherDatabase = FGLocalWeatherDatabase::theFGLocalWeatherDatabase;
|
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
|
// register the periodic update of the weather
|
||||||
global_events.Register( "weather update", fgUpdateWeatherDatabase,
|
global_events.Register( "weather update", fgUpdateWeatherDatabase,
|
||||||
fgEVENT::FG_EVENT_READY, 30000);
|
fgEVENT::FG_EVENT_READY, 30000);
|
||||||
|
|
|
@ -190,6 +190,7 @@ FGOptions::FGOptions() :
|
||||||
bpp(16),
|
bpp(16),
|
||||||
view_mode(FG_VIEW_PILOT),
|
view_mode(FG_VIEW_PILOT),
|
||||||
default_view_offset(0),
|
default_view_offset(0),
|
||||||
|
visibility(-1.0),
|
||||||
|
|
||||||
// HUD options
|
// HUD options
|
||||||
units(FG_UNITS_FEET),
|
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_view_offset( default_view_offset );
|
||||||
pilot_view->set_goal_view_offset( default_view_offset );
|
pilot_view->set_goal_view_offset( default_view_offset );
|
||||||
// $$$ end - added VS Renganathan, 14 Oct 2K
|
// $$$ 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 ) {
|
} else if ( arg.find( "--wp=" ) != string::npos ) {
|
||||||
parse_wp( arg.substr( 5 ) );
|
parse_wp( arg.substr( 5 ) );
|
||||||
} else if ( arg.find( "--flight-plan=") != string::npos) {
|
} 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"
|
cout << "\t\tas an offset from straight ahead. Allowable values are"
|
||||||
<< endl;
|
<< endl;
|
||||||
cout << "\t\tLEFT, RIGHT, CENTER, or a specific number of degrees" << 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 << endl;
|
||||||
|
|
||||||
cout << "Scenery Options:" << endl;
|
cout << "Scenery Options:" << endl;
|
||||||
|
|
|
@ -194,6 +194,7 @@ private:
|
||||||
fgViewMode view_mode; // view mode
|
fgViewMode view_mode; // view mode
|
||||||
double default_view_offset; // default forward view offset (for use by
|
double default_view_offset; // default forward view offset (for use by
|
||||||
// multi-display configuration
|
// multi-display configuration
|
||||||
|
double visibility; // visibilty in meters
|
||||||
|
|
||||||
// HUD options
|
// HUD options
|
||||||
int units; // feet or meters
|
int units; // feet or meters
|
||||||
|
@ -296,6 +297,7 @@ public:
|
||||||
inline double get_default_view_offset() const {
|
inline double get_default_view_offset() const {
|
||||||
return default_view_offset;
|
return default_view_offset;
|
||||||
}
|
}
|
||||||
|
inline double get_default_visibility() const { return visibility; }
|
||||||
|
|
||||||
inline int get_units() const { return units; }
|
inline int get_units() const { return units; }
|
||||||
inline int get_tris_or_culled() const { return tris_or_culled; }
|
inline int get_tris_or_culled() const { return tris_or_culled; }
|
||||||
|
@ -393,9 +395,6 @@ private:
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// extern FGOptions current_options;
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* _OPTIONS_HXX */
|
#endif /* _OPTIONS_HXX */
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue