// variable $FG_ROOT if it is set.
fg_root = envp;
} else {
- // Otherwise, default to a random compiled in location if
+ // Otherwise, default to a random compiled-in location if
// $FG_ROOT is not set. This can still be overridden from the
// command line or a config file.
#endif
}
+ // set a possibly independent location for scenery data
+ envp = ::getenv( "FG_SCENERY" );
+
+ if ( envp != NULL ) {
+ // fg_root could be anywhere, so default to environmental
+ // variable $FG_ROOT if it is set.
+ fg_scenery = envp;
+ } else {
+ // Otherwise, default to Scenery being in $FG_ROOT/Scenery
+ FGPath tmp( fg_root );
+ tmp.append( "Scenery" );
+ fg_scenery = tmp.str();
+ }
+
airport_id = ""; // default airport id
net_id = "Johnney"; // default pilot's name
pitch = atof( arg.substr(8) );
} else if ( arg.find( "--fg-root=" ) != string::npos ) {
fg_root = arg.substr( 10 );
+ } else if ( arg.find( "--fg-scenery=" ) != string::npos ) {
+ fg_scenery = arg.substr( 13 );
} else if ( arg.find( "--fdm=" ) != string::npos ) {
flight_model = parse_fdm( arg.substr(6) );
if((flight_model == FGInterface::FG_JSBSIM) && (get_trim_mode() == 0)) {
cout << "\t--help -h: print usage" << endl;
cout << "\t--fg-root=path: specify the root path for all the data files"
<< endl;
+ cout << "\t--fg-scenery=path: specify the base path for all the scenery"
+ << " data." << endl
+ << "\t\tdefaults to $FG_ROOT/Scenery" << endl;
cout << "\t--disable-game-mode: disable full-screen game mode" << endl;
cout << "\t--enable-game-mode: enable full-screen game mode" << endl;
cout << "\t--disable-splash-screen: disable splash screen" << endl;
// The flight gear "root" directory
string fg_root;
+ // The scenery "root" directory
+ string fg_scenery;
+
// Starting position and orientation
string airport_id; // ID of initial starting airport
double lon; // starting longitude in degrees (west = -)
// Query functions
inline string get_fg_root() const { return fg_root; }
+ inline string get_fg_scenery() const { return fg_scenery; }
inline string get_airport_id() const { return airport_id; }
inline double get_lon() const { return lon; }
inline double get_lat() const { return lat; }
// Update functions
inline void set_fg_root (const string value) { fg_root = value; }
+ inline void set_fg_scenery (const string value) { fg_scenery = value; }
inline void set_airport_id( const string id ) { airport_id = id; }
inline void set_lon (double value) { lon = value; }
inline void set_lat (double value) { lat = value; }
tile_cache[index].range_ptr = new ssgRangeSelector;
tile_cache[index].tile_bucket = p;
- FGPath tile_path( current_options.get_fg_root() );
- tile_path.append( "Scenery" );
+ FGPath tile_path( current_options.get_fg_scenery() );
tile_path.append( p.gen_base_path() );
// Load the appropriate data file