]> git.mxchange.org Git - flightgear.git/commitdiff
Updates from David Megginson.
authorcurt <curt>
Tue, 15 May 2001 23:08:25 +0000 (23:08 +0000)
committercurt <curt>
Tue, 15 May 2001 23:08:25 +0000 (23:08 +0000)
src/Cockpit/panel.cxx
src/Cockpit/panel.hxx

index 5f638f44f09a3d19a5a15d07c657421ae88836e8..6825dca4ea4aba53f27daac554c54399837725ed 100644 (file)
@@ -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:
index d0a3820b9d147f154e023b4eac75748d67550002..bcc9c5959bdbfa6a90d47e29aba0ad49a62e01ed 100644 (file)
@@ -39,6 +39,7 @@
 #include <GL/glut.h>
 #include <plib/ssg.h>
 
+#include <simgear/math/interpolater.hxx>
 #include <simgear/misc/props.hxx>
 #include <simgear/timing/timestamp.hxx>
 
@@ -48,7 +49,6 @@
 
 #include <Main/fgfs.hxx>
 
-
 SG_USING_STD(vector);
 SG_USING_STD(map);
 
@@ -383,6 +383,7 @@ public:
   float max;
   float factor;
   float offset;
+  SGInterpTable * table;
 };