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)
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
$(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 \
#include <simgear/misc/sg_path.hxx>
#include <simgear/misc/interpolator.hxx>
#include <simgear/scene/material/matlib.hxx>
-#ifdef FG_USE_CLOUDS_3D
-# include <simgear/scene/sky/clouds3d/SkySceneLoader.hpp>
-# include <simgear/scene/sky/clouds3d/SkyUtil.hpp>
-# include <simgear/screen/texture.hxx>
-#endif
#include <simgear/timing/sg_time.hxx>
#include <simgear/timing/lowleveltime.h>
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 ) {
////////////////////////////////////////////////////////////////////
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.
{"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 },
#include <simgear/screen/jpgfactory.hxx>
#endif
-#ifdef FG_USE_CLOUDS_3D
-# include <simgear/scene/sky/clouds3d/SkySceneLoader.hpp>
-# include <simgear/scene/sky/clouds3d/SkyUtil.hpp>
-#endif
#include <simgear/environment/visual_enviro.hxx>
#include <Scenery/tileentry.hxx>
// Sky structures
SGSky *thesky;
-#ifdef FG_USE_CLOUDS_3D
- SkySceneLoader *sgClouds3d;
- bool _bcloud_orig = true;
-#endif
-
// hack
sgMat4 copy_of_ssgOpenGLAxisSwapMatrix =
{
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;
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 ) {
// << ", " << 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();