/* 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
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
$(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 \
#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"
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 =
// 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( ¤t_aircraft )) {
#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"
FGInterface *f;
FGTime *t;
FGView *v;
- // FGWeather *w;
float fov, tmp;
static bool winding_ccw = true;
int speed;
f = current_aircraft.fdm_state;
t = FGTime::cur_time_params;
v = ¤t_view;
- // w = ¤t_weather;
FG_LOG( FG_INPUT, FG_DEBUG, "Key hit = " << k );
if ( puKeyboard(k, PU_DOWN) ) {
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 {
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 ) {
#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"
// << 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 );
}
// 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
#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"
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