#include "FGMagRibbon.hxx"
-#include "../steam.hxx"
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) {
#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