]> git.mxchange.org Git - flightgear.git/commitdiff
Christian's new weather subsystem is causing problems with some compilers
authorcurt <curt>
Thu, 12 Aug 1999 17:13:44 +0000 (17:13 +0000)
committercurt <curt>
Thu, 12 Aug 1999 17:13:44 +0000 (17:13 +0000)
so I am allowing it to be #ifdef'd out until the compile problems can be
resolved.

acconfig.h
src/Main/Makefile.am
src/Main/fg_init.cxx
src/Main/keyboard.cxx
src/Main/main.cxx
src/Scenery/tilemgr.cxx

index ab88dd6e60ba89eaa65c70002c73d7c2ac13b8fd..bcdaae9907c6236a7df5117dff54f8e861d4a99b 100644 (file)
@@ -61,6 +61,9 @@
 /* Define to include Oliver's networking support */
 #undef FG_NETWORK_OLK
    
+/* Define to include Oliver's networking support */
+#undef FG_NEW_WEATHER
+   
 /* Define if we are building FGFS (should always be defined) */
 #undef FGFS
    
index 9eb5892fd3b91eef4328f04019cf2d3783b58af0..2ab5caf197744c2c54380bce001de96b2956b62c 100644 (file)
@@ -4,6 +4,14 @@ else
 SERIAL_LIBS =
 endif
 
+if ENABLE_NEW_WEATHER
+WEATHER_LIBS = $(top_builddir)/Simulator/WeatherCM/libWeatherCM.a \
+               $(top_builddir)/Lib/Voronoi/libVoronoi.a
+else
+WEATHER_LIBS = $(top_builddir)/Simulator/Weather/libWeather.a
+endif
+
+
 CPPFLAGS += -DPKGLIBDIR=\"$(pkglibdir)\"
 
 EXTRA_DIST = 3dfx.sh runfgfs.in runfgfs.bat.in
@@ -38,8 +46,7 @@ fgfs_LDADD = \
         $(top_builddir)/Simulator/Network/libNetwork.a \
        $(top_builddir)/Simulator/Objects/libObjects.a \
        $(top_builddir)/Simulator/Time/libTime.a \
-       $(top_builddir)/Simulator/Weather/libWeather.a \
-       $(top_builddir)/Simulator/WeatherCM/libWeatherCM.a \
+       $(WEATHER_LIBS) \
        $(top_builddir)/Simulator/Joystick/libJoystick.a \
        $(SERIAL_LIBS) \
        $(top_builddir)/Lib/Math/libMath.a \
index 646e18b2deb2518bb4e1802b8f7458e457a82464..2c9124f29e26656d55c607a04707d9ec5a853f63 100644 (file)
 #include <Time/light.hxx>
 #include <Time/sunpos.hxx>
 #include <Time/moonpos.hxx>
-// #include <Weather/weather.hxx>
-#include <WeatherCM/FGLocalWeatherDatabase.h>
+
+#ifdef FG_NEW_WEATHER
+#  include <WeatherCM/FGLocalWeatherDatabase.h>
+#else
+#  include <Weather/weather.hxx>
+#endif
 
 #include "fg_init.hxx"
 #include "options.hxx"
@@ -406,7 +410,7 @@ bool fgInitSubsystems( void ) {
                            fgEVENT::FG_EVENT_READY, 30000 );
 
     // Initialize the weather modeling subsystem
-    // current_weather.Init();
+#ifdef FG_NEW_WEATHER
     // Initialize the WeatherDatabase
     FG_LOG(FG_GENERAL, FG_INFO, "Creating LocalWeatherDatabase");
     FGLocalWeatherDatabase::theFGLocalWeatherDatabase = 
@@ -421,6 +425,9 @@ bool fgInitSubsystems( void ) {
     // register the periodic update of the weather
     global_events.Register( "weather update", fgUpdateWeatherDatabase,
                            fgEVENT::FG_EVENT_READY, 30000);
+#else
+    current_weather.Init();
+#endif
 
     // Initialize the Cockpit subsystem
     if( fgCockpitInit( &current_aircraft )) {
index 04c3bcb52ed1fef70b45639869fa32dfef9c2c71..7fcb9aa2c7889fd9a0c3f0742387100558c3c3da 100644 (file)
 #include <Objects/materialmgr.hxx>
 #include <Time/fg_time.hxx>
 #include <Time/light.hxx>
-// #include <Weather/weather.hxx>
-#include <WeatherCM/FGLocalWeatherDatabase.h>
+
+#ifdef FG_NEW_WEATHER
+#  include <WeatherCM/FGLocalWeatherDatabase.h>
+#else
+#  include <Weather/weather.hxx>
+#endif
 
 #include "keyboard.hxx"
 #include "options.hxx"
@@ -77,7 +81,6 @@ void GLUTkey(unsigned char k, int x, int y) {
     FGInterface *f;
     FGTime *t;
     FGView *v;
-    // FGWeather *w;
     float fov, tmp;
     static bool winding_ccw = true;
     int speed;
@@ -85,7 +88,6 @@ void GLUTkey(unsigned char k, int x, int y) {
     f = current_aircraft.fdm_state;
     t = FGTime::cur_time_params;
     v = &current_view;
-    // w = &current_weather;
 
     FG_LOG( FG_INPUT, FG_DEBUG, "Key hit = " << k );
     if ( puKeyboard(k, PU_DOWN) ) {
@@ -187,12 +189,15 @@ void GLUTkey(unsigned char k, int x, int y) {
            v->force_update_fov_math();
            return;
        case 90: // Z key
-           // tmp = w->get_visibility();   // in meters
-           // tmp /= 1.10;
-           // w->set_visibility( tmp );
+#ifdef FG_NEW_WEATHER
            tmp = WeatherDatabase->getWeatherVisibility();
            tmp /= 1.10;
            WeatherDatabase->setWeatherVisibility( tmp );
+#else
+           tmp = current_weather.get_visibility();   // in meters
+           tmp /= 1.10;
+           current_weather.set_visibility( tmp );
+#endif
            return;
        }
     } else {
@@ -308,12 +313,15 @@ void GLUTkey(unsigned char k, int x, int y) {
            v->force_update_fov_math();
            return;
        case 122: // z key
-           // tmp = w->get_visibility();   // in meters
-           // tmp *= 1.10;
-           // w->set_visibility( tmp );
+#ifdef FG_NEW_WEATHER
            tmp = WeatherDatabase->getWeatherVisibility();
            tmp *= 1.10;
            WeatherDatabase->setWeatherVisibility( tmp );
+#else
+           tmp = current_weather.get_visibility();   // in meters
+           tmp *= 1.10;
+           current_weather.set_visibility( tmp );
+#endif
            return;
        case 27: // ESC
            // if( fg_DebugOutput ) {
index 5c7f7ad888c3d2b40e84d10632bbba0402378fb2..fb670beb2be9357ecc531be7f01d5f02a6e675a4 100644 (file)
 #include <Time/fg_time.hxx>
 #include <Time/fg_timer.hxx>
 #include <Time/sunpos.hxx>
-// #include <Weather/weather.hxx>
-// #include <WeatherCM/FGLocalWeatherDatabase.h>
+
+#ifndef FG_NEW_WEATHER
+#  include <Weather/weather.hxx>
+#endif
 
 #include "fg_init.hxx"
 #include "keyboard.hxx"
@@ -371,10 +373,8 @@ static void fgRenderFrame( void ) {
        //         << current_weather.get_visibility() );
            
        if ( agl > 10.0 ) {
-           // ssgSetNearFar( 10.0f, current_weather.get_visibility() );
            ssgSetNearFar( 10.0f, 100000.0f );
        } else {
-           // ssgSetNearFar( 0.5f, current_weather.get_visibility() );
            ssgSetNearFar( 0.5f, 100000.0f );
        }
 
@@ -568,7 +568,9 @@ static void fgMainLoop( void ) {
     // init routine and we don't have to worry about it again.
 #endif
 
-    // current_weather.Update();
+#ifndef FG_NEW_WEATHER
+    current_weather.Update();
+#endif
 
     // Fix elevation.  I'm just sticking this here for now, it should
     // probably move eventually
index 88bf6eb83dc10fe0489360b1d61441b0ab9e9fd9..c81e4b96da65299567fa49f30803da9dd84816cd 100644 (file)
 #include <Math/vector.hxx>
 #include <Objects/materialmgr.hxx>
 #include <Objects/obj.hxx>
-// #include <Weather/weather.hxx>
-#include <WeatherCM/FGLocalWeatherDatabase.h>
+
+#ifdef FG_NEW_WEATHER
+#  include <WeatherCM/FGLocalWeatherDatabase.h>
+#else
+#  include <Weather/weather.hxx>
+#endif
 
 #include "scenery.hxx"
 #include "tilecache.hxx"
@@ -689,11 +693,12 @@ void FGTileMgr::prep_ssg_nodes( void ) {
        if ( t->is_loaded() ) {
            // set range selector (LOD trick) to be distance to center
            // of tile + bounding radius
-           /*
-            * ranges[1] = current_weather.get_visibility()+t->bounding_radius;
-            */
+#ifdef FG_NEW_WEATHER
            ranges[1] = WeatherDatabase->getWeatherVisibility()
                + t->bounding_radius;
+#else
+           ranges[1] = current_weather.get_visibility()+t->bounding_radius;
+#endif
            t->range_ptr->setRanges( ranges, 2 );
 
            // calculate tile offset