Merge branch 'ehofman/sound-reinit'
This commit is contained in:
commit
ff9cf6f8a1
1 changed files with 7 additions and 1 deletions
|
@ -485,8 +485,8 @@ static void fgMainLoop( void ) {
|
|||
// is processing the scenery (doubled the frame-rate for me) -EMH-
|
||||
#ifdef ENABLE_AUDIO_SUPPORT
|
||||
static bool smgr_init = true;
|
||||
if (smgr_init == true) {
|
||||
static SGPropertyNode *sound_working = fgGetNode("/sim/sound/working");
|
||||
if (smgr_init == true) {
|
||||
if (sound_working->getBoolValue() == true) {
|
||||
fgInitSoundManager();
|
||||
smgr_init = false;
|
||||
|
@ -496,6 +496,12 @@ static void fgMainLoop( void ) {
|
|||
static SGSoundMgr *smgr = globals->get_soundmgr();
|
||||
static bool smgr_enabled = true;
|
||||
|
||||
if (sound_working->getBoolValue() == false) { // request to reinit
|
||||
smgr->reinit();
|
||||
smgr->resume();
|
||||
sound_working->setBoolValue(true);
|
||||
}
|
||||
|
||||
if (smgr_enabled != sound_enabled->getBoolValue()) {
|
||||
if (smgr_enabled == true) { // request to suspend
|
||||
smgr->suspend();
|
||||
|
|
Loading…
Reference in a new issue