]> git.mxchange.org Git - flightgear.git/commitdiff
Make v2 HUD a top-level subsystem, so it can be reinit()ed correctly.
authorJames Turner <zakalawe@mac.com>
Sun, 24 Oct 2010 06:10:02 +0000 (07:10 +0100)
committerJames Turner <zakalawe@mac.com>
Sun, 24 Oct 2010 06:10:02 +0000 (07:10 +0100)
src/Instrumentation/instrument_mgr.cxx
src/Main/renderer.cxx

index 2e3f21e3f3d5fcaaf7549e8f79715e9eb535ebef..19fcaeb066ea21386d1fb4a4e2ae932b3ba3c9e0 100644 (file)
@@ -55,7 +55,8 @@ FGInstrumentMgr::FGInstrumentMgr () :
   _explicitGps(false)
 {
     set_subsystem("od_gauge", new FGODGauge);
-    set_subsystem("hud", new HUD);
+    
+    globals->add_subsystem("hud", new HUD, SGSubsystemMgr::DISPLAY);
 }
 
 FGInstrumentMgr::~FGInstrumentMgr ()
index 0cb00c5ab63d8228368f513d0f60cf3d62011812..388701d6714a0ddedddd017e78fe950651e0bf9c 100644 (file)
@@ -89,7 +89,6 @@
 #include <Scenery/redout.hxx>
 #include <Scenery/tilemgr.hxx>
 #include <GUI/new_gui.hxx>
-#include <Instrumentation/instrument_mgr.hxx>
 #include <Instrumentation/HUD/HUD.hxx>
 #include <Environment/precipitation_mgr.hxx>
 
@@ -209,8 +208,7 @@ public:
 
     fgCockpitUpdate(&state);
 
-    FGInstrumentMgr *instr = static_cast<FGInstrumentMgr*>(globals->get_subsystem("instrumentation"));
-    HUD *hud = static_cast<HUD*>(instr->get_subsystem("hud"));
+    HUD *hud = static_cast<HUD*>(globals->get_subsystem("hud"));
     hud->draw(state);
 
     // update the panel subsystem