Add a property to be able to turn the bump-mapped cloud code on and off at runtime.
This commit is contained in:
parent
8beb280625
commit
14d28907dd
2 changed files with 16 additions and 5 deletions
|
@ -1587,6 +1587,10 @@ bool fgInitSubsystems() {
|
|||
|
||||
globals->add_subsystem("lighting", new FGLight);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Initialize the 2D cloud subsystem.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
fgGetNode("/sim/rendering/bump-mapping", true);
|
||||
|
||||
#ifdef FG_USE_CLOUDS_3D
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -331,7 +331,7 @@ void trRenderFrame( void ) {
|
|||
// and update the stencil buffer with 1
|
||||
glEnable( GL_STENCIL_TEST );
|
||||
glStencilFunc( GL_ALWAYS, 1, 1 );
|
||||
glStencilOp( GL_REPLACE, GL_REPLACE, GL_REPLACE );
|
||||
glStencilOp( GL_KEEP, GL_KEEP, GL_REPLACE );
|
||||
}
|
||||
FGTileMgr::set_tile_filter( false );
|
||||
sgSetModelFilter( true );
|
||||
|
@ -701,7 +701,7 @@ void fgRenderFrame() {
|
|||
// and update the stencil buffer with 1
|
||||
glEnable( GL_STENCIL_TEST );
|
||||
glStencilFunc( GL_ALWAYS, 1, 1 );
|
||||
glStencilOp( GL_REPLACE, GL_REPLACE, GL_REPLACE );
|
||||
glStencilOp( GL_KEEP, GL_KEEP, GL_REPLACE );
|
||||
}
|
||||
FGTileMgr::set_tile_filter( false );
|
||||
sgSetModelFilter( true );
|
||||
|
@ -1018,6 +1018,8 @@ static void fgMainLoop( void ) {
|
|||
// static const SGPropertyNode *replay_master
|
||||
// = fgGetNode("/sim/freeze/replay", true);
|
||||
|
||||
SGCloudLayer::enable_bump_mapping = fgGetBool("/sim/rendering/bump-mapping",true);
|
||||
|
||||
// Update the elapsed time.
|
||||
static bool first_time = true;
|
||||
if ( first_time ) {
|
||||
|
@ -1770,8 +1772,13 @@ bool fgMainInit( int argc, char **argv ) {
|
|||
// build our custom render states
|
||||
fgBuildRenderStates();
|
||||
|
||||
try {
|
||||
// pass control off to the master event handler
|
||||
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,
|
||||
// etc.
|
||||
|
|
Loading…
Add table
Reference in a new issue