X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FAirports%2Fxmlloader.cxx;h=8b35cabd5b03bab346f5df79fd9f2ec9f8a83219;hb=72131a4a4971df690ec5004977ee8eca1d0aa114;hp=b2ce07ed4b3fdbb28975f48a48685f4db96b6994;hpb=93f9b471e6f25733013144c3f277e227cc6d29a2;p=flightgear.git diff --git a/src/Airports/xmlloader.cxx b/src/Airports/xmlloader.cxx index b2ce07ed4..8b35cabd5 100644 --- a/src/Airports/xmlloader.cxx +++ b/src/Airports/xmlloader.cxx @@ -29,6 +29,7 @@ #include "runwayprefloader.hxx" #include "dynamics.hxx" +#include "simple.hxx" #include "runwayprefs.hxx" using std::string; @@ -36,53 +37,17 @@ using std::string; XMLLoader::XMLLoader() {} XMLLoader::~XMLLoader() {} -void XMLLoader::load(FGAirportDynamics* d) { +void XMLLoader::load(FGAirportDynamics* d) +{ FGAirportDynamicsXMLLoader visitor(d); - if (fgGetBool("/sim/paths/use-custom-scenery-data") == false) { - SGPath parkpath( globals->get_fg_root() ); - parkpath.append( "/AI/Airports/" ); - parkpath.append( d->getId() ); - parkpath.append( "parking.xml" ); - SG_LOG(SG_GENERAL, SG_DEBUG, "running old loader:" << parkpath.c_str()); - if (parkpath.exists()) { - try { - readXML(parkpath.str(), visitor); - d->init(); - } - catch (const sg_exception &) { - } - } - } else { - if(loadAirportXMLDataIntoVisitor(d->getId(), "groundnet", visitor)) { - d->init(); - } + if(loadAirportXMLDataIntoVisitor(d->parent()->ident(), "groundnet", visitor)) { + d->init(); } } void XMLLoader::load(FGRunwayPreference* p) { FGRunwayPreferenceXMLLoader visitor(p); - if (fgGetBool("/sim/paths/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 { - loadAirportXMLDataIntoVisitor(p->getId(), "rwyuse", visitor); - } -} - -void XMLLoader::load(FGSidStar* p) { - SGPath path; - if (findAirportData(p->getId(), "SID", path)) { - p->load(path); - } + loadAirportXMLDataIntoVisitor(p->getId(), "rwyuse", visitor); } bool XMLLoader::findAirportData(const std::string& aICAO,