]> git.mxchange.org Git - flightgear.git/blobdiff - src/Main/renderer.cxx
Merge branch 'next' of D:\Git_New\flightgear into next
[flightgear.git] / src / Main / renderer.cxx
index 32d7953380b417271fbedd5aead6ba626d1ae3df..e16fb3d55821780a91715002edfe7ae047e45481 100644 (file)
@@ -57,7 +57,6 @@
 #include <osgDB/WriteFile>
 
 #include <simgear/math/SGMath.hxx>
-#include <simgear/screen/extensions.hxx>
 #include <simgear/scene/material/matlib.hxx>
 #include <simgear/scene/model/animation.hxx>
 #include <simgear/scene/model/placement.hxx>
 
 #include <Time/light.hxx>
 #include <Time/light.hxx>
-#include <Aircraft/aircraft.hxx>
 #include <Cockpit/panel.hxx>
-#include <Cockpit/cockpit.hxx>
-#include <Cockpit/hud.hxx>
 #include <Model/panelnode.hxx>
 #include <Model/modelmgr.hxx>
 #include <Model/acmodel.hxx>
 #include <Scenery/redout.hxx>
 #include <Scenery/tilemgr.hxx>
 #include <GUI/new_gui.hxx>
-#include <Instrumentation/instrument_mgr.hxx>
 #include <Instrumentation/HUD/HUD.hxx>
 #include <Environment/precipitation_mgr.hxx>
 
-#include <Include/general.hxx>
 #include "splash.hxx"
 #include "renderer.hxx"
 #include "main.hxx"
 #include "CameraGroup.hxx"
 #include "FGEventHandler.hxx"
 #include <Main/viewer.hxx>
+#include <Main/viewmgr.hxx>
 
 using namespace osg;
 using namespace simgear;
@@ -210,10 +205,7 @@ public:
     glPushAttrib(GL_ALL_ATTRIB_BITS);
     glPushClientAttrib(~0u);
 
-    fgCockpitUpdate(&state);
-
-    FGInstrumentMgr *instr = static_cast<FGInstrumentMgr*>(globals->get_subsystem("instrumentation"));
-    HUD *hud = static_cast<HUD*>(instr->get_subsystem("hud"));
+    HUD *hud = static_cast<HUD*>(globals->get_subsystem("hud"));
     hud->draw(state);
 
     // update the panel subsystem
@@ -565,16 +557,12 @@ FGRenderer::init( void )
 // Update all Visuals (redraws anything graphics related)
 void
 FGRenderer::update( bool refresh_camera_settings ) {
-    bool scenery_loaded = fgGetBool("sim/sceneryloaded")
+    bool scenery_loaded = fgGetBool("sim/sceneryloaded", false)
                           || fgGetBool("sim/sceneryloaded-override");
     osgViewer::Viewer* viewer = globals->get_renderer()->getViewer();
-    if ( idle_state < 1000 || !scenery_loaded ) {
-        fgSetDouble("/sim/startup/splash-alpha", 1.0);
-
-        // Keep resetting sim time while the sim is initializing
-        // the splash screen is now in the scenegraph
-        globals->set_sim_time_sec( 0.0 );
-        return;
+    if (!scenery_loaded) {
+      fgSetDouble("/sim/startup/splash-alpha", 1.0);
+      return;
     }
 
     // Fade out the splash screen over the first three seconds.
@@ -630,9 +618,8 @@ FGRenderer::update( bool refresh_camera_settings ) {
     double visibility_meters = fgGetDouble("/environment/visibility-m");
     thesky->set_visibility(visibility_meters);
 
-    thesky->modify_vis( cur_fdm_state->get_Altitude() * SG_FEET_TO_METER,
-                        ( global_multi_loop * fgGetInt("/sim/speed-up") )
-                        / (double)fgGetInt("/sim/model-hz") );
+    double altitude_m = fgGetDouble("/position/altitude-ft") * SG_FEET_TO_METER;
+    thesky->modify_vis( altitude_m, 0.0 /* time factor, now unused */);
 
     // update the sky dome
     if ( skyblend ) {
@@ -674,30 +661,12 @@ FGRenderer::update( bool refresh_camera_settings ) {
         scolor.cloud_color = SGVec3f(l->cloud_color().data());
         scolor.sun_angle   = l->get_sun_angle();
         scolor.moon_angle  = l->get_moon_angle();
-
+  
+        double delta_time_sec = fgGetDouble("/sim/time/delta-sec");
         thesky->reposition( sstate, *globals->get_ephem(), delta_time_sec );
         thesky->repaint( scolor, *globals->get_ephem() );
 
-        /*
-        SG_LOG( SG_GENERAL, SG_BULK,
-                "thesky->reposition( view_pos = " << view_pos[0] << " "
-         << view_pos[1] << " " << view_pos[2] );
-        SG_LOG( SG_GENERAL, SG_BULK,
-                "    zero_elev = " << zero_elev[0] << " "
-         << zero_elev[1] << " " << zero_elev[2]
-         << " lon = " << cur_fdm_state->get_Longitude()
-         << " lat = " << cur_fdm_state->get_Latitude() );
-        SG_LOG( SG_GENERAL, SG_BULK,
-                "    sun_rot = " << l->get_sun_rotation
-         << " gst = " << SGTime::cur_time_params->getGst() );
-        SG_LOG( SG_GENERAL, SG_BULK,
-             "    sun ra = " << globals->get_ephem()->getSunRightAscension()
-          << " sun dec = " << globals->get_ephem()->getSunDeclination()
-          << " moon ra = " << globals->get_ephem()->getMoonRightAscension()
-          << " moon dec = " << globals->get_ephem()->getMoonDeclination() );
-        */
-
-        //OSGFIXME
+            //OSGFIXME
 //         shadows->setupShadows(
 //           current__view->getLongitude_deg(),
 //           current__view->getLatitude_deg(),