Allow FG data to be in $FG_ROOT/data or $FG_ROOT (looks in both places.)
This commit is contained in:
parent
485f799322
commit
a16d03a6cd
2 changed files with 16 additions and 1 deletions
|
@ -22,6 +22,7 @@
|
|||
|
||||
|
||||
#include <simgear/misc/commands.hxx>
|
||||
#include <simgear/misc/sg_path.hxx>
|
||||
|
||||
#include <Environment/environment_mgr.hxx>
|
||||
|
||||
|
@ -91,6 +92,20 @@ FGGlobals::~FGGlobals()
|
|||
}
|
||||
|
||||
|
||||
// set the fg_root path
|
||||
void FGGlobals::set_fg_root (const string &root) {
|
||||
fg_root = root;
|
||||
|
||||
// append /data to root if it exists
|
||||
SGPath tmp( fg_root );
|
||||
tmp.append( "data" );
|
||||
tmp.append( "version" );
|
||||
if ( ulFileExists( tmp.c_str() ) ) {
|
||||
fg_root += "/data";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
FGSubsystemMgr *
|
||||
FGGlobals::get_subsystem_mgr () const
|
||||
{
|
||||
|
|
|
@ -206,7 +206,7 @@ public:
|
|||
inline void set_sim_time_sec (double t) { sim_time_sec = t; }
|
||||
|
||||
inline const string &get_fg_root () const { return fg_root; }
|
||||
inline void set_fg_root (const string &root) { fg_root = root; }
|
||||
void set_fg_root (const string &root);
|
||||
|
||||
inline const string &get_fg_scenery () const { return fg_scenery; }
|
||||
inline void set_fg_scenery (const string &scenery) {
|
||||
|
|
Loading…
Add table
Reference in a new issue