From: curt Date: Thu, 27 Apr 2000 22:45:48 +0000 (+0000) Subject: Panel updates from David Megginson. Radials can now be adjusted on the fly X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=418279fdd4989bf37f9b302de958c58424797d8f;p=flightgear.git Panel updates from David Megginson. Radials can now be adjusted on the fly by clicking on the knob on the instrument panel. --- diff --git a/src/Cockpit/cockpit.cxx b/src/Cockpit/cockpit.cxx index f0ad116dd..ed832c5ad 100644 --- a/src/Cockpit/cockpit.cxx +++ b/src/Cockpit/cockpit.cxx @@ -533,11 +533,7 @@ void fgCockpitUpdate( void ) { } #endif // #ifdef DISPLAY_COUNTER - if( current_options.get_panel_status() && - (fabs( current_view.get_view_offset() ) < 0.2) ) - { - xglViewport( 0, 0, iwidth, iheight ); + xglViewport( 0, 0, iwidth, iheight ); - FGPanel::OurPanel->Update(); - } + current_panel.update(); } diff --git a/src/Cockpit/panel.cxx b/src/Cockpit/panel.cxx index 3ee97a16c..0774e63e0 100644 --- a/src/Cockpit/panel.cxx +++ b/src/Cockpit/panel.cxx @@ -35,6 +35,7 @@ #include #include #include
+#include
#include
#include #include @@ -80,12 +81,8 @@ static char * panelGetTime (char * buf) // they're hard-coded. //////////////////////////////////////////////////////////////////////// -static ssgTexture * -createTexture (const char * relativePath) -{ - return FGPanel::OurPanel->createTexture(relativePath); -} +#define createTexture(a) FGTextureManager::createTexture(a) /** * Construct an airspeed indicator for a single-engine prop. @@ -221,6 +218,18 @@ createGyroCompass (int x, int y) { FGLayeredInstrument * inst = new FGLayeredInstrument(x, y, SIX_W, SIX_W); + // Action: move bug counter-clockwise + inst->addAction(SIX_W/2 - SIX_W/5, -SIX_W/2, SIX_W/10, SIX_W/5, + new FGAdjustAction(FGBFI::getAPHeading, + FGBFI::setAPHeading, + -1.0, 0.0, 360.0, true)); + + // Action: move bug clockwise + inst->addAction(SIX_W/2 - SIX_W/10, -SIX_W/2, SIX_W/10, SIX_W/5, + new FGAdjustAction(FGBFI::getAPHeading, + FGBFI::setAPHeading, + 1.0, 0.0, 360.0, true)); + // Layer 0: compass background // rotates with heading inst->addLayer(0, createTexture("Textures/Panel/gyro-bg.rgb")); @@ -241,6 +250,15 @@ createGyroCompass (int x, int y) // Layer 2: fixed center inst->addLayer(2, createTexture("Textures/Panel/gyro-fg.rgb")); + // Layer 3: heading knob + // rotates with AP heading + inst->addLayer(3, createTexture("Textures/Panel/heading-knob.rgb")); + inst->addTransformation(3, FGInstrumentLayer::XSHIFT, SIX_W/2 - 10); + inst->addTransformation(3, FGInstrumentLayer::YSHIFT, -SIX_W/2 + 10); + inst->addTransformation(3, FGInstrumentLayer::ROTATION, + FGBFI::getAPHeading, + -360.0, 360.0, 1.0, 0.0); + return inst; } @@ -389,49 +407,100 @@ createNAV1 (int x, int y) { FGLayeredInstrument * inst = new FGLayeredInstrument(x, y, SIX_W, SIX_W); + // Action: increase selected radial + inst->addAction(SIX_W/2 - SIX_W/5, -SIX_W/2, SIX_W/10, SIX_W/5, + new FGAdjustAction(FGBFI::getNAV1SelRadial, + FGBFI::setNAV1SelRadial, + 1.0, 0.0, 360.0, true)); + + // Action: decrease selected radial + inst->addAction(SIX_W/2 - SIX_W/10, -SIX_W/2, SIX_W/10, SIX_W/5, + new FGAdjustAction(FGBFI::getNAV1SelRadial, + FGBFI::setNAV1SelRadial, + -1.0, 0.0, 360.0, true)); + // Layer 0: background inst->addLayer(0, createTexture("Textures/Panel/gyro-bg.rgb")); inst->addTransformation(0, FGInstrumentLayer::ROTATION, - FGSteam::get_HackOBS1_deg, + FGBFI::getNAV1SelRadial, -360.0, 360.0, -1.0, 0.0); - // Layer 1: long needle + + // Layer 1: left-right needle. inst->addLayer(1, createTexture("Textures/Panel/nav-needle.rgb")); inst->addTransformation(1, FGInstrumentLayer::XSHIFT, FGSteam::get_HackVOR1_deg, -10.0, 10.0, SIX_W / 40.0, 0.0); + + // Layer 2: glidescope needle inst->addLayer(2, createTexture("Textures/Panel/nav-needle.rgb")); inst->addTransformation(2, FGInstrumentLayer::YSHIFT, FGSteam::get_HackGS_deg, -1.0, 1.0, SIX_W / 5.0, 0.0); inst->addTransformation(2, FGInstrumentLayer::ROTATION, 90 ); + + // Layer 3: face with markings inst->addLayer(3, createTexture("Textures/Panel/nav-face.rgb")); + // Layer 4: heading knob + // rotates with selected radial + inst->addLayer(4, createTexture("Textures/Panel/heading-knob.rgb")); + inst->addTransformation(4, FGInstrumentLayer::XSHIFT, SIX_W/2 - 10); + inst->addTransformation(4, FGInstrumentLayer::YSHIFT, -SIX_W/2 + 10); + inst->addTransformation(4, FGInstrumentLayer::ROTATION, + FGBFI::getNAV1SelRadial, + -360.0, 360.0, -1.0, 0.0); + return inst; } /** - * Construct a NAV2 gauge (hardwired). + * Construct a NAV2 gauge. */ static FGPanelInstrument * createNAV2 (int x, int y) { FGLayeredInstrument * inst = new FGLayeredInstrument(x, y, SIX_W, SIX_W); + // Action: increase selected radial + inst->addAction(SIX_W/2 - SIX_W/5, -SIX_W/2, SIX_W/10, SIX_W/5, + new FGAdjustAction(FGBFI::getNAV2SelRadial, + FGBFI::setNAV2SelRadial, + 1.0, 0.0, 360.0, true)); + + // Action: decrease selected radial + inst->addAction(SIX_W/2 - SIX_W/10, -SIX_W/2, SIX_W/10, SIX_W/5, + new FGAdjustAction(FGBFI::getNAV2SelRadial, + FGBFI::setNAV2SelRadial, + -1.0, 0.0, 360.0, true)); + // Layer 0: background inst->addLayer(0, createTexture("Textures/Panel/gyro-bg.rgb")); inst->addTransformation(0, FGInstrumentLayer::ROTATION, - FGSteam::get_HackOBS2_deg, + FGBFI::getNAV2SelRadial, -360.0, 360.0, -1.0, 0.0); + + // Layer 1: left-right needle. inst->addLayer(1, createTexture("Textures/Panel/nav-needle.rgb")); inst->addTransformation(1, FGInstrumentLayer::XSHIFT, FGSteam::get_HackVOR2_deg, -10.0, 10.0, SIX_W / 40.0, 0.0); // inst->addTransformation(1, FGInstrumentLayer::YSHIFT, // -SIX_W / 4.4 ); + + // Layer 2: face with markings. inst->addLayer(2, createTexture("Textures/Panel/nav-face.rgb")); + // Layer 3: heading knob + // rotates with selected radial + inst->addLayer(3, createTexture("Textures/Panel/heading-knob.rgb")); + inst->addTransformation(3, FGInstrumentLayer::XSHIFT, SIX_W/2 - 10); + inst->addTransformation(3, FGInstrumentLayer::YSHIFT, -SIX_W/2 + 10); + inst->addTransformation(3, FGInstrumentLayer::ROTATION, + FGBFI::getNAV2SelRadial, + -360.0, 360.0, -1.0, 0.0); + return inst; } @@ -444,108 +513,162 @@ createADF (int x, int y) { FGLayeredInstrument * inst = new FGLayeredInstrument(x, y, SIX_W, SIX_W); + // Action: increase selected rotation + inst->addAction(SIX_W/2 - SIX_W/5, -SIX_W/2, SIX_W/10, SIX_W/5, + new FGAdjustAction(FGBFI::getADFRotation, + FGBFI::setADFRotation, + 1.0, 0.0, 360.0, true)); + + // Action: decrease selected rotation + inst->addAction(SIX_W/2 - SIX_W/10, -SIX_W/2, SIX_W/10, SIX_W/5, + new FGAdjustAction(FGBFI::getADFRotation, + FGBFI::setADFRotation, + -1.0, 0.0, 360.0, true)); + // Layer 0: background inst->addLayer(0, createTexture("Textures/Panel/gyro-bg.rgb")); + inst->addTransformation(0, FGInstrumentLayer::ROTATION, + FGBFI::getADFRotation, + 0.0, 360.0, 1.0, 0.0); + + // Layer 1: Direction needle. inst->addLayer(1, createTexture("Textures/Panel/long-needle.rgb")); inst->addTransformation(1, FGInstrumentLayer::ROTATION, FGSteam::get_HackADF_deg, -720.0, 720.0, 1.0, 0.0); + // Layer 2: heading knob + // rotates with selected radial + inst->addLayer(2, createTexture("Textures/Panel/heading-knob.rgb")); + inst->addTransformation(2, FGInstrumentLayer::XSHIFT, SIX_W/2 - 10); + inst->addTransformation(2, FGInstrumentLayer::YSHIFT, -SIX_W/2 + 10); + inst->addTransformation(2, FGInstrumentLayer::ROTATION, + FGBFI::getADFRotation, + -360.0, 360.0, -1.0, 0.0); return inst; } + +//////////////////////////////////////////////////////////////////////// +// Implementation of FGTextureManager. +//////////////////////////////////////////////////////////////////////// + +map FGTextureManager::_textureMap; + +ssgTexture * +FGTextureManager::createTexture (const char * relativePath) +{ + ssgTexture *texture; + + texture = _textureMap[relativePath]; + if (texture == 0) { + FGPath tpath(current_options.get_fg_root()); + tpath.append(relativePath); + texture = new ssgTexture((char *)tpath.c_str(), false, false); + _textureMap[relativePath] = texture; + cerr << "Created texture " << relativePath + << " handle=" << texture->getHandle() << endl; + } + + return texture; +} + + //////////////////////////////////////////////////////////////////////// // Implementation of FGPanel. //////////////////////////////////////////////////////////////////////// -FGPanel * FGPanel::OurPanel = 0; +FGPanel current_panel; FGPanel::FGPanel () + : _initialized(false), + _visibility(false) { - if (OurPanel == 0) { - OurPanel = this; - } else { - FG_LOG(FG_GENERAL, FG_ALERT, "Multiple panels"); - exit(-1); +} + +FGPanel::~FGPanel () +{ + instrument_list_type::iterator current = _instruments.begin(); + instrument_list_type::iterator last = _instruments.end(); + + for ( ; current != last; ++current) { + delete *current; + *current = 0; } +} - int x = SIX_X; - int y = SIX_Y; +void +FGPanel::addInstrument (FGPanelInstrument * instrument) +{ + _instruments.push_back(instrument); +} + +void +FGPanel::init (int x, int y, int finx, int finy) +{ + _x = x; + _y = y; + _w = finx - x; + _h = finy - y; + _panel_h = (int)((finy - y) * 0.5768 + 1); + + // Don't reconstruct all of the + // instruments. + if (_initialized) + return; + + x = SIX_X; + y = SIX_Y; _bg = createTexture("Textures/Panel/panel-bg.rgb"); // Chronometer alone at side x = SIX_X - SIX_SPACING - 8; - _instruments.push_back(createChronometer(x, y)); + addInstrument(createChronometer(x, y)); // Top row x = SIX_X; - _instruments.push_back(createAirspeedIndicator(x, y)); + addInstrument(createAirspeedIndicator(x, y)); x += SIX_SPACING; - _instruments.push_back(createHorizon(x, y)); + addInstrument(createHorizon(x, y)); x += SIX_SPACING; - _instruments.push_back(createAltimeter(x, y)); + addInstrument(createAltimeter(x, y)); x += SIX_SPACING + 20; - _instruments.push_back(createNAV1(x, y)); + addInstrument(createNAV1(x, y)); // Middle row x = SIX_X; y -= SIX_SPACING; - _instruments.push_back(createTurnCoordinator(x, y)); + addInstrument(createTurnCoordinator(x, y)); x += SIX_SPACING; - _instruments.push_back(createGyroCompass(x, y)); + addInstrument(createGyroCompass(x, y)); x += SIX_SPACING; - _instruments.push_back(createVerticalVelocity(x, y)); + addInstrument(createVerticalVelocity(x, y)); x += SIX_SPACING + 20; - _instruments.push_back(createNAV2(x, y)); + addInstrument(createNAV2(x, y)); // Bottom row x = SIX_X; y -= SIX_SPACING + 10; - _instruments.push_back(createControls(x, y)); + addInstrument(createControls(x, y)); x += SIX_SPACING; - _instruments.push_back(createFlapIndicator(x, y)); + addInstrument(createFlapIndicator(x, y)); x += SIX_SPACING; - _instruments.push_back(createRPMGauge(x, y)); + addInstrument(createRPMGauge(x, y)); x += SIX_SPACING + 20; y += 10; - _instruments.push_back(createADF(x, y)); -} - -FGPanel::~FGPanel () -{ - OurPanel = 0; - - instrument_list_type::iterator current = _instruments.begin(); - instrument_list_type::iterator last = _instruments.end(); - - for ( ; current != last; ++current) { - delete *current; - *current = 0; - } -} - -float -FGPanel::get_height () const -{ - return _panel_h; + addInstrument(createADF(x, y)); } void -FGPanel::ReInit (int x, int y, int finx, int finy) +FGPanel::update () const { - _x = x; - _y = y; - _w = finx - x; - _h = finy - y; - _panel_h = (int)((finy - y) * 0.5768 + 1); -} + // Do nothing if the panel isn't visible. + if (!_visibility) + return; -void -FGPanel::Update () const -{ glMatrixMode(GL_PROJECTION); glPushMatrix(); glLoadIdentity(); @@ -592,22 +715,74 @@ FGPanel::Update () const glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); } -ssgTexture * -FGPanel::createTexture (const char * relativePath) +void +FGPanel::setVisibility (bool visibility) { - ssgTexture *texture; + _visibility = visibility; +} - texture = _textureMap[relativePath]; - if (texture == 0) { - FGPath tpath(current_options.get_fg_root()); - tpath.append(relativePath); - texture = new ssgTexture((char *)tpath.c_str(), false, false); - _textureMap[relativePath] = texture; - cerr << "Created texture " << relativePath - << " handle=" << texture->getHandle() << endl; +bool +FGPanel::getVisibility () const +{ + return _visibility; +} + +bool +FGPanel::doMouseAction (int button, int updown, int x, int y) +{ + // For now, ignore the release + if (updown == 1) + return true; + + x = (int)(((float)x / current_view.get_winWidth()) * _w); + y = (int)(_h - (((float)y / current_view.get_winHeight()) * _h)); + + for (int i = 0; i < _instruments.size(); i++) { + FGPanelInstrument *inst = _instruments[i]; + int ix = inst->getXPos(); + int iy = inst->getYPos(); + int iw = inst->getWidth() / 2; + int ih = inst->getHeight() / 2; + if (x >= ix - iw && x < ix + iw && y >= iy - ih && y < iy + ih) { + cout << "Do mouse action for component " << i << '\n'; + return inst->doMouseAction(button, updown, x - ix, y - iy); + } } + cout << "Did not click on an instrument\n"; + return false; +} - return texture; + + +//////////////////////////////////////////////////////////////////////// +// Implementation of FGAdjustAction. +//////////////////////////////////////////////////////////////////////// + +FGAdjustAction::FGAdjustAction (getter_type getter, setter_type setter, + double increment, double min, double max, + bool wrap=false) + : _getter(getter), _setter(setter), _increment(increment), + _min(min), _max(max), _wrap(wrap) +{ +} + +FGAdjustAction::~FGAdjustAction () +{ +} + +void +FGAdjustAction::doAction () +{ + double value = (*_getter)(); + cout << "Do action; value=" << value << '\n'; + value += _increment; + if (value < _min) { + value = (_wrap ? _max : _min); + } else if (value > _max) { + value = (_wrap ? _min : _max); + } + cout << "New value is " << value << '\n'; + (*_setter)(value); } @@ -631,6 +806,11 @@ FGPanelInstrument::FGPanelInstrument (int x, int y, int w, int h) FGPanelInstrument::~FGPanelInstrument () { + action_list_type::iterator it = _actions.begin(); + action_list_type::iterator last = _actions.end(); + for ( ; it != last; it++) { + delete it->action; + } } void @@ -659,6 +839,49 @@ FGPanelInstrument::getYPos () const return _y; } +int +FGPanelInstrument::getWidth () const +{ + return _w; +} + +int +FGPanelInstrument::getHeight () const +{ + return _h; +} + +void +FGPanelInstrument::addAction (int x, int y, int w, int h, + FGPanelAction * action) +{ + FGPanelInstrument::inst_action act; + act.x = x; + act.y = y; + act.w = w; + act.h = h; + act.action = action; + _actions.push_back(act); +} + + // Coordinates relative to centre. +bool +FGPanelInstrument::doMouseAction (int button, int updown, int x, int y) +{ + action_list_type::iterator it = _actions.begin(); + action_list_type::iterator last = _actions.end(); + cout << "Mouse action at " << x << ',' << y << '\n'; + for ( ; it != last; it++) { + cout << "Trying action at " << it->x << ',' << it->y << ',' + << it->w <<',' << it->h << '\n'; + if (x >= it->x && x < it->x + it->w && y >= it->y && y < it->y + it->h) { + it->action->doAction(); + return true; + } + } + return false; +} + //////////////////////////////////////////////////////////////////////// diff --git a/src/Cockpit/panel.hxx b/src/Cockpit/panel.hxx index f0f0ace82..58f02569b 100644 --- a/src/Cockpit/panel.hxx +++ b/src/Cockpit/panel.hxx @@ -46,6 +46,20 @@ FG_USING_STD(map); class FGPanelInstrument; + + +//////////////////////////////////////////////////////////////////////// +// Texture manager (should migrate out into FGFS). +//////////////////////////////////////////////////////////////////////// + +class FGTextureManager +{ +public: + static ssgTexture * createTexture(const char * relativePath); +private: + static map_textureMap; +}; + //////////////////////////////////////////////////////////////////////// // Instrument panel class. @@ -58,31 +72,65 @@ public: FGPanel (); virtual ~FGPanel (); - virtual ssgTexture * createTexture (const char * relativePath); + // transfer pointer ownership!!! + virtual void addInstrument (FGPanelInstrument * instrument); + virtual void init (int x, int y, int finx, int finy); + virtual void update () const; + + virtual bool getVisibility () const; + virtual void setVisibility (bool visibility); - // Legacy interface from old panel. - static FGPanel * OurPanel; - virtual float get_height () const; - virtual void ReInit (int x, int y, int finx, int finy); - virtual void Update () const; + virtual bool doMouseAction (int button, int updown, int x, int y); private: - + bool _initialized; + bool _visibility; typedef vector instrument_list_type; - int _x, _y, _w, _h; int _panel_h; - ssgTexture * _bg; - - // Internalization table. - map _textureMap; - // List of instruments in panel. instrument_list_type _instruments; }; + +//////////////////////////////////////////////////////////////////////// +// Base class for user action types. +//////////////////////////////////////////////////////////////////////// + +class FGPanelAction +{ +public: + virtual void doAction () = 0; +}; + + + +//////////////////////////////////////////////////////////////////////// +// Adjustment action. +//////////////////////////////////////////////////////////////////////// + +class FGAdjustAction : public FGPanelAction +{ +public: + typedef double (*getter_type)(); + typedef void (*setter_type)(double); + + FGAdjustAction (getter_type getter, setter_type setter, double increment, + double min, double max, bool wrap=false); + virtual ~FGAdjustAction (); + virtual void doAction (); +private: + getter_type _getter; + setter_type _setter; + double _increment; + double _min; + double _max; + bool _wrap; +}; + + //////////////////////////////////////////////////////////////////////// // Instrument base class. @@ -102,9 +150,28 @@ public: virtual int getXPos () const; virtual int getYPos () const; + virtual int getWidth () const; + virtual int getHeight () const; + + // Coordinates relative to centre. + // Transfer pointer ownership!! + virtual void addAction (int x, int y, int w, int h, + FGPanelAction * action); + + // Coordinates relative to centre. + virtual bool doMouseAction (int button, int updown, int x, int y); protected: int _x, _y, _w, _h; + typedef struct { + int x; + int y; + int w; + int h; + FGPanelAction * action; + } inst_action; + typedef vector action_list_type; + action_list_type _actions; }; @@ -180,6 +247,7 @@ public: virtual void draw () const; + // Transfer pointer ownership!! virtual void addLayer (FGInstrumentLayer *layer); virtual void addLayer (int i, ssgTexture * texture); virtual void addTransformation (int layer, @@ -253,6 +321,14 @@ private: }; + +//////////////////////////////////////////////////////////////////////// +// The current panel, if any. +//////////////////////////////////////////////////////////////////////// + +extern FGPanel current_panel; + + #endif // __PANEL_HXX diff --git a/src/Cockpit/radiostack.cxx b/src/Cockpit/radiostack.cxx index 080e8aacf..f563b1fa1 100644 --- a/src/Cockpit/radiostack.cxx +++ b/src/Cockpit/radiostack.cxx @@ -45,6 +45,10 @@ FGRadioStack::~FGRadioStack() { void FGRadioStack::update( double lon, double lat, double elev ) { need_update = false; + // Start with the selected radials. + nav1_radial = nav1_selected_radial; + nav2_radial = nav2_selected_radial; + // nav1 FGILS ils; if ( current_ilslist->query( lon, lat, elev, nav1_freq, diff --git a/src/Cockpit/radiostack.hxx b/src/Cockpit/radiostack.hxx index ee46ee524..23701c5db 100644 --- a/src/Cockpit/radiostack.hxx +++ b/src/Cockpit/radiostack.hxx @@ -35,6 +35,8 @@ class FGRadioStack { bool nav1_inrange; bool nav1_loc; double nav1_freq; + double nav1_alt_freq; + double nav1_selected_radial; double nav1_radial; double nav1_lon; double nav1_lat; @@ -46,6 +48,8 @@ class FGRadioStack { bool nav2_inrange; bool nav2_loc; double nav2_freq; + double nav2_alt_freq; + double nav2_selected_radial; double nav2_radial; double nav2_lon; double nav2_lat; @@ -56,6 +60,8 @@ class FGRadioStack { bool adf_inrange; double adf_freq; + double adf_alt_freq; + double adf_rotation; double adf_lon; double adf_lat; double adf_elev; @@ -69,25 +75,48 @@ public: // Update nav/adf radios based on current postition void update( double lon, double lat, double elev ); + // NAV1 Setters inline void set_nav1_freq( double freq ) { nav1_freq = freq; need_update = true; } - inline void set_nav1_radial( double radial ) { - nav1_radial = radial; need_update = true; + inline void set_nav1_alt_freq( double freq ) { nav1_alt_freq = freq; } + inline void set_nav1_sel_radial( double radial ) { + nav1_selected_radial = radial; need_update = true; } + // NAV2 Setters inline void set_nav2_freq( double freq ) { nav2_freq = freq; need_update = true; } - - inline void set_nav2_radial( double radial ) { - nav2_radial = radial; need_update = true; + inline void set_nav2_alt_freq( double freq ) { nav2_alt_freq = freq; } + inline void set_nav2_sel_radial( double radial ) { + nav2_selected_radial = radial; need_update = true; } + // ADF Setters inline void set_adf_freq( double freq ) { adf_freq = freq; need_update = true; } + inline void set_adf_alt_freq( double freq ) { adf_alt_freq = freq; } + inline void set_adf_rotation( double rot ) { adf_rotation = rot; } + + + // NAV1 Accessors + inline double get_nav1_freq () { return nav1_freq; } + inline double get_nav1_alt_freq () { return nav1_alt_freq; } + inline double get_nav1_sel_radial () { return nav1_selected_radial; } + + // NAV2 Accessors + inline double get_nav2_freq () { return nav2_freq; } + inline double get_nav2_alt_freq () { return nav2_alt_freq; } + inline double get_nav2_sel_radial () { return nav2_selected_radial; } + + // ADF Accessors + inline double get_adf_freq () { return adf_freq; } + inline double get_adf_alt_freq () { return adf_alt_freq; } + inline double get_adf_rotation () { return adf_rotation; } + // Calculated values. inline bool get_nav1_inrange() const { return nav1_inrange; } inline bool get_nav1_loc() const { return nav1_loc; } inline double get_nav1_radial() const { return nav1_radial; } diff --git a/src/GUI/gui.cxx b/src/GUI/gui.cxx index 86ffd3891..321e2c393 100644 --- a/src/GUI/gui.cxx +++ b/src/GUI/gui.cxx @@ -641,7 +641,9 @@ void guiMouseFunc(int button, int updown, int x, int y) // If we're in pointer mode, let PUI // know what's going on. if (mouse_mode == MOUSE_POINTER) { - puMouse (button, updown, x,y); + if (!puMouse (button, updown, x,y)) { + current_panel.doMouseAction(button, updown, x, y); + } } // Register the new position (if it @@ -680,11 +682,6 @@ void guiFixPanel( void ) if( (toggle_pause = !t->getPause()) ) t->togglePauseMode(); - // this seems to be the only way to do this :-( - // problem is the viewport has been mucked with - xglViewport(0, 0 , (GLint)(v->winWidth), (GLint)(v->winHeight) ); - FGPanel::OurPanel->ReInit(0, 0, 1024, 768); - if(toggle_pause) t->togglePauseMode(); } diff --git a/src/Main/bfi.cxx b/src/Main/bfi.cxx index ee0e108e5..13f1b1833 100644 --- a/src/Main/bfi.cxx +++ b/src/Main/bfi.cxx @@ -39,6 +39,7 @@ #include #include