- // pick up model coordidnates that Nasal code may have set relative to the
- // aircraft's
- globals->get_model_mgr()->update(sim_dt);
-
- // update the view angle as late as possible, but before sound calculations
- globals->get_viewmgr()->update(real_dt);
-
- // Update the sound manager last so it can use the CPU while the GPU
- // 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) {
- if (sound_working->getBoolValue() == true) {
- fgInitSoundManager();
- smgr_init = false;
- }
- } else {
- static SGPropertyNode *sound_enabled = fgGetNode("/sim/sound/enabled");
- 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();
- smgr_enabled = false;
- } else {
- smgr->resume();
- smgr_enabled = true;
- }
- }
-
- if (smgr_enabled == true) {
- static SGPropertyNode *volume = fgGetNode("/sim/sound/volume");
- smgr->set_volume(volume->getFloatValue());
- smgr->update(sim_dt);
- }
- }
-#endif
-
- // END Tile Manager udpates
- bool scenery_loaded = fgGetBool("sim/sceneryloaded");
- if (!scenery_loaded && globals->get_tile_mgr()->isSceneryLoaded()
- && fgGetBool("sim/fdm-initialized")) {
- fgSetBool("sim/sceneryloaded",true);
- if (fgGetBool("/sim/sound/working")) {
- globals->get_soundmgr()->activate();
- }
- globals->get_props()->tie("/sim/sound/devices/name",
- SGRawValueFunctions<const char *>(0, fgSetNewSoundDevice), false);
- }