]> git.mxchange.org Git - flightgear.git/blobdiff - src/Airports/airport.cxx
Interim windows build fix
[flightgear.git] / src / Airports / airport.cxx
index 56cdaf139c7019ca77e0d3507dc097a3f65419dc..f284fb55ad50bc38874416311814665192ba10df 100644 (file)
@@ -46,8 +46,9 @@
 #include <Main/fg_props.hxx>
 #include <Airports/runways.hxx>
 #include <Airports/pavement.hxx>
-#include <Airports/dynamics.hxx>
 #include <Airports/xmlloader.hxx>
+#include <Airports/dynamics.hxx>
+#include <Airports/airportdynamicsmanager.hxx>
 #include <Navaids/procedure.hxx>
 #include <Navaids/waypoint.hxx>
 #include <ATC/CommStation.hxx>
@@ -74,7 +75,6 @@ FGAirport::FGAirport( PositionedID aGuid,
     FGPositioned(aGuid, aType, id, location),
     _name(name),
     _has_metar(has_metar),
-    _dynamics(0),
     mTowerDataLoaded(false),
     mHasTower(false),
     mRunwaysLoaded(false),
@@ -90,7 +90,6 @@ FGAirport::FGAirport( PositionedID aGuid,
 
 FGAirport::~FGAirport()
 {
-    delete _dynamics;
 }
 
 bool FGAirport::isAirport() const
@@ -117,23 +116,6 @@ bool FGAirport::isAirportType(FGPositioned* pos)
     return (pos->type() >= AIRPORT) && (pos->type() <= SEAPORT);
 }
 
-FGAirportDynamics * FGAirport::getDynamics()
-{
-    if (_dynamics) {
-        return _dynamics;
-    }
-    
-    _dynamics = new FGAirportDynamics(this);
-    XMLLoader::load(_dynamics);
-    _dynamics->init();
-  
-    FGRunwayPreference rwyPrefs(this);
-    XMLLoader::load(&rwyPrefs);
-    _dynamics->setRwyUse(rwyPrefs);
-    
-    return _dynamics;
-}
-
 //------------------------------------------------------------------------------
 unsigned int FGAirport::numRunways() const
 {
@@ -982,6 +964,11 @@ void FGAirport::sortBySize(FGPositionedList& airportList)
     }
 }
 
+FGAirportDynamicsRef FGAirport::getDynamics() const
+{
+    return flightgear::AirportDynamicsManager::find(const_cast<FGAirport*>(this));
+}
+
 // get airport elevation
 double fgGetAirportElev( const std::string& id )
 {