From b1af3904c863719711337612e2a59eb76c5e34a0 Mon Sep 17 00:00:00 2001 From: curt Date: Tue, 15 May 2001 23:08:25 +0000 Subject: [PATCH] Updates from David Megginson. --- src/Cockpit/panel.cxx | 7 ++++++- src/Cockpit/panel.hxx | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Cockpit/panel.cxx b/src/Cockpit/panel.cxx index 5f638f44f..6825dca4e 100644 --- a/src/Cockpit/panel.cxx +++ b/src/Cockpit/panel.cxx @@ -476,6 +476,7 @@ FGToggleAction::doAction () //////////////////////////////////////////////////////////////////////// FGPanelTransformation::FGPanelTransformation () + : table(0) { } @@ -664,7 +665,11 @@ FGInstrumentLayer::transform () const } 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: diff --git a/src/Cockpit/panel.hxx b/src/Cockpit/panel.hxx index d0a3820b9..bcc9c5959 100644 --- a/src/Cockpit/panel.hxx +++ b/src/Cockpit/panel.hxx @@ -39,6 +39,7 @@ #include #include +#include #include #include @@ -48,7 +49,6 @@ #include
- SG_USING_STD(vector); SG_USING_STD(map); @@ -383,6 +383,7 @@ public: float max; float factor; float offset; + SGInterpTable * table; };