Use new magnetic compass property.
This commit is contained in:
parent
f72891e113
commit
c165466a07
2 changed files with 11 additions and 5 deletions
|
@ -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) {
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
#ifndef __FG_MAG_RIBBON_HXX
|
||||
#define __FG_MAG_RIBBON_HXX
|
||||
|
||||
#include <Main/fg_props.hxx>
|
||||
#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
|
||||
|
|
Loading…
Reference in a new issue