]> git.mxchange.org Git - flightgear.git/commitdiff
Initial take of new environment subsystem. Configure with
authordavid <david>
Tue, 19 Feb 2002 15:16:08 +0000 (15:16 +0000)
committerdavid <david>
Tue, 19 Feb 2002 15:16:08 +0000 (15:16 +0000)
--use-new-environment to active it.

12 files changed:
acconfig.h
src/ATC/atis.cxx
src/FDM/Balloon/BalloonSim.cpp
src/FDM/UIUCModel/uiuc_wrapper.cpp
src/Input/input.cxx
src/Main/Makefile.am
src/Main/fg_init.cxx
src/Main/fg_props.cxx
src/Main/main.cxx
src/Makefile.am
src/Scenery/tilemgr.cxx
src/Weather/weather.cxx

index dc4d593f85ad49985f78582f75c20c61e13a15d0..c69d2be8f61acc16a5cafd1448b8138174936963 100644 (file)
@@ -65,7 +65,7 @@
 #undef FG_NETWORK_OLK
    
 /* Define to avoid Christian's new weather code */
-#undef FG_OLD_WEATHER
+#undef FG_NEW_ENVIRONMENT
    
 /* Define if we are building FGFS (should always be defined) */
 #undef FGFS
index 9a07ea52f2feef25350c208dfa1bec496949a71a..cb39c09c2caea5a4298141618a14f83a60fa1d7e 100644 (file)
@@ -39,11 +39,11 @@ SG_USING_STD(cout);
 //#include <simgear/misc/sgstream.hxx>
 #include <simgear/misc/sg_path.hxx>
 
-//#ifndef FG_OLD_WEATHER
+//#ifndef FG_NEW_ENVIRONMENT
 //sorry, that works only with the new weather system
 #include <WeatherCM/FGLocalWeatherDatabase.h>
 //#else
-//#  include <Weather/weather.hxx>
+//#  include <Environment/environment.hxx>
 //#endif
 
 #include <Main/fg_props.hxx>
@@ -96,7 +96,7 @@ FGATIS::~FGATIS() {
 
 string FGATIS::get_transmission() {
 //void FGATIS::get_transmission() {
-#if !defined(FG_OLD_WEATHER)
+#if !defined(FG_NEW_ENVIRONMENT)
 
     string transmission = "";
     double visibility;
@@ -220,6 +220,6 @@ string FGATIS::get_transmission() {
 
     return(transmission);
 #else
-    return "Station unavailable (not supported by FG_OLD_WEATHER)";
-#endif // FG_OLD_WEATHER
+    return "Station unavailable (not supported by FG_NEW_ENVIRONMENT)";
+#endif // FG_NEW_ENVIRONMENT
 }
index 350298b50e9bc1ab9ab7b723a6a595f20708ff50..a60bb9d56a2057c0f43a6751ee7dc802aa21ba3e 100644 (file)
@@ -169,7 +169,7 @@ void balloon::update()
     /* later, but currently was my main concern to get it going...          */
     /************************************************************************/
 
-#ifndef FG_OLD_WEATHER
+#ifndef FG_NEW_ENVIRONMENT
     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_OLD_WEATHER
+#ifndef FG_NEW_ENVIRONMENT
     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 099298e2459b1c65f27f0de740af47df831dd555..e8308a4028870a64a6ee3c156579c7aefacb78ef 100644 (file)
 #include <simgear/misc/sg_path.hxx>
 #include <Aircraft/aircraft.hxx>
 
-#ifndef FG_OLD_WEATHER
+#ifndef FG_NEW_ENVIRONMENT
 #include <WeatherCM/FGLocalWeatherDatabase.h>
 #else
-#include <Weather/weather.hxx>
+#include <Environment/environment.hxx>
 #endif
 
 #include "uiuc_aircraft.h"
@@ -222,7 +222,7 @@ void uiuc_force_moment(double dt)
    double vis;
    if (Fog != 0)
    {
- #ifndef FG_OLD_WEATHER
+ #ifndef FG_NEW_ENVIRONMENT
      vis = WeatherDatabase->getWeatherVisibility();
      if (Fog > 0)
        vis /= 1.01;
@@ -230,12 +230,12 @@ void uiuc_force_moment(double dt)
        vis *= 1.01;
      WeatherDatabase->setWeatherVisibility( vis );
  #else
-     vis = current_weather.get_visibility_m();
+     vis = current_environment.get_visibility_m();
      if (Fog > 0)
        vis /= 1.01;
      else
        vis *= 1.01;
-     current_weather.set_visibility_m( vis );
+     current_environment.set_visibility_m( vis );
  #endif
    }
  
index 637ed9aa12503e5f99baac3fcc47dec3ba48dd64..243eacbe43ba21a5cddce9066dd016066b92eb73 100644 (file)
 #include <Cockpit/panel_io.hxx>
 #include <GUI/gui.h>
 
-#ifndef FG_OLD_WEATHER
+#ifndef FG_NEW_ENVIRONMENT
 #  include <WeatherCM/FGLocalWeatherDatabase.h>
 #else
-#  include <Weather/weather.hxx>
+#  include <Environment/environment.hxx>
 #endif
 
 #include <Main/globals.hxx>
index 35e7407a6eea5a69010008d392f16c8758710263..9044087adfcd58c00a0265c827451df9ffe49e6a 100644 (file)
@@ -4,8 +4,8 @@ else
 SERIAL_LIBS =
 endif
 
-if ENABLE_OLD_WEATHER
-WEATHER_LIBS = $(top_builddir)/src/Weather/libWeather.a
+if ENABLE_NEW_ENVIRONMENT
+WEATHER_LIBS = $(top_builddir)/src/Environment/libEnvironment.a
 else
 WEATHER_LIBS = $(top_builddir)/src/WeatherCM/libWeatherCM.a
 endif
index 8dfac625c69ac322cf8c1ff556180ecd8e623413..32754320ab6b378e60823cfdc8e6db4444622c8f 100644 (file)
 #include <Time/moonpos.hxx>
 #include <Time/tmp.hxx>
 
-#ifndef FG_OLD_WEATHER
+#ifndef FG_NEW_ENVIRONMENT
 #  include <WeatherCM/FGLocalWeatherDatabase.h>
 #else
-#  include <Weather/weather.hxx>
+#  include <Environment/environment.hxx>
 #endif
 
 #include "fg_init.hxx"
@@ -764,7 +764,7 @@ bool fgInitSubsystems( void ) {
     ////////////////////////////////////////////////////////////////////
 
     // Initialize the weather modeling subsystem
-#ifndef FG_OLD_WEATHER
+#ifndef FG_NEW_ENVIRONMENT
     // Initialize the WeatherDatabase
     SG_LOG(SG_GENERAL, SG_INFO, "Creating LocalWeatherDatabase");
     sgVec3 position;
@@ -805,8 +805,8 @@ bool fgInitSubsystems( void ) {
     global_events.Register( "weather update", fgUpdateWeatherDatabase,
                             fgEVENT::FG_EVENT_READY, 30000);
 #else
-    current_weather.init();
-    current_weather.bind();
+    current_environment.init();
+    current_environment.bind();
 #endif
 
     ////////////////////////////////////////////////////////////////////
index 816c5f543f4b664566224160c1dec0f21e1be69b..fdac0d798648d465b8e7fe27bde9151cbda946f6 100644 (file)
 #include <Aircraft/aircraft.hxx>
 #include <Time/tmp.hxx>
 #include <FDM/UIUCModel/uiuc_aircraftdir.h>
-#ifndef FG_OLD_WEATHER
+#ifndef FG_NEW_ENVIRONMENT
 #  include <WeatherCM/FGLocalWeatherDatabase.h>
 #else
-#  include <Weather/weather.hxx>
-#endif // FG_OLD_WEATHER
+#  include <Environment/environment.hxx>
+#endif // FG_NEW_ENVIRONMENT
 #include <Objects/matlib.hxx>
 
 #include <GUI/gui.h>
@@ -52,11 +52,11 @@ SG_USING_STD(istream);
 SG_USING_STD(ostream);
 #endif
 
-#if !defined(FG_OLD_WEATHER)
+#if !defined(FG_NEW_ENVIRONMENT)
 static double getWindNorth ();
 static double getWindEast ();
 static double getWindDown ();
-#endif // FG_OLD_WEATHER
+#endif // FG_NEW_ENVIRONMENT
 
 // Allow the view to be set from two axes (i.e. a joystick hat)
 // This needs to be in FGViewer itself, somehow.
@@ -890,7 +890,7 @@ setAPThrottleControl (double value)
 }
 
 
-#if !defined(FG_OLD_WEATHER)
+#if !defined(FG_NEW_ENVIRONMENT)
 
 /**
  * Get the current visibility (meters).
@@ -976,7 +976,7 @@ setWindDown (double speed)
                                                           speed);
 }
 
-#endif // FG_OLD_WEATHER
+#endif // FG_NEW_ENVIRONMENT
 
 static double
 getFOV ()
@@ -1152,7 +1152,7 @@ fgInitProps ()
   fgSetArchivable("/autopilot/control-overrides/throttle");
 
                                // Environment
-#if !defined(FG_OLD_WEATHER)
+#if !defined(FG_NEW_ENVIRONMENT)
   fgTie("/environment/visibility-m", getVisibility, setVisibility);
   fgSetArchivable("/environment/visibility-m");
   fgTie("/environment/wind-north-fps", getWindNorth, setWindNorth);
index f52d42a9074366d948d50c4cada089fe2a7c6761..2138035575944ca6970f3fc7485e913c9787999c 100644 (file)
@@ -136,10 +136,10 @@ FGTileEntry *dummy_tile;
 sgVec3 rway_ols;
 // ADA
 
-#ifndef FG_OLD_WEATHER
+#ifndef FG_NEW_ENVIRONMENT
 #  include <WeatherCM/FGLocalWeatherDatabase.h>
 #else
-#  include <Weather/weather.hxx>
+#  include <Environment/environment.hxx>
 #endif
 
 #include "version.h"
@@ -553,10 +553,10 @@ void fgRenderFrame( void ) {
        default_state->force();
 
        // update fog params if visibility has changed
-#ifndef FG_OLD_WEATHER
+#ifndef FG_NEW_ENVIRONMENT
        thesky->set_visibility( WeatherDatabase->getWeatherVisibility() );
 #else
-       thesky->set_visibility( current_weather.get_visibility_m() );
+       thesky->set_visibility( current_environment.get_visibility_m() );
 #endif
 
        thesky->modify_vis( cur_fdm_state->get_Altitude() * SG_FEET_TO_METER,
@@ -674,7 +674,7 @@ void fgRenderFrame( void ) {
            - scenery.get_cur_elev();
 
        // SG_LOG( SG_ALL, SG_INFO, "visibility is " 
-       //         << current_weather.get_visibility() );
+       //         << current_environment.get_visibility() );
            
        if ( agl > 10.0 ) {
            ssgSetNearFar( 10.0f, 120000.0f );
@@ -1042,8 +1042,8 @@ static void fgMainLoop( void ) {
     // init routine and we don't have to worry about it again.
 #endif
 
-#ifdef FG_OLD_WEATHER
-    current_weather.update(0); // FIXME: use real delta time
+#ifdef FG_NEW_ENVIRONMENT
+    current_environment.update(0);     // FIXME: use real delta time
 #endif
 
     // Fix elevation.  I'm just sticking this here for now, it should
index fe99f9d726867030fa7ecc20917f9aa7c092634a..d1a55d76f51f7e7b89a924870782c71c9e0e7837 100644 (file)
@@ -1,5 +1,5 @@
-if ENABLE_OLD_WEATHER
-WEATHER_DIR = Weather
+if ENABLE_NEW_ENVIRONMENT
+WEATHER_DIR = Environment
 else
 WEATHER_DIR = WeatherCM
 endif
index 2b07a132f024ce1fd00815e0ab75f04474c4d022..59f3c5fba60467e37cf22d265480056b82a6bfc0 100644 (file)
 #include <Main/viewer.hxx>
 #include <Objects/obj.hxx>
 
-#ifndef FG_OLD_WEATHER
+#ifndef FG_NEW_ENVIRONMENT
 #  include <WeatherCM/FGLocalWeatherDatabase.h>
 #else
-#  include <Weather/weather.hxx>
+#  include <Environment/environment.hxx>
 #endif
 
 #include "newcache.hxx"
@@ -168,14 +168,14 @@ void FGTileMgr::schedule_needed() {
    SG_LOG( SG_TERRAIN, SG_INFO,
            "scheduling needed tiles for " << longitude << " " << latitude );
 
-#ifndef FG_OLD_WEATHER
+#ifndef FG_NEW_ENVIRONMENT
     if ( WeatherDatabase != NULL ) {
        vis = WeatherDatabase->getWeatherVisibility();
     } else {
        vis = 16000;
     }
 #else
-    vis = current_weather.get_visibility_m();
+    vis = current_environment.get_visibility_m();
 #endif
     // cout << "visibility = " << vis << endl;
 
@@ -409,14 +409,14 @@ int FGTileMgr::update( double lon, double lat ) {
 void FGTileMgr::prep_ssg_nodes() {
     float vis = 0.0;
 
-#ifndef FG_OLD_WEATHER
+#ifndef FG_NEW_ENVIRONMENT
     if ( WeatherDatabase ) {
        vis = WeatherDatabase->getWeatherVisibility();
     } else {
        vis = 16000;
     }
 #else
-    vis = current_weather.get_visibility_m();
+    vis = current_environment.get_visibility_m();
 #endif
     // cout << "visibility = " << vis << endl;
 
index b6995109302bef29886a367efd3f94fd235d805a..ea4c85e061edb5246ca901821299f8ab62da7836 100644 (file)
@@ -39,7 +39,7 @@
 
 #include <Main/fg_props.hxx>
 #include <Aircraft/aircraft.hxx>
-#include <Weather/weather.hxx>
+#include <Environment/environment.hxx>
 
 
 // This is a record containing current weather info