From 8e5eed90d5e469b13494802acee9c340714843ba Mon Sep 17 00:00:00 2001 From: ehofman Date: Sat, 25 Jun 2005 11:21:18 +0000 Subject: [PATCH] Remove the 'old' 3D clouds code. --- configure.ac | 4 --- src/Main/Makefile.am | 7 ----- src/Main/fg_init.cxx | 44 ------------------------------- src/Main/options.cxx | 6 ++--- src/Main/renderer.cxx | 60 ------------------------------------------- 5 files changed, 2 insertions(+), 119 deletions(-) diff --git a/configure.ac b/configure.ac index b843d6c82..ee44e701d 100644 --- a/configure.ac +++ b/configure.ac @@ -97,10 +97,6 @@ fi dnl Used by JSBSim to conditionally compile in fgfs interface code AC_DEFINE([FGFS], 1, [Define so that JSBSim compiles in 'library' mode]) -dnl Used to control whether clouds3d should be compiled in or not -AC_DEFINE([FG_USE_CLOUDS_3D], 1, [Define to use 3D cloud support]) -AM_CONDITIONAL(FG_USE_CLOUDS_3D, test "x" = "x") - # Check for MS Windows environment AC_CHECK_HEADER(windows.h) diff --git a/src/Main/Makefile.am b/src/Main/Makefile.am index 13a3b43c0..bf8c092ad 100644 --- a/src/Main/Makefile.am +++ b/src/Main/Makefile.am @@ -25,12 +25,6 @@ else GFX_CODE = fg_os.cxx fg_os.hxx endif -if FG_USE_CLOUDS_3D -CLOUD3D_LIBS = -lsgclouds3d -else -CLOUD3D_LIBS = -endif - AM_CXXFLAGS = -DPKGLIBDIR=\"$(pkgdatadir)\" bin_PROGRAMS = fgfs metar @@ -94,7 +88,6 @@ fgfs_LDADD = \ $(top_builddir)/src/Time/libTime.a \ $(top_builddir)/src/Traffic/libTraffic.a \ $(top_builddir)/src/Environment/libEnvironment.a \ - $(CLOUD3D_LIBS) \ -lsgroute -lsgsky -lsgsound -lsgephem -lsgmaterial -lsgtgdb -lsgmodel \ -lsgtiming -lsgio -lsgscreen -lsgmath -lsgbucket -lsgprops -lsgdebug \ -lsgmagvar -lsgmisc -lsgnasal -lsgxml -lsgsound -lsgserial \ diff --git a/src/Main/fg_init.cxx b/src/Main/fg_init.cxx index fc67ee815..b2e26d21e 100644 --- a/src/Main/fg_init.cxx +++ b/src/Main/fg_init.cxx @@ -60,11 +60,6 @@ #include #include #include -#ifdef FG_USE_CLOUDS_3D -# include -# include -# include -#endif #include #include @@ -147,11 +142,6 @@ extern const char *default_root; float init_volume; -#ifdef FG_USE_CLOUDS_3D - SkySceneLoader *sgCloud3d; -#endif - - // Scan the command line options for the specified option and return // the value. static string fgScanForOption( const string& option, int argc, char **argv ) { @@ -1638,40 +1628,6 @@ bool fgInitSubsystems() { //////////////////////////////////////////////////////////////////// fgGetBool("/sim/rendering/bump-mapping", false); -#ifdef FG_USE_CLOUDS_3D - //////////////////////////////////////////////////////////////////// - // Initialize the 3D cloud subsystem. - //////////////////////////////////////////////////////////////////// - if ( fgGetBool("/sim/rendering/clouds3d") ) { - static const SGPropertyNode *longitude - = fgGetNode("/sim/presets/longitude-deg"); - static const SGPropertyNode *latitude - = fgGetNode("/sim/presets/latitude-deg"); - // static const SGPropertyNode *altitude - // = fgGetNode("/sim/presets/altitude-ft"); - - SGPath cloud_path(globals->get_fg_root()); -#if 0 - cloud_path.append("Textures/Sky/scattered.rgba"); - SG_LOG(SG_GENERAL, SG_INFO, "Loading CLOUDS3d from: " << cloud_path.c_str()); - - SGTexture tx; - tx.read_rgba_texture(cloud_path.c_str()); - if ( !sgCloud3d->Load( tx.texture(), tx.width(), -#else - cloud_path.append("large.sky"); - if ( !sgCloud3d->Load( cloud_path.str(), -#endif - latitude->getDoubleValue(), - longitude->getDoubleValue()) ) - { - fgSetBool("/sim/rendering/clouds3d", false); - SG_LOG(SG_GENERAL, SG_INFO, "CLOUDS3d FAILED: "); - } - SG_LOG(SG_GENERAL, SG_INFO, "CLOUDS3d Loaded: "); - } -#endif - #ifdef ENABLE_AUDIO_SUPPORT //////////////////////////////////////////////////////////////////// // Initialize the sound subsystem. diff --git a/src/Main/options.cxx b/src/Main/options.cxx index c1e5ae46d..f6de4c80d 100644 --- a/src/Main/options.cxx +++ b/src/Main/options.cxx @@ -1258,10 +1258,8 @@ struct OptionDesc { {"enable-specular-highlight", false, OPTION_BOOL, "/sim/rendering/specular-highlight", true, "", 0 }, {"disable-clouds", false, OPTION_BOOL, "/environment/clouds/status", false, "", 0 }, {"enable-clouds", false, OPTION_BOOL, "/environment/clouds/status", true, "", 0 }, -#ifdef FG_USE_CLOUDS_3D - {"disable-clouds3d", false, OPTION_BOOL, "/sim/rendering/clouds3d", false, "", 0 }, - {"enable-clouds3d", false, OPTION_BOOL, "/sim/rendering/clouds3d", true, "", 0 }, -#endif + {"disable-clouds3d", false, OPTION_BOOL, "/sim/rendering/clouds3d-enable", false, "", 0 }, + {"enable-clouds3d", false, OPTION_BOOL, "/sim/rendering/clouds3d-enable", true, "", 0 }, {"fov", true, OPTION_FUNC, "", false, "", fgOptFov }, {"aspect-ratio-multiplier", true, OPTION_DOUBLE, "/sim/current-view/aspect-ratio-multiplier", false, "", 0 }, {"disable-fullscreen", false, OPTION_BOOL, "/sim/startup/fullscreen", false, "", 0 }, diff --git a/src/Main/renderer.cxx b/src/Main/renderer.cxx index 571298607..9742c34b2 100644 --- a/src/Main/renderer.cxx +++ b/src/Main/renderer.cxx @@ -49,10 +49,6 @@ #include #endif -#ifdef FG_USE_CLOUDS_3D -# include -# include -#endif #include #include @@ -105,11 +101,6 @@ static GLfloat ground_exp2_punch_through; // Sky structures SGSky *thesky; -#ifdef FG_USE_CLOUDS_3D - SkySceneLoader *sgClouds3d; - bool _bcloud_orig = true; -#endif - // hack sgMat4 copy_of_ssgOpenGLAxisSwapMatrix = { @@ -327,27 +318,6 @@ FGRenderer::update( bool refresh_camera_settings ) { ssgSetCamera( (sgVec4 *)current__view->get_VIEW() ); } - if ( fgGetBool("/sim/rendering/clouds3d") ) { - glClear( GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT ); - cloud3d_imposter_state->force(); - glDisable( GL_FOG ); - glColor4f( 1.0, 1.0, 1.0, 1.0 ); - glEnable(GL_DEPTH_TEST); - glEnable(GL_BLEND); - glBlendFunc( GL_ONE, GL_ONE_MINUS_SRC_ALPHA ) ; - -#ifdef FG_USE_CLOUDS_3D - if ( _bcloud_orig ) { - Point3D c = globals->get_scenery()->get_center(); - sgClouds3d->Set_Cloud_Orig( &c ); - _bcloud_orig = false; - } - sgClouds3d->Update( current__view->get_absolute_view_pos() ); -#endif - glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ) ; - glDisable(GL_DEPTH_TEST); - } - clear_mask = GL_DEPTH_BUFFER_BIT; if ( fgGetBool("/sim/rendering/wireframe") ) { clear_mask |= GL_COLOR_BUFFER_BIT; @@ -679,32 +649,6 @@ FGRenderer::update( bool refresh_camera_settings ) { ssgCullAndDraw( globals->get_scenery()->get_gnd_lights_root() ); } - if ( draw_otw && fgGetBool("/sim/rendering/clouds3d") ) { - glDisable( GL_FOG ); - glDisable( GL_LIGHTING ); - // cout << "drawing new clouds" << endl; - - glEnable(GL_DEPTH_TEST); - glEnable(GL_BLEND); - glBlendFunc( GL_ONE, GL_ONE_MINUS_SRC_ALPHA ) ; - - /* - glEnable( GL_TEXTURE_2D ); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - */ - -#ifdef FG_USE_CLOUDS_3D - sgClouds3d->Draw((sgVec4 *)current__view->get_VIEW()); -#endif - glEnable( GL_FOG ); - glEnable( GL_LIGHTING ); - glEnable( GL_DEPTH_TEST ); - glBlendFunc ( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ) ; - } - sgEnviro.drawLightning(); if ( draw_otw && draw_clouds ) { @@ -827,10 +771,6 @@ FGRenderer::resize( int width, int height ) { // << ", " << viewmgr->get_current_view()->get_v_fov() << ")" // << endl; -#ifdef FG_USE_CLOUDS_3D - sgClouds3d->Resize( viewmgr->get_current_view()->get_h_fov(), - viewmgr->get_current_view()->get_v_fov() ); -#endif } fgHUDReshape(); -- 2.39.5