]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/UIUCModel/uiuc_wrapper.cpp
Updated Cameron's entry.
[flightgear.git] / src / FDM / UIUCModel / uiuc_wrapper.cpp
index b9efe9a77961d758523af8d409ee3d3c9865dc74..1fa2b40e62e6673770160c2f481abe5275e4a2e5 100644 (file)
 **********************************************************************/
 
 #include <simgear/compiler.h>
+#include <simgear/misc/sg_path.hxx>
 #include <Aircraft/aircraft.hxx>
-
-#ifndef FG_OLD_WEATHER
-#include <WeatherCM/FGLocalWeatherDatabase.h>
-#else
-#include <Weather/weather.hxx>
-#endif
+#include <Main/fg_props.hxx>
 
 #include "uiuc_aircraft.h"
 #include "uiuc_aircraftdir.h"
@@ -171,15 +167,12 @@ void uiuc_vel_init ()
 
 void uiuc_init_aeromodel ()
 {
-  string aircraft;
-
-  if (aircraft_dir != (string)"")
-    aircraft = aircraft_dir + "/";
-
-  aircraft += "aircraft.dat";
-  cout << "We are using "<< aircraft << endl;
+  SGPath path(globals->get_fg_root());
+  path.append(aircraft_dir);
+  path.append("aircraft.dat");
+  cout << "We are using "<< path.str() << endl;
   uiuc_initializemaps(); // Initialize the <string,int> maps
-  uiuc_menu(aircraft);   // Read the specified aircraft file 
+  uiuc_menu(path.str());   // Read the specified aircraft file 
 }
 
 void uiuc_force_moment(double dt)
@@ -224,21 +217,12 @@ void uiuc_force_moment(double dt)
    double vis;
    if (Fog != 0)
    {
- #ifndef FG_OLD_WEATHER
-     vis = WeatherDatabase->getWeatherVisibility();
-     if (Fog > 0)
-       vis /= 1.01;
-     else
-       vis *= 1.01;
-     WeatherDatabase->setWeatherVisibility( vis );
- #else
-     vis = current_weather->get_visibility();
+     vis = fgGetDouble("/environment/visibility-m");
      if (Fog > 0)
        vis /= 1.01;
      else
        vis *= 1.01;
-     current_weather->set_visibility( vis );
- #endif
+     fgSetDouble("/environment/visibility-m", vis);
    }