1
0
Fork 0

Use new magnetic compass property.

This commit is contained in:
david 2003-01-26 15:56:30 +00:00
parent f72891e113
commit c165466a07
2 changed files with 11 additions and 5 deletions

View 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) {

View file

@ -21,6 +21,7 @@
#ifndef __FG_MAG_RIBBON_HXX
#define __FG_MAG_RIBBON_HXX
#include <Main/fg_props.hxx>
#include "../panel.hxx"
////////////////////////////////////////////////////////////////////////
@ -34,6 +35,9 @@ public:
virtual ~FGMagRibbon () {}
virtual void draw ();
private:
SGPropertyNode_ptr _magcompass_node;
};
#endif // __FG_MAG_RIBBON_HXX