]> git.mxchange.org Git - flightgear.git/commitdiff
Removed configuration option --with-old-mouse and FG_OLD_MOUSE macro.
authordavid <david>
Sun, 12 May 2002 00:12:19 +0000 (00:12 +0000)
committerdavid <david>
Sun, 12 May 2002 00:12:19 +0000 (00:12 +0000)
Removed configuration option --with-new-environment and
FG_NEW_ENVIRONMENT macro.

Added configuration option --with-weathercm and FG_WEATHERCM macro.

FGEnvironment is now the default; use --with-weathercm to get the old
weather.

acconfig.h
src/ATC/approach.cxx
src/ATC/atis.cxx
src/FDM/Balloon/BalloonSim.cpp
src/Input/input.cxx
src/Main/Makefile.am
src/Main/fg_init.cxx
src/Main/fg_props.cxx
src/Main/main.cxx
src/Main/options.cxx
src/Makefile.am

index 33bc604f49788fbde9753ada5d51f3e0b87bb2d9..5bdfd0d11a31d4b570bbd0d5f16d71978f61bb36 100644 (file)
 /* Define to include Oliver's networking support */
 #undef FG_NETWORK_OLK
    
-/* Define to avoid Christian's new weather code */
-#undef FG_NEW_ENVIRONMENT
+/* Define to use Christian's old weather code */
+#undef FG_WEATHERCM
 
 /* Define to enable new Plib joystick features (post 1.4) */
 #undef FG_PLIB_JOYSTICK_GETNAME
 
-/* Define to use old mouse support */
-#undef FG_OLD_MOUSE
-   
 /* Define if we are building FGFS (should always be defined) */
 #undef FGFS
    
index 5c2e6431f555a9844616c8df33e8c4a5e286ecd0..d5faedd130053ae40da5ed2f3cf4b0c6b629a39e 100644 (file)
 
 #include <simgear/misc/sg_path.hxx>
 
-#ifdef FG_NEW_ENVIRONMENT
-#include <Environment/environment_mgr.hxx>
-#include <Environment/environment.hxx>
+#ifdef FG_WEATHERCM
+# include <WeatherCM/FGLocalWeatherDatabase.h>
 #else
-#include <WeatherCM/FGLocalWeatherDatabase.h>
+# include <Environment/environment_mgr.hxx>
+# include <Environment/environment.hxx>
 #endif
 
 //Constructor
@@ -189,12 +189,12 @@ void FGApproach::Update() {
 // ============================================================================
 void FGApproach::get_active_runway() {
 
-#ifdef FG_NEW_ENVIRONMENT
-  FGEnvironment stationweather =
-    globals->get_environment_mgr()->getEnvironment(lat, lon, elev);
-#else
+#ifdef FG_WEATHERCM
   sgVec3 position = { lat, lon, elev };
   FGPhysicalProperty stationweather = WeatherDatabase->get(position);
+#else
+  FGEnvironment stationweather =
+    globals->get_environment_mgr()->getEnvironment(lat, lon, elev);
 #endif
 
   SGPath path( globals->get_fg_root() );
@@ -203,9 +203,7 @@ void FGApproach::get_active_runway() {
   FGRunways runways( path.c_str() );
   
   //Set the heading to into the wind
-#ifdef FG_NEW_ENVIRONMENT
-  double hdg = stationweather.get_wind_from_heading_deg();
-#else
+#ifdef FG_WEATHERCM
   double wind_x = stationweather.Wind[0];
   double wind_y = stationweather.Wind[1];
   
@@ -223,6 +221,8 @@ void FGApproach::get_active_runway() {
     if (hdg < 0.0)
       hdg += 360.0;
   }
+#else
+  double hdg = stationweather.get_wind_from_heading_deg();
 #endif
   
   FGRunway runway;
index 67b378e67fc63dcc09a6dafb9c09e24e1e3892be..eb2f392097037b49b20095a1a2a09b629631a2d2 100644 (file)
@@ -40,11 +40,11 @@ SG_USING_STD(cout);
 //#include <simgear/misc/sgstream.hxx>
 #include <simgear/misc/sg_path.hxx>
 
-#ifdef FG_NEW_ENVIRONMENT
+#ifdef FG_WEATHERCM
+# include <WeatherCM/FGLocalWeatherDatabase.h>
+#else
 # include <Environment/environment_mgr.hxx>
 # include <Environment/environment.hxx>
-#else
-# include <WeatherCM/FGLocalWeatherDatabase.h>
 #endif
 
 #include <Main/fg_props.hxx>
@@ -143,12 +143,12 @@ void FGATIS::UpdateTransmission() {
     int hours;
     // int minutes;
 
-#ifdef FG_NEW_ENVIRONMENT
-    FGEnvironment stationweather =
-      globals->get_environment_mgr()->getEnvironment(lat, lon, elev);
-#else
+#ifdef FG_WEATHERCM
     sgVec3 position = { lat, lon, elev };
     FGPhysicalProperty stationweather = WeatherDatabase->get(position);
+#else
+    FGEnvironment stationweather =
+      globals->get_environment_mgr()->getEnvironment(lat, lon, elev);
 #endif
 
     transmission = "";
@@ -177,10 +177,10 @@ void FGATIS::UpdateTransmission() {
     // Get the temperature
     // (Hardwire it for now since the global property returns the temperature at the current altitude
     //temperature = fgGetDouble("/environment/weather/temperature-K");
-#ifdef FG_NEW_ENVIRONMENT
-    sprintf(buf, "%i", int(stationweather.get_temperature_degc()));
-#else
+#ifdef FG_WEATHERCM
     sprintf(buf, "%i", int(stationweather.Temperature - 273.15));
+#else
+    sprintf(buf, "%i", int(stationweather.get_temperature_degc()));
 #endif
     transmission += "  Temperature ";
     transmission += buf;
@@ -190,10 +190,10 @@ void FGATIS::UpdateTransmission() {
         // pressure is: stationweather.AirPressure in Pascal
 
        // Get the visibility
-#ifdef FG_NEW_ENVIRONMENT
-        visibility = stationweather.get_visibility_m();
-#else
+#ifdef FG_WEATHERCM
        visibility = fgGetDouble("/environment/visibility-m");
+#else
+        visibility = stationweather.get_visibility_m();
 #endif
        sprintf(buf, "%i", int(visibility/1600));
        transmission += "  Visibility ";
@@ -217,18 +217,7 @@ void FGATIS::UpdateTransmission() {
        path.append( "runways.mk4" );
        FGRunways runways( path.c_str() );
 
-#ifdef FG_NEW_ENVIRONMENT
-       double speed = stationweather.get_wind_speed_kt();
-       double hdg = stationweather.get_wind_from_heading_deg();
-       if (speed == 0) {
-         transmission += "  Winds light and variable";
-       } else {
-                               // FIXME: get gust factor in somehow
-           char buf2[72];
-           sprintf(buf2, "%s %i %s %i %s", "  Winds ", int(speed),
-                   " knots from ", int(hdg), " degrees");
-       }
-#else
+#ifdef FG_WEATHERCM
        //Set the heading to into the wind
         double wind_x = stationweather.Wind[0];
         double wind_y = stationweather.Wind[1];
@@ -253,6 +242,17 @@ void FGATIS::UpdateTransmission() {
            sprintf(buf2, "%s %i %s %i %s", "  Winds ", int(speed), " knots from ", int(hdg), " degrees");
            transmission += buf2;
        }
+#else
+       double speed = stationweather.get_wind_speed_kt();
+       double hdg = stationweather.get_wind_from_heading_deg();
+       if (speed == 0) {
+         transmission += "  Winds light and variable";
+       } else {
+                               // FIXME: get gust factor in somehow
+           char buf2[72];
+           sprintf(buf2, "%s %i %s %i %s", "  Winds ", int(speed),
+                   " knots from ", int(hdg), " degrees");
+       }
 #endif
 
        string rwy_no = runways.search(ident, int(hdg));
index a60bb9d56a2057c0f43a6751ee7dc802aa21ba3e..0fc4982c0343b4cec0a3d53eb31028f12c3a9517 100644 (file)
@@ -169,7 +169,7 @@ void balloon::update()
     /* later, but currently was my main concern to get it going...          */
     /************************************************************************/
 
-#ifndef FG_NEW_ENVIRONMENT
+#ifdef FG_WEATHERCM
     sgVec3 v;
 
     FGPhysicalProperty wdbpos = WeatherDatabase->get(position);
@@ -226,7 +226,7 @@ void balloon::update()
     sgVec3 fTotal, fFriction, fLift;
 
     sgScaleVec3(fTotal, gravity_vector, mTotal);
-#ifndef FG_NEW_ENVIRONMENT
+#ifdef FG_WEATHERCM
     sgScaleVec3(fFriction, v, cw_envelope * wind_facing_area_of_balloon * WeatherDatabase->getAirDensity(position) * speed / 2.0);  //wind resistance
     sgScaleVec3(fLift, gravity_vector, -balloon_envelope_volume * wdbpos.AirPressure / (287.14 * wdbpos.Temperature));
 #endif
index f7ce15856d5cc0f87aa20c18555817ebbf2d40cd..0ee0ebbdf651657622e0d03e27d4c248d2b6975d 100644 (file)
@@ -197,11 +197,9 @@ FGInput::init ()
   glutKeyboardUpFunc(GLUTkeyup);
   glutSpecialFunc(GLUTspecialkey);
   glutSpecialUpFunc(GLUTspecialkeyup);
-#ifndef FG_OLD_MOUSE
   glutMouseFunc (GLUTmouse);
   glutMotionFunc (GLUTmotion);
   glutPassiveMotionFunc (GLUTmotion);
-#endif
 }
 
 void
index 27ba8c0a4b7b0591a7341e43b04fd2eeee78b82e..f21c5cc669b8dfb06822050c24bd9015feac0fc4 100644 (file)
@@ -4,10 +4,10 @@ else
 SERIAL_LIBS =
 endif
 
-if ENABLE_NEW_ENVIRONMENT
-WEATHER_LIBS = $(top_builddir)/src/Environment/libEnvironment.a
-else
+if ENABLE_WEATHERCM
 WEATHER_LIBS = $(top_builddir)/src/WeatherCM/libWeatherCM.a
+else
+WEATHER_LIBS = $(top_builddir)/src/Environment/libEnvironment.a
 endif
 
 if ENABLE_NETWORK_OLK
index 229fe271895bd7783cd5b6d139febc582aaac27f..7ec9eaa977487ae9370d6830a49d6dd7256fefda 100644 (file)
 #include <Time/moonpos.hxx>
 #include <Time/tmp.hxx>
 
-#ifndef FG_NEW_ENVIRONMENT
+#ifdef FG_WEATHERCM
 #  include <WeatherCM/FGLocalWeatherDatabase.h>
 #else
 #  include <Environment/environment_mgr.hxx>
@@ -842,7 +842,7 @@ bool fgInitSubsystems( void ) {
     ////////////////////////////////////////////////////////////////////
 
     // Initialize the weather modeling subsystem
-#ifndef FG_NEW_ENVIRONMENT
+#ifdef FG_WEATHERCM
     // Initialize the WeatherDatabase
     SG_LOG(SG_GENERAL, SG_INFO, "Creating LocalWeatherDatabase");
     sgVec3 position;
index 2b55d705dce85c2908b4538dda17ca8214292470..c3b9ebdb3d7584b0723e97ef68ffe57c56b83bab 100644 (file)
 #include <Aircraft/aircraft.hxx>
 #include <Time/tmp.hxx>
 #include <FDM/UIUCModel/uiuc_aircraftdir.h>
-#ifndef FG_NEW_ENVIRONMENT
+#ifdef FG_WEATHERCM
 #  include <WeatherCM/FGLocalWeatherDatabase.h>
 #else
 #  include <Environment/environment.hxx>
-#endif // FG_NEW_ENVIRONMENT
+#endif // FG_WEATHERCM
 #include <Objects/matlib.hxx>
 
 #include <GUI/gui.h>
@@ -53,11 +53,11 @@ SG_USING_STD(istream);
 SG_USING_STD(ostream);
 #endif
 
-#if !defined(FG_NEW_ENVIRONMENT)
+#ifdef FG_WEATHERCM
 static double getWindNorth ();
 static double getWindEast ();
 static double getWindDown ();
-#endif // FG_NEW_ENVIRONMENT
+#endif // FG_WEATHERCM
 
 static bool winding_ccw = true; // FIXME: temporary
 
@@ -401,7 +401,7 @@ getHeadingMag ()
 }
 
 
-#if !defined(FG_NEW_ENVIRONMENT)
+#ifdef FG_WEATHERCM
 
 /**
  * Get the current visibility (meters).
@@ -487,7 +487,7 @@ setWindDown (double speed)
                                                           speed);
 }
 
-#endif // FG_NEW_ENVIRONMENT
+#endif // FG_WEATHERCM
 
 static long
 getWarp ()
@@ -590,7 +590,7 @@ fgInitProps ()
   fgTie("/orientation/heading-magnetic-deg", getHeadingMag);
 
                                // Environment
-#if !defined(FG_NEW_ENVIRONMENT)
+#ifdef FG_WEATHERCM
   fgTie("/environment/visibility-m", getVisibility, setVisibility);
   fgSetArchivable("/environment/visibility-m");
   fgTie("/environment/wind-from-north-fps", getWindNorth, setWindNorth);
index 5a4b3716ce081c8e634b8e10f610269b70bbe5ef..9880c31fa8ddc6414b175758b827f928ffeed905 100644 (file)
@@ -151,7 +151,7 @@ float scene_farplane = 120000.0f;
 static double delta_time_sec = 0;
 
 
-#ifndef FG_NEW_ENVIRONMENT
+#ifdef FG_WEATHERCM
 #  include <WeatherCM/FGLocalWeatherDatabase.h>
 #else
 #  include <Environment/environment_mgr.hxx>
@@ -885,8 +885,8 @@ static void fgMainLoop( void ) {
     // init routine and we don't have to worry about it again.
 #endif
 
-#ifdef FG_NEW_ENVIRONMENT
-    globals->get_environment_mgr()->update(0); // FIXME: use real delta time
+#ifndef FG_WEATHERCM
+    globals->get_environment_mgr()->update(delta_time_sec);
 #endif
 
     // Fix elevation.  I'm just sticking this here for now, it should
@@ -1300,13 +1300,6 @@ int fgGlutInitEvents( void ) {
 
     // keyboard and mouse callbacks are set in FGInput::init
 
-#ifdef FG_OLD_MOUSE
-    // call guiMouseFunc() whenever our little rodent is used
-    glutMouseFunc ( guiMouseFunc );
-    glutMotionFunc (guiMotionFunc );
-    glutPassiveMotionFunc (guiMotionFunc );
-#endif
-
     // call fgMainLoop() whenever there is
     // nothing else to do
     glutIdleFunc( fgIdleFunction );
@@ -1344,7 +1337,7 @@ int mainLoop( int argc, char **argv ) {
 
     globals = new FGGlobals;
 
-#if defined(FG_NEW_ENVIRONMENT)
+#ifndef FG_WEATHERCM
     globals->set_environment_mgr(new FGEnvironmentMgr);
 #endif
 
index ac662f47afcfc3064f4bfc21ab9481aadd940031..a8a6c46484435a6632a5d2f365ca783df9ed7bd5 100644 (file)
@@ -908,7 +908,7 @@ parse_option (const string& arg)
        fgSetDouble("/environment/wind-from-heading-deg", dir);
        fgSetDouble("/environment/wind-speed-kt", speed);
 
-#if !defined (FG_NEW_ENVIRONMENT)
+#ifdef FG_WEATHERCM
         // convert to fps
        speed *= SG_NM_TO_METER * SG_METER_TO_FEET * (1.0/3600);
        while (dir > 360)
@@ -920,7 +920,7 @@ parse_option (const string& arg)
                    speed * cos(dir));
        fgSetDouble("/environment/wind-from-east-fps",
                    speed * sin(dir));
-#endif // FG_NEW_ENVIRONMENT
+#endif // FG_WEATHERCM
     } else if ( arg.find( "--wp=" ) == 0 ) {
        parse_wp( arg.substr( 5 ) );
     } else if ( arg.find( "--flight-plan=") == 0) {
index 86c9491f019f92e864d3189d447cd773dad834bc..c943eafd4ad40600567f7937b17a7994085aa9b0 100644 (file)
@@ -1,7 +1,7 @@
-if ENABLE_NEW_ENVIRONMENT
-WEATHER_DIR = Environment
-else
+if ENABLE_WEATHERCM
 WEATHER_DIR = WeatherCM
+else
+WEATHER_DIR = Environment
 endif
 
 if ENABLE_NETWORK_OLK