diff --git a/src/Main/Makefile.am b/src/Main/Makefile.am index a96bcbf8c..fb8060b00 100644 --- a/src/Main/Makefile.am +++ b/src/Main/Makefile.am @@ -73,7 +73,7 @@ fgfs_LDADD = \ $(top_builddir)/src/Systems/libSystems.a \ $(top_builddir)/src/Time/libTime.a \ $(WEATHER_LIBS) \ - -lsgroute -lsgsky -lsgclouds3d -lsgephem -lsgtiming -lsgio -lsgscreen \ + -lsgroute -lsgsky -lsgephem -lsgtiming -lsgio -lsgscreen \ -lsgmath -lsgbucket -lsgdebug -lsgmagvar -lsgmisc -lsgxml \ -lsgserial \ $(THREAD_LIBS) \ diff --git a/src/Main/fg_init.cxx b/src/Main/fg_init.cxx index 790811dc4..33029768a 100644 --- a/src/Main/fg_init.cxx +++ b/src/Main/fg_init.cxx @@ -63,8 +63,10 @@ #include #include #include -#include -#include +#ifdef FG_USE_CLOUDS_3D +# include +# include +#endif #include #include @@ -139,7 +141,9 @@ SG_USING_STD(string); extern const char *default_root; -SkySceneLoader *sgCloud3d; +#ifdef FG_USE_CLOUDS_3D + SkySceneLoader *sgCloud3d; +#endif // Scan the command line options for the specified option and return @@ -1405,6 +1409,7 @@ bool fgInitSubsystems() { globals->get_environment_mgr()->bind(); #endif +#ifdef FG_USE_CLOUDS_3D //////////////////////////////////////////////////////////////////// // Initialize the 3D cloud subsystem. //////////////////////////////////////////////////////////////////// @@ -1421,6 +1426,7 @@ bool fgInitSubsystems() { } SG_LOG(SG_GENERAL, SG_INFO, "CLOUDS3d Loaded: "); } +#endif //////////////////////////////////////////////////////////////////// // Initialize vor/ndb/ils/fix list management and query systems diff --git a/src/Main/main.cxx b/src/Main/main.cxx index abb47fe1c..704e2e1ce 100644 --- a/src/Main/main.cxx +++ b/src/Main/main.cxx @@ -80,8 +80,10 @@ SG_USING_STD(endl); #include #include #include -#include -#include +#ifdef FG_USE_CLOUDS_3D +# include +# include +#endif #include #include @@ -231,8 +233,11 @@ ssgTransform *fgd_pos = NULL; // Sky structures SGSky *thesky; -SkySceneLoader *sgClouds3d; -bool _bcloud_orig = true; + +#ifdef FG_USE_CLOUDS_3D + SkySceneLoader *sgClouds3d; + bool _bcloud_orig = true; +#endif // hack sgMat4 copy_of_ssgOpenGLAxisSwapMatrix = @@ -513,20 +518,14 @@ void fgRenderFrame() { 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 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); } @@ -826,7 +825,9 @@ void fgRenderFrame() { 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 ); @@ -1377,8 +1378,12 @@ void fgReshape( int width, int height ) { viewmgr->get_current_view()->get_v_fov() ); fgHUDReshape(); + +#ifdef FG_USE_CLOUDS_3D sgClouds3d->Resize( viewmgr->get_current_view()->get_h_fov(), viewmgr->get_current_view()->get_v_fov() ); +#endif + } // Initialize GLUT and define a main window diff --git a/src/Main/options.cxx b/src/Main/options.cxx index 51d52c6a1..832410e1d 100644 --- a/src/Main/options.cxx +++ b/src/Main/options.cxx @@ -801,10 +801,12 @@ parse_option (const string& arg) fgSetBool("/environment/clouds/status", false); } else if ( arg == "--enable-clouds" ) { fgSetBool("/environment/clouds/status", true); +#ifdef FG_USE_CLOUDS_3D } else if ( arg == "--disable-clouds3d" ) { fgSetBool("/sim/rendering/clouds3d", false); } else if ( arg == "--enable-clouds3d" ) { fgSetBool("/sim/rendering/clouds3d", true); +#endif } else if ( arg.find( "--fov=" ) == 0 ) { parse_fov( arg.substr(6) ); } else if ( arg == "--disable-fullscreen" ) {