From e46036d55f85f89b1058dfce25266dde2a251ad4 Mon Sep 17 00:00:00 2001 From: mfranz Date: Tue, 4 Jul 2006 15:54:41 +0000 Subject: [PATCH] initialize HUD class and call its drawing routine from renderer (basically a NOOP if /sim/hud/visibility[1] is false) --- src/Instrumentation/instrument_mgr.cxx | 4 +++- src/Main/renderer.cxx | 6 ++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Instrumentation/instrument_mgr.cxx b/src/Instrumentation/instrument_mgr.cxx index 1da1abb71..425d1ee1e 100644 --- a/src/Instrumentation/instrument_mgr.cxx +++ b/src/Instrumentation/instrument_mgr.cxx @@ -18,6 +18,7 @@ #include
#include
#include
+#include #include "instrument_mgr.hxx" #include "adf.hxx" @@ -44,7 +45,7 @@ #include "inst_vertical_speed_indicator.hxx" // (TJ) #include "od_gauge.hxx" #include "wxradar.hxx" -#include "tacan.hxx" +#include "tacan.hxx" #include "mk_viii.hxx" @@ -52,6 +53,7 @@ FGInstrumentMgr::FGInstrumentMgr () { set_subsystem("annunciator", new Annunciator); set_subsystem("od_gauge", new FGODGauge, 1.0); + set_subsystem("hud", new HUD); config_props = new SGPropertyNode; diff --git a/src/Main/renderer.cxx b/src/Main/renderer.cxx index 421e8a866..ac18f8a81 100644 --- a/src/Main/renderer.cxx +++ b/src/Main/renderer.cxx @@ -68,6 +68,8 @@ #include #include #include +#include +#include #include "splash.hxx" #include "renderer.hxx" @@ -729,6 +731,10 @@ FGRenderer::update( bool refresh_camera_settings ) { hud_and_panel->apply(); fgCockpitUpdate(); + FGInstrumentMgr *instr = static_cast(globals->get_subsystem("instrumentation")); + HUD *hud = static_cast(instr->get_subsystem("hud")); + hud->draw(); + // Use the hud_and_panel ssgSimpleState for rendering the ATC output // This only works properly if called before the panel call if((fgGetBool("/sim/atc/enabled")) || (fgGetBool("/sim/ai-traffic/enabled")))