_mouseInstrument(0),
_winx(window_x), _winy(window_y), _winw(window_w), _winh(window_h),
_width(_winw), _height(int(_winh * 0.5768 + 1)),
- _x_offset(0), _y_offset(0), _view_height(int(_winh * 0.4232))
+ _x_offset(0), _y_offset(0), _view_height(int(_winh * 0.4232)),
+ _bound(false)
{
setVisibility(fgPanelVisible());
}
*/
FGPanel::~FGPanel ()
{
- unbind();
+ if (_bound)
+ unbind();
for (instrument_list_type::iterator it = _instruments.begin();
it != _instruments.end();
it++) {
fgTie("/sim/panel/visibility", &_visibility);
fgTie("/sim/panel/x-offset", &_x_offset);
fgTie("/sim/panel/y-offset", &_y_offset);
+ _bound = true;
}
fgUntie("/sim/panel/visibility");
fgUntie("/sim/panel/x-offset");
fgUntie("/sim/panel/y-offset");
+ _bound = false;
}
////////////////////////////////////////////////////////////////////////
FGPanelTransformation::FGPanelTransformation ()
+ : table(0)
{
}
} else if (val > t->max) {
val = t->max;
}
- val = val * t->factor + t->offset;
+ if(t->table==0) {
+ val = val * t->factor + t->offset;
+ } else {
+ val = t->table->interpolate(val) * t->factor + t->offset;
+ }
switch (t->type) {
case FGPanelTransformation::XSHIFT: