]> git.mxchange.org Git - flightgear.git/commitdiff
Fixed blocked splash-screen on sim reset
authorThorstenB <brehmt@gmail.com>
Sat, 21 May 2011 15:12:37 +0000 (17:12 +0200)
committerThorstenB <brehmt@gmail.com>
Sat, 21 May 2011 15:12:37 +0000 (17:12 +0200)
Fixes Commit 9a3fb418e4a358b65135d1e6d05d870cfc584b55

src/Main/renderer.cxx
src/Main/renderer.hxx

index b57c4f53e6e27a5e77aa433fb3930a822b7a98b9..7b6c710c66d192a39fbd673372f96a27c16cd6a6 100644 (file)
@@ -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);
     }
 
index 42198b9f2f7c3b3eab16c8f6f7bdd805eaaeccbf..54a69a1513e91c49f236c7f686ddd517ecf97f3a 100644 (file)
@@ -79,7 +79,7 @@ protected:
     osg::ref_ptr<osgViewer::Viewer> viewer;
     osg::ref_ptr<flightgear::FGEventHandler> 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);