X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FFDM%2FJSBSim%2FFGFDMExec.cpp;h=ed10e6986e958f6a090e0456c3b5d4559672481e;hb=b6520485ca65fdf0d9e75c2353bac76cbcee79ce;hp=32359bb3c256befc175262b930331c7efabcb082;hpb=9c0925744d27363955b3f26caf3311bc0a91ea69;p=flightgear.git diff --git a/src/FDM/JSBSim/FGFDMExec.cpp b/src/FDM/JSBSim/FGFDMExec.cpp index 32359bb3c..ed10e6986 100644 --- a/src/FDM/JSBSim/FGFDMExec.cpp +++ b/src/FDM/JSBSim/FGFDMExec.cpp @@ -43,9 +43,9 @@ INCLUDES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #ifdef FGFS +# include # include # include STL_IOSTREAM -# include # include STL_ITERATOR #else # include @@ -364,14 +364,26 @@ bool FGFDMExec::LoadModel(string APath, string EPath, string model) { bool result = false; + string aircraftCfgFileName; + + AircraftPath = APath; + EnginePath = EPath; + +# ifndef macintosh + aircraftCfgFileName = AircraftPath + "/" + model + "/" + model + ".xml"; +# else + aircraftCfgFileName = AircraftPath + ";" + model + ";" + model + ".xml"; +# endif + + FGConfigFile AC_cfg(aircraftCfgFileName); + if (!AC_cfg.IsOpen()) return false; + if (modelLoaded) { DeAllocate(); Allocate(); } - AircraftPath = APath; - EnginePath = EPath; - result = Aircraft->LoadAircraft(AircraftPath, EnginePath, model); + result = Aircraft->Load(&AC_cfg); if (result) { modelLoaded = true;