- // Update any multiplayer's network queues, the AIMultiplayer
- // implementation is an AI model and depends on that
- globals->get_multiplayer_mgr()->Update();
-
-#if ENABLE_ATCDCL
- // Run ATC subsystem
- if (fgGetBool("/sim/atc/enabled"))
- globals->get_ATC_mgr()->update(delta_time_sec);
-
-
- // Run the AI subsystem
- // NOTE: the AI_mgr has nothing to do with the AIModels subsystem.
- // There was previously a comment here stating that the
- // AI_mgr code should be run then multiplayer is enabled.
- // Multiplayer relies on AIModels, and not on the old and
- // depricated AI_mgr system. So, we can safely skip the following
- // two lines at compile time when compiling with --disable-atcdcl
- if (fgGetBool("/sim/ai-traffic/enabled"))
- globals->get_AI_mgr()->update(delta_time_sec);
-#endif
-
- globals->get_subsystem_mgr()->update(delta_time_sec);
- globals->get_aircraft_model()->update(delta_time_sec);
-
- //
- // Tile Manager updates - see if we need to load any new scenery tiles.
- // this code ties together the fdm, viewer and scenery classes...
- // we may want to move this to its own class at some point
- //
- double visibility_meters = fgGetDouble("/environment/visibility-m");
- globals->get_tile_mgr()->prep_ssg_nodes( visibility_meters );
-
- // update tile manager for view...
- SGVec3d viewPos = globals->get_current_view()->get_view_pos();
- SGGeod geodViewPos = SGGeod::fromCart(viewPos);
- globals->get_tile_mgr()->update(geodViewPos, visibility_meters);
-
- // run Nasal's settimer() loops right before the view manager
- globals->get_event_mgr()->update(delta_time_sec);
-
- // pick up model coordidnates that Nasal code may have set relative to the
- // aircraft's
- globals->get_model_mgr()->update(delta_time_sec);
-
- // update the view angle as late as possible, but before sound calculations
- globals->get_viewmgr()->update(real_delta_time_sec);
-
- // 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;
- }
- }