From 2a9f87e42c5d20ab729347bd8aa4a9484159170f Mon Sep 17 00:00:00 2001 From: ThorstenB Date: Sat, 21 May 2011 17:12:37 +0200 Subject: [PATCH] Fixed blocked splash-screen on sim reset Fixes Commit 9a3fb418e4a358b65135d1e6d05d870cfc584b55 --- src/Main/renderer.cxx | 6 ++---- src/Main/renderer.hxx | 3 +-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/Main/renderer.cxx b/src/Main/renderer.cxx index b57c4f53e..7b6c710c6 100644 --- a/src/Main/renderer.cxx +++ b/src/Main/renderer.cxx @@ -390,7 +390,6 @@ FGRenderer::FGRenderer() jpgRenderFrame = FGRenderer::update; #endif eventHandler = new FGEventHandler; - _splash_screen_active = true; } FGRenderer::~FGRenderer() @@ -428,6 +427,7 @@ FGRenderer::init( void ) _xsize = fgGetNode("/sim/startup/xsize", true); _ysize = fgGetNode("/sim/startup/ysize", true); + _splash_alpha = fgGetNode("/sim/startup/splash-alpha", true); _skyblend = fgGetNode("/sim/rendering/skyblend", true); _point_sprites = fgGetNode("/sim/rendering/point-sprites", true); @@ -599,12 +599,11 @@ FGRenderer::update( bool refresh_camera_settings ) { { // alas, first "update" is being called before "init"... fgSetDouble("/sim/startup/splash-alpha", 1.0); - _splash_screen_active = true; return; } osgViewer::Viewer* viewer = globals->get_renderer()->getViewer(); - if (_splash_screen_active) + if (_splash_alpha->getDoubleValue()>0.0) { // Fade out the splash screen const double fade_time = 0.8; @@ -615,7 +614,6 @@ FGRenderer::update( bool refresh_camera_settings ) { double sAlpha = fgGetDouble("/sim/startup/splash-alpha", 1.0); sAlpha -= SGMiscd::max(0.0,delay_time/fade_time); FGScenerySwitchCallback::scenery_enabled = (sAlpha<1.0); - _splash_screen_active = (sAlpha > 0.0); fgSetDouble("/sim/startup/splash-alpha", sAlpha); } diff --git a/src/Main/renderer.hxx b/src/Main/renderer.hxx index 42198b9f2..54a69a151 100644 --- a/src/Main/renderer.hxx +++ b/src/Main/renderer.hxx @@ -79,7 +79,7 @@ protected: osg::ref_ptr viewer; osg::ref_ptr eventHandler; SGPropertyNode_ptr _scenery_loaded,_scenery_override; - SGPropertyNode_ptr _skyblend; + SGPropertyNode_ptr _skyblend, _splash_alpha; SGPropertyNode_ptr _point_sprites, _enhanced_lighting, _distance_attenuation; SGPropertyNode_ptr _textures; SGPropertyNode_ptr _cloud_status, _visibility_m; @@ -87,7 +87,6 @@ protected: SGPropertyNode_ptr _panel_hotspots, _sim_delta_sec, _horizon_effect, _altitude_ft; SGPropertyNode_ptr _virtual_cockpit; SGTimeStamp _splash_time; - bool _splash_screen_active; }; bool fgDumpSceneGraphToFile(const char* filename);