From c165466a076a2edbfdf9f325a40b3ef73ac0c629 Mon Sep 17 00:00:00 2001 From: david Date: Sun, 26 Jan 2003 15:56:30 +0000 Subject: [PATCH] Use new magnetic compass property. --- src/Cockpit/built_in/FGMagRibbon.cxx | 6 ++++-- src/Cockpit/built_in/FGMagRibbon.hxx | 10 +++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/Cockpit/built_in/FGMagRibbon.cxx b/src/Cockpit/built_in/FGMagRibbon.cxx index f76d1126f..fe8d971d7 100644 --- a/src/Cockpit/built_in/FGMagRibbon.cxx +++ b/src/Cockpit/built_in/FGMagRibbon.cxx @@ -20,7 +20,6 @@ #include "FGMagRibbon.hxx" -#include "../steam.hxx" FGMagRibbon::FGMagRibbon (int w, int h) @@ -28,12 +27,15 @@ FGMagRibbon::FGMagRibbon (int w, int h) { FGCroppedTexture texture("Aircraft/Instruments/Textures/compass-ribbon.rgb"); setTexture(texture); + _magcompass_node = + fgGetNode("/instrumentation/magnetic-compass/indicated-heading-deg", + true); } void FGMagRibbon::draw () { - double heading = globals->get_steam()->get_MH_deg(); + double heading = _magcompass_node->getDoubleValue(); double xoffset, yoffset; while (heading >= 360.0) { diff --git a/src/Cockpit/built_in/FGMagRibbon.hxx b/src/Cockpit/built_in/FGMagRibbon.hxx index 55bd79af5..829f65d7b 100644 --- a/src/Cockpit/built_in/FGMagRibbon.hxx +++ b/src/Cockpit/built_in/FGMagRibbon.hxx @@ -21,6 +21,7 @@ #ifndef __FG_MAG_RIBBON_HXX #define __FG_MAG_RIBBON_HXX +#include
#include "../panel.hxx" //////////////////////////////////////////////////////////////////////// @@ -30,10 +31,13 @@ class FGMagRibbon : public FGTexturedLayer { public: - FGMagRibbon (int w, int h); - virtual ~FGMagRibbon () {} + FGMagRibbon (int w, int h); + virtual ~FGMagRibbon () {} - virtual void draw (); + virtual void draw (); + +private: + SGPropertyNode_ptr _magcompass_node; }; #endif // __FG_MAG_RIBBON_HXX