1
0
Fork 0

Christian's new weather subsystem is causing problems with some compilers

so I am allowing it to be #ifdef'd out until the compile problems can be
resolved.
This commit is contained in:
curt 1999-08-12 17:13:44 +00:00
parent 7397860323
commit e945d2b761
6 changed files with 57 additions and 25 deletions

View file

@ -61,6 +61,9 @@
/* Define to include Oliver's networking support */ /* Define to include Oliver's networking support */
#undef FG_NETWORK_OLK #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) */ /* Define if we are building FGFS (should always be defined) */
#undef FGFS #undef FGFS

View file

@ -4,6 +4,14 @@ else
SERIAL_LIBS = SERIAL_LIBS =
endif 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)\" CPPFLAGS += -DPKGLIBDIR=\"$(pkglibdir)\"
EXTRA_DIST = 3dfx.sh runfgfs.in runfgfs.bat.in EXTRA_DIST = 3dfx.sh runfgfs.in runfgfs.bat.in
@ -38,8 +46,7 @@ fgfs_LDADD = \
$(top_builddir)/Simulator/Network/libNetwork.a \ $(top_builddir)/Simulator/Network/libNetwork.a \
$(top_builddir)/Simulator/Objects/libObjects.a \ $(top_builddir)/Simulator/Objects/libObjects.a \
$(top_builddir)/Simulator/Time/libTime.a \ $(top_builddir)/Simulator/Time/libTime.a \
$(top_builddir)/Simulator/Weather/libWeather.a \ $(WEATHER_LIBS) \
$(top_builddir)/Simulator/WeatherCM/libWeatherCM.a \
$(top_builddir)/Simulator/Joystick/libJoystick.a \ $(top_builddir)/Simulator/Joystick/libJoystick.a \
$(SERIAL_LIBS) \ $(SERIAL_LIBS) \
$(top_builddir)/Lib/Math/libMath.a \ $(top_builddir)/Lib/Math/libMath.a \

View file

@ -70,8 +70,12 @@
#include <Time/light.hxx> #include <Time/light.hxx>
#include <Time/sunpos.hxx> #include <Time/sunpos.hxx>
#include <Time/moonpos.hxx> #include <Time/moonpos.hxx>
// #include <Weather/weather.hxx>
#ifdef FG_NEW_WEATHER
# include <WeatherCM/FGLocalWeatherDatabase.h> # include <WeatherCM/FGLocalWeatherDatabase.h>
#else
# include <Weather/weather.hxx>
#endif
#include "fg_init.hxx" #include "fg_init.hxx"
#include "options.hxx" #include "options.hxx"
@ -406,7 +410,7 @@ bool fgInitSubsystems( void ) {
fgEVENT::FG_EVENT_READY, 30000 ); fgEVENT::FG_EVENT_READY, 30000 );
// Initialize the weather modeling subsystem // Initialize the weather modeling subsystem
// current_weather.Init(); #ifdef FG_NEW_WEATHER
// Initialize the WeatherDatabase // Initialize the WeatherDatabase
FG_LOG(FG_GENERAL, FG_INFO, "Creating LocalWeatherDatabase"); FG_LOG(FG_GENERAL, FG_INFO, "Creating LocalWeatherDatabase");
FGLocalWeatherDatabase::theFGLocalWeatherDatabase = FGLocalWeatherDatabase::theFGLocalWeatherDatabase =
@ -421,6 +425,9 @@ bool fgInitSubsystems( void ) {
// register the periodic update of the weather // register the periodic update of the weather
global_events.Register( "weather update", fgUpdateWeatherDatabase, global_events.Register( "weather update", fgUpdateWeatherDatabase,
fgEVENT::FG_EVENT_READY, 30000); fgEVENT::FG_EVENT_READY, 30000);
#else
current_weather.Init();
#endif
// Initialize the Cockpit subsystem // Initialize the Cockpit subsystem
if( fgCockpitInit( &current_aircraft )) { if( fgCockpitInit( &current_aircraft )) {

View file

@ -53,8 +53,12 @@
#include <Objects/materialmgr.hxx> #include <Objects/materialmgr.hxx>
#include <Time/fg_time.hxx> #include <Time/fg_time.hxx>
#include <Time/light.hxx> #include <Time/light.hxx>
// #include <Weather/weather.hxx>
#ifdef FG_NEW_WEATHER
# include <WeatherCM/FGLocalWeatherDatabase.h> # include <WeatherCM/FGLocalWeatherDatabase.h>
#else
# include <Weather/weather.hxx>
#endif
#include "keyboard.hxx" #include "keyboard.hxx"
#include "options.hxx" #include "options.hxx"
@ -77,7 +81,6 @@ void GLUTkey(unsigned char k, int x, int y) {
FGInterface *f; FGInterface *f;
FGTime *t; FGTime *t;
FGView *v; FGView *v;
// FGWeather *w;
float fov, tmp; float fov, tmp;
static bool winding_ccw = true; static bool winding_ccw = true;
int speed; int speed;
@ -85,7 +88,6 @@ void GLUTkey(unsigned char k, int x, int y) {
f = current_aircraft.fdm_state; f = current_aircraft.fdm_state;
t = FGTime::cur_time_params; t = FGTime::cur_time_params;
v = &current_view; v = &current_view;
// w = &current_weather;
FG_LOG( FG_INPUT, FG_DEBUG, "Key hit = " << k ); FG_LOG( FG_INPUT, FG_DEBUG, "Key hit = " << k );
if ( puKeyboard(k, PU_DOWN) ) { if ( puKeyboard(k, PU_DOWN) ) {
@ -187,12 +189,15 @@ void GLUTkey(unsigned char k, int x, int y) {
v->force_update_fov_math(); v->force_update_fov_math();
return; return;
case 90: // Z key case 90: // Z key
// tmp = w->get_visibility(); // in meters #ifdef FG_NEW_WEATHER
// tmp /= 1.10;
// w->set_visibility( tmp );
tmp = WeatherDatabase->getWeatherVisibility(); tmp = WeatherDatabase->getWeatherVisibility();
tmp /= 1.10; tmp /= 1.10;
WeatherDatabase->setWeatherVisibility( tmp ); WeatherDatabase->setWeatherVisibility( tmp );
#else
tmp = current_weather.get_visibility(); // in meters
tmp /= 1.10;
current_weather.set_visibility( tmp );
#endif
return; return;
} }
} else { } else {
@ -308,12 +313,15 @@ void GLUTkey(unsigned char k, int x, int y) {
v->force_update_fov_math(); v->force_update_fov_math();
return; return;
case 122: // z key case 122: // z key
// tmp = w->get_visibility(); // in meters #ifdef FG_NEW_WEATHER
// tmp *= 1.10;
// w->set_visibility( tmp );
tmp = WeatherDatabase->getWeatherVisibility(); tmp = WeatherDatabase->getWeatherVisibility();
tmp *= 1.10; tmp *= 1.10;
WeatherDatabase->setWeatherVisibility( tmp ); WeatherDatabase->setWeatherVisibility( tmp );
#else
tmp = current_weather.get_visibility(); // in meters
tmp *= 1.10;
current_weather.set_visibility( tmp );
#endif
return; return;
case 27: // ESC case 27: // ESC
// if( fg_DebugOutput ) { // if( fg_DebugOutput ) {

View file

@ -91,8 +91,10 @@
#include <Time/fg_time.hxx> #include <Time/fg_time.hxx>
#include <Time/fg_timer.hxx> #include <Time/fg_timer.hxx>
#include <Time/sunpos.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 "fg_init.hxx"
#include "keyboard.hxx" #include "keyboard.hxx"
@ -371,10 +373,8 @@ static void fgRenderFrame( void ) {
// << current_weather.get_visibility() ); // << current_weather.get_visibility() );
if ( agl > 10.0 ) { if ( agl > 10.0 ) {
// ssgSetNearFar( 10.0f, current_weather.get_visibility() );
ssgSetNearFar( 10.0f, 100000.0f ); ssgSetNearFar( 10.0f, 100000.0f );
} else { } else {
// ssgSetNearFar( 0.5f, current_weather.get_visibility() );
ssgSetNearFar( 0.5f, 100000.0f ); 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. // init routine and we don't have to worry about it again.
#endif #endif
// current_weather.Update(); #ifndef FG_NEW_WEATHER
current_weather.Update();
#endif
// Fix elevation. I'm just sticking this here for now, it should // Fix elevation. I'm just sticking this here for now, it should
// probably move eventually // probably move eventually

View file

@ -46,8 +46,12 @@
#include <Math/vector.hxx> #include <Math/vector.hxx>
#include <Objects/materialmgr.hxx> #include <Objects/materialmgr.hxx>
#include <Objects/obj.hxx> #include <Objects/obj.hxx>
// #include <Weather/weather.hxx>
#ifdef FG_NEW_WEATHER
# include <WeatherCM/FGLocalWeatherDatabase.h> # include <WeatherCM/FGLocalWeatherDatabase.h>
#else
# include <Weather/weather.hxx>
#endif
#include "scenery.hxx" #include "scenery.hxx"
#include "tilecache.hxx" #include "tilecache.hxx"
@ -689,11 +693,12 @@ void FGTileMgr::prep_ssg_nodes( void ) {
if ( t->is_loaded() ) { if ( t->is_loaded() ) {
// set range selector (LOD trick) to be distance to center // set range selector (LOD trick) to be distance to center
// of tile + bounding radius // of tile + bounding radius
/* #ifdef FG_NEW_WEATHER
* ranges[1] = current_weather.get_visibility()+t->bounding_radius;
*/
ranges[1] = WeatherDatabase->getWeatherVisibility() ranges[1] = WeatherDatabase->getWeatherVisibility()
+ t->bounding_radius; + t->bounding_radius;
#else
ranges[1] = current_weather.get_visibility()+t->bounding_radius;
#endif
t->range_ptr->setRanges( ranges, 2 ); t->range_ptr->setRanges( ranges, 2 );
// calculate tile offset // calculate tile offset