]> git.mxchange.org Git - flightgear.git/blobdiff - src/Main/globals.cxx
Fix iterator const-ness.
[flightgear.git] / src / Main / globals.cxx
index 084d77128ae73cb6b86f92532c36b34c67f7e5fe..796b18cd8f66d1ef35085ca9f8b738efd2534056 100644 (file)
 #include <Aircraft/controls.hxx>
 #include <Airports/runways.hxx>
 #include <Autopilot/route_mgr.hxx>
-#include <GUI/FGFontCache.hxx>
 #include <GUI/gui.h>
 #include <Scenery/scenery.hxx>
 #include <Scenery/tilemgr.hxx>
 #include <Navaids/navlist.hxx>
 #include <Viewer/renderer.hxx>
 #include <Viewer/viewmgr.hxx>
-#include <Sound/sample_queue.hxx>
 
 #include "globals.hxx"
 #include "locale.hxx"
@@ -157,14 +155,11 @@ FGGlobals::FGGlobals() :
     fg_root( "" ),
     fg_home( "" ),
     time_params( NULL ),
-    ephem( NULL ),
     commands( SGCommandMgr::instance() ),
     channel_options_list( NULL ),
     initial_waypoints( NULL ),
-    fontcache ( new FGFontCache ),
     channellist( NULL ),
-    haveUserSettings(false),
-    _chatter_queue(NULL)
+    haveUserSettings(false)
 {
     SGPropertyNode* root = new SGPropertyNode;
     props = SGPropertyNode_ptr(root);
@@ -211,21 +206,6 @@ FGGlobals::~FGGlobals()
         vw->stopThreading();
     }
 
-#if 0
-    // The AIModels manager performs a number of actions upon
-    // Shutdown that implicitly assume that other subsystems
-    // are still operational (Due to the dynamic allocation and
-    // deallocation of AIModel objects. To ensure we can safely
-    // shut down all subsystems, make sure we take down the
-    // AIModels system first.
-    SGSubsystemRef ai = subsystem_mgr->get_subsystem("ai-model");
-    if (ai) {
-        subsystem_mgr->remove("ai-model");
-        ai->unbind();
-        ai.clear(); // ensure AI is deleted now, not at end of this method
-    }
-#endif
-
     subsystem_mgr->shutdown();
     subsystem_mgr->unbind();
 
@@ -242,7 +222,6 @@ FGGlobals::~FGGlobals()
 
     // renderer touches subsystems during its destruction
     set_renderer(NULL);
-    _chatter_queue.clear();
 
     delete subsystem_mgr;
     subsystem_mgr = NULL; // important so ::get_subsystem returns NULL
@@ -253,7 +232,6 @@ FGGlobals::~FGGlobals()
 
     delete channel_options_list;
     delete initial_waypoints;
-    delete fontcache;
     delete channellist;
 
     simgear::PropertyObjectBase::setDefaultRoot(NULL);
@@ -375,6 +353,11 @@ void FGGlobals::append_fg_scenery (const std::string &paths, bool secure)
         continue;
       }
 
+      // tell the ResouceManager about the scenery path
+      // needed to load Models from this scenery path
+      simgear::ResourceManager::instance()->addBasePath(abspath.str(),
+        simgear::ResourceManager::PRIORITY_DEFAULT);
+
         simgear::Dir dir(abspath);
         SGPath terrainDir(dir.file("Terrain"));
         SGPath objectsDir(dir.file("Objects"));
@@ -524,12 +507,6 @@ FGGlobals::add_subsystem (const char * name,
     subsystem_mgr->add(name, subsystem, type, min_time_sec);
 }
 
-SGSoundMgr *
-FGGlobals::get_soundmgr () const
-{
-    return get_subsystem<SGSoundMgr>();
-}
-
 SGEventMgr *
 FGGlobals::get_event_mgr () const
 {
@@ -729,7 +706,7 @@ FGViewMgr *FGGlobals::get_viewmgr() const
     return get_subsystem<FGViewMgr>();
 }
 
-FGViewer* FGGlobals::get_current_view () const
+flightgear::View* FGGlobals::get_current_view () const
 {
     FGViewMgr* vm = get_viewmgr();
     return vm ? vm->get_current_view() : 0;
@@ -745,16 +722,6 @@ FGControls *FGGlobals::get_controls() const
     return get_subsystem<FGControls>();
 }
 
-FGSampleQueue* FGGlobals::get_chatter_queue() const
-{
-    return _chatter_queue;
-}
-
-void FGGlobals::set_chatter_queue(FGSampleQueue* queue)
-{
-    _chatter_queue = queue;
-}
-
 void FGGlobals::addListenerToCleanup(SGPropertyChangeListener* l)
 {
     _listeners_to_cleanup.push_back(l);