- FGRunwayPreferenceXMLLoader visitor(p);
- if (fgGetBool("/sim/traffic-manager/use-custom-scenery-data") == false) {
- SGPath rwyPrefPath( globals->get_fg_root() );
- rwyPrefPath.append( "AI/Airports/" );
- rwyPrefPath.append( p->getId() );
- rwyPrefPath.append( "rwyuse.xml" );
- if (rwyPrefPath.exists()) {
- try {
- readXML(rwyPrefPath.str(), visitor);
- }
- catch (const sg_exception &) {
- }
- }
- } else {
- string_list sc = globals->get_fg_scenery();
- char buffer[32];
- snprintf(buffer, 32, "%s.rwyuse.xml", p->getId().c_str() );
- string airportDir = expandICAODirs(p->getId());
- for (string_list_iterator i = sc.begin(); i != sc.end(); i++) {
- SGPath rwypath( *i );
- rwypath.append( "Airports" );
- rwypath.append ( airportDir );
- rwypath.append( string(buffer) );
- if (rwypath.exists()) {
- try {
- readXML(rwypath.str(), visitor);
- }
- catch (const sg_exception &) {
- }
- return;
- }
- }
- }
-}
-
-void XMLLoader::load(FGSidStar* p) {
- //FGRunwayPreferenceXMLLoader visitor(p);
- if (fgGetBool("/sim/traffic-manager/use-custom-scenery-data") == true) {
- string_list sc = globals->get_fg_scenery();
- char buffer[32];
- snprintf(buffer, 32, "%s.SID.xml", p->getId().c_str() );
- string airportDir = expandICAODirs(p->getId());
- for (string_list_iterator i = sc.begin(); i != sc.end(); i++) {
- SGPath sidpath( *i );
- sidpath.append( "Airports" );
- sidpath.append ( airportDir );
- sidpath.append( string(buffer) );
- if (sidpath.exists()) {
- try {
- //readXML(rwypath.str(), visitor);
- //cerr << "Reading SID procedure : " << sidpath.str() << endl;
- p->load(sidpath);
- }
- catch (const sg_exception &) {
- }
- return;
- }
- }
- }