]> git.mxchange.org Git - flightgear.git/commitdiff
Use new magnetic compass property.
authordavid <david>
Sun, 26 Jan 2003 15:56:30 +0000 (15:56 +0000)
committerdavid <david>
Sun, 26 Jan 2003 15:56:30 +0000 (15:56 +0000)
src/Cockpit/built_in/FGMagRibbon.cxx
src/Cockpit/built_in/FGMagRibbon.hxx

index f76d1126f758643f10dcc816696361116d6c3b51..fe8d971d77022e68b40f926b63955b7c465677a2 100644 (file)
@@ -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) {
index 55bd79af5d3de338470ce951eb6a83691980841d..829f65d7b38ab39460a9ef90116440034fc12293 100644 (file)
@@ -21,6 +21,7 @@
 #ifndef __FG_MAG_RIBBON_HXX
 #define __FG_MAG_RIBBON_HXX
 
+#include <Main/fg_props.hxx>
 #include "../panel.hxx"
 
 ////////////////////////////////////////////////////////////////////////
 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