|
From: Erik H. <eh...@ba...> - 2010-04-10 09:47:31
|
Update of /var/cvs/FlightGear-0.9/source/src/Main In directory baron.flightgear.org:/tmp/cvs-serv10357 Modified Files: main.cxx Log Message: allow reinitializing the sound system by setting /sim/sound/working to false at runtime. Index: main.cxx =================================================================== RCS file: /var/cvs/FlightGear-0.9/source/src/Main/main.cxx,v retrieving revision 1.311 retrieving revision 1.312 diff -u -r1.311 -r1.312 --- main.cxx 23 Jan 2010 22:27:17 -0000 1.311 +++ main.cxx 10 Apr 2010 09:37:22 -0000 1.312 @@ -485,8 +485,8 @@ // is processing the scenery (doubled the frame-rate for me) -EMH- #ifdef ENABLE_AUDIO_SUPPORT static bool smgr_init = true; + static SGPropertyNode *sound_working = fgGetNode("/sim/sound/working"); if (smgr_init == true) { - static SGPropertyNode *sound_working = fgGetNode("/sim/sound/working"); if (sound_working->getBoolValue() == true) { fgInitSoundManager(); smgr_init = false; @@ -496,6 +496,11 @@ static SGSoundMgr *smgr = globals->get_soundmgr(); static bool smgr_enabled = true; + if (sound_working->getBoolValue() == false) { // request to reinit + smgr->reinit(); + sound_working->setBoolValue(true); + } + if (smgr_enabled != sound_enabled->getBoolValue()) { if (smgr_enabled == true) { // request to suspend smgr->suspend(); |