]> git.mxchange.org Git - flightgear.git/blobdiff - src/Main/main.cxx
Make sound audiable not until after the scenery is loaded.
[flightgear.git] / src / Main / main.cxx
index 0d43799a6dc33adee1bc5ed70861ac01c14cdff5..41511d62a53da545f9f1e5520f129189b4bfd221 100644 (file)
 
 #include <Include/general.hxx>
 #include <Cockpit/cockpit.hxx>
-#include <Cockpit/radiostack.hxx>
 #include <Cockpit/hud.hxx>
 #include <Model/panelnode.hxx>
 #include <Model/modelmgr.hxx>
 #include <Model/acmodel.hxx>
 #include <Scenery/scenery.hxx>
 #include <Scenery/tilemgr.hxx>
+#include <Sound/beacon.hxx>
+#include <Sound/morse.hxx>
 #include <FDM/flight.hxx>
 #include <FDM/UIUCModel/uiuc_aircraftdir.h>
 // #include <FDM/ADA.hxx>
@@ -95,6 +96,7 @@
 
 static double real_delta_time_sec = 0.0;
 double delta_time_sec = 0.0;
+extern float init_volume;
 
 
 #ifdef macintosh
@@ -184,8 +186,6 @@ void fgUpdateTimeDepCalcs() {
                                   globals->get_time_params()->getLst(),
                                   cur_fdm_state->get_Latitude() );
 
-    // Update radio stack model
-    current_radiostack->update(delta_time_sec);
 }
 
 
@@ -551,6 +551,8 @@ static void fgMainLoop( void ) {
 
     if (!scenery_loaded && globals->get_tile_mgr()->all_queues_empty() && cur_fdm_state->get_inited()) {
         fgSetBool("sim/sceneryloaded",true);
+        fgSetFloat("/sim/sound/volume", init_volume);
+        globals->get_soundmgr()->set_volume(init_volume);
     }
 
     if (fgGetBool("/sim/rendering/specular-highlight")) {
@@ -578,8 +580,6 @@ static void fgIdleFunction ( void ) {
     // printf("idle state == %d\n", idle_state);
 
     if ( idle_state == 0 ) {
-        fgSetBool("sim/initialised", false);
-
         // Initialize the splash screen right away
         if ( fgGetBool("/sim/startup/splash-screen") ) {
             fgSplashInit(fgGetString("/sim/startup/splash-texture"));
@@ -663,7 +663,6 @@ static void fgIdleFunction ( void ) {
     if ( idle_state == 1000 ) {
         // We've finished all our initialization steps, from now on we
         // run the main loop.
-        fgSetBool("sim/initialised",true);
         fgSetBool("sim/sceneryloaded",false);
 
         fgRegisterIdleHandler(fgMainLoop);