1
0
Fork 0

Add a property to be able to turn the bump-mapped cloud code on and off at runtime.

This commit is contained in:
ehofman 2004-05-20 13:27:40 +00:00
parent 8beb280625
commit 14d28907dd
2 changed files with 16 additions and 5 deletions

View file

@ -1587,6 +1587,10 @@ bool fgInitSubsystems() {
globals->add_subsystem("lighting", new FGLight); globals->add_subsystem("lighting", new FGLight);
//////////////////////////////////////////////////////////////////////
// Initialize the 2D cloud subsystem.
////////////////////////////////////////////////////////////////////
fgGetNode("/sim/rendering/bump-mapping", true);
#ifdef FG_USE_CLOUDS_3D #ifdef FG_USE_CLOUDS_3D
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////

View file

@ -331,7 +331,7 @@ void trRenderFrame( void ) {
// and update the stencil buffer with 1 // and update the stencil buffer with 1
glEnable( GL_STENCIL_TEST ); glEnable( GL_STENCIL_TEST );
glStencilFunc( GL_ALWAYS, 1, 1 ); glStencilFunc( GL_ALWAYS, 1, 1 );
glStencilOp( GL_REPLACE, GL_REPLACE, GL_REPLACE ); glStencilOp( GL_KEEP, GL_KEEP, GL_REPLACE );
} }
FGTileMgr::set_tile_filter( false ); FGTileMgr::set_tile_filter( false );
sgSetModelFilter( true ); sgSetModelFilter( true );
@ -701,7 +701,7 @@ void fgRenderFrame() {
// and update the stencil buffer with 1 // and update the stencil buffer with 1
glEnable( GL_STENCIL_TEST ); glEnable( GL_STENCIL_TEST );
glStencilFunc( GL_ALWAYS, 1, 1 ); glStencilFunc( GL_ALWAYS, 1, 1 );
glStencilOp( GL_REPLACE, GL_REPLACE, GL_REPLACE ); glStencilOp( GL_KEEP, GL_KEEP, GL_REPLACE );
} }
FGTileMgr::set_tile_filter( false ); FGTileMgr::set_tile_filter( false );
sgSetModelFilter( true ); sgSetModelFilter( true );
@ -1018,6 +1018,8 @@ static void fgMainLoop( void ) {
// static const SGPropertyNode *replay_master // static const SGPropertyNode *replay_master
// = fgGetNode("/sim/freeze/replay", true); // = fgGetNode("/sim/freeze/replay", true);
SGCloudLayer::enable_bump_mapping = fgGetBool("/sim/rendering/bump-mapping",true);
// Update the elapsed time. // Update the elapsed time.
static bool first_time = true; static bool first_time = true;
if ( first_time ) { if ( first_time ) {
@ -1770,8 +1772,13 @@ bool fgMainInit( int argc, char **argv ) {
// build our custom render states // build our custom render states
fgBuildRenderStates(); fgBuildRenderStates();
try {
// pass control off to the master event handler // pass control off to the master event handler
fgOSMainLoop(); fgOSMainLoop();
} catch (...) {
SG_LOG( SG_ALL, SG_ALERT,
"Unknown exception in the main loop. Aborting..." );
}
// we never actually get here ... but to avoid compiler warnings, // we never actually get here ... but to avoid compiler warnings,
// etc. // etc.