1
0
Fork 0

Make use of the new SGPath::add() function and automatically append 'Terren' and 'Objects' the the scenery path when one or both of those subdirectories exsist.

This commit is contained in:
ehofman 2004-06-07 09:52:11 +00:00
parent 1bdcbd69f3
commit 079890e955
3 changed files with 34 additions and 9 deletions

View file

@ -117,6 +117,38 @@ void FGGlobals::set_fg_root (const string &root) {
} }
} }
void FGGlobals::set_fg_scenery (const string &scenery) {
if (scenery.empty())
return;
SGPath pt( scenery ), po( scenery );
pt.append("Terrain");
po.append("Objects");
cout << "pt: " << pt.str() << endl;
cout << "po: " << po.str() << endl;
ulDir *td = ulOpenDir(pt.c_str());
ulDir *od = ulOpenDir(po.c_str());
if (td == NULL) {
if (od == NULL) {
fg_scenery = scenery;
} else {
fg_scenery = po.str();
ulCloseDir(od);
}
} else {
if (od != NULL) {
pt.add(po.str());
ulCloseDir(od);
}
fg_scenery = pt.str();
ulCloseDir(td);
}
cout << "fg_scenery: " << fg_scenery << endl;
}
SGSubsystemMgr * SGSubsystemMgr *
FGGlobals::get_subsystem_mgr () const FGGlobals::get_subsystem_mgr () const

View file

@ -237,9 +237,7 @@ public:
void set_fg_root (const string &root); void set_fg_root (const string &root);
inline const string &get_fg_scenery () const { return fg_scenery; } inline const string &get_fg_scenery () const { return fg_scenery; }
inline void set_fg_scenery (const string &scenery) { void set_fg_scenery (const string &scenery);
fg_scenery = scenery;
}
#if defined(FX) && defined(XMESA) #if defined(FX) && defined(XMESA)
inline bool get_fullscreen() const { return fullscreen; } inline bool get_fullscreen() const { return fullscreen; }

View file

@ -99,12 +99,7 @@ FGTileLoader::add( FGTileEntry* tile )
SGPath tmp; SGPath tmp;
tmp.set( globals->get_fg_root() ); tmp.set( globals->get_fg_root() );
tmp.append( "Scenery/Terrain" ); tmp.append( "Scenery/Terrain" );
#ifdef _MSC_VER tmp.add(globals->get_fg_root() );
tmp.append( ";");
#else
tmp.append( ":");
#endif
tmp.append(globals->get_fg_root() );
tmp.append( "Scenery/Objects" ); tmp.append( "Scenery/Objects" );
tile_path = tmp.str(); tile_path = tmp.str();
} }