1
0
Fork 0

Make sound audiable not until after the scenery is loaded.

This commit is contained in:
ehofman 2004-12-16 13:19:01 +00:00
parent c09d1c92ca
commit 800dad8273
2 changed files with 6 additions and 6 deletions

View file

@ -142,8 +142,8 @@ SG_USING_STD(string);
class Sound; class Sound;
extern const char *default_root; extern const char *default_root;
float init_volume;
#ifdef FG_USE_CLOUDS_3D #ifdef FG_USE_CLOUDS_3D
@ -1654,6 +1654,8 @@ bool fgInitSubsystems() {
// Initialize the sound subsystem. // Initialize the sound subsystem.
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
init_volume = fgGetFloat("/sim/sound/volume");
fgSetFloat("/sim/sound/volume", 0.0f);
globals->set_soundmgr(new SGSoundMgr); globals->set_soundmgr(new SGSoundMgr);
globals->get_soundmgr()->init(); globals->get_soundmgr()->init();
globals->get_soundmgr()->bind(); globals->get_soundmgr()->bind();
@ -1850,7 +1852,6 @@ void fgReInitSubsystems()
fgSetBool("/sim/freeze/master", true); fgSetBool("/sim/freeze/master", true);
} }
fgSetBool("/sim/crashed", false); fgSetBool("/sim/crashed", false);
fgSetBool("/sim/initialised", false);
// Initialize the FDM // Initialize the FDM
fgInitFDM(); fgInitFDM();
@ -1874,7 +1875,6 @@ void fgReInitSubsystems()
if ( !freeze ) { if ( !freeze ) {
fgSetBool("/sim/freeze/master", false); fgSetBool("/sim/freeze/master", false);
} }
fgSetBool("/sim/initialised", true);
fgSetBool("/sim/sceneryloaded",false); fgSetBool("/sim/sceneryloaded",false);
} }

View file

@ -96,6 +96,7 @@
static double real_delta_time_sec = 0.0; static double real_delta_time_sec = 0.0;
double delta_time_sec = 0.0; double delta_time_sec = 0.0;
extern float init_volume;
#ifdef macintosh #ifdef macintosh
@ -550,6 +551,8 @@ static void fgMainLoop( void ) {
if (!scenery_loaded && globals->get_tile_mgr()->all_queues_empty() && cur_fdm_state->get_inited()) { if (!scenery_loaded && globals->get_tile_mgr()->all_queues_empty() && cur_fdm_state->get_inited()) {
fgSetBool("sim/sceneryloaded",true); fgSetBool("sim/sceneryloaded",true);
fgSetFloat("/sim/sound/volume", init_volume);
globals->get_soundmgr()->set_volume(init_volume);
} }
if (fgGetBool("/sim/rendering/specular-highlight")) { if (fgGetBool("/sim/rendering/specular-highlight")) {
@ -577,8 +580,6 @@ static void fgIdleFunction ( void ) {
// printf("idle state == %d\n", idle_state); // printf("idle state == %d\n", idle_state);
if ( idle_state == 0 ) { if ( idle_state == 0 ) {
fgSetBool("sim/initialised", false);
// Initialize the splash screen right away // Initialize the splash screen right away
if ( fgGetBool("/sim/startup/splash-screen") ) { if ( fgGetBool("/sim/startup/splash-screen") ) {
fgSplashInit(fgGetString("/sim/startup/splash-texture")); fgSplashInit(fgGetString("/sim/startup/splash-texture"));
@ -662,7 +663,6 @@ static void fgIdleFunction ( void ) {
if ( idle_state == 1000 ) { if ( idle_state == 1000 ) {
// We've finished all our initialization steps, from now on we // We've finished all our initialization steps, from now on we
// run the main loop. // run the main loop.
fgSetBool("sim/initialised",true);
fgSetBool("sim/sceneryloaded",false); fgSetBool("sim/sceneryloaded",false);
fgRegisterIdleHandler(fgMainLoop); fgRegisterIdleHandler(fgMainLoop);