#include <plib/fnt.h>
#include <simgear/debug/logstream.hxx>
-#include <simgear/misc/fgpath.hxx>
+#include <simgear/misc/sg_path.hxx>
#include <Main/globals.hxx>
#include <Main/fg_props.hxx>
ssgTexture * texture = _textureMap[relativePath];
if (texture == 0) {
cerr << "Texture " << relativePath << " does not yet exist" << endl;
- FGPath tpath(globals->get_fg_root());
+ SGPath tpath(globals->get_fg_root());
tpath.append(relativePath);
texture = new ssgTexture((char *)tpath.c_str(), false, false);
_textureMap[relativePath] = texture;
_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: