]> git.mxchange.org Git - flightgear.git/blobdiff - src/Cockpit/panel.hxx
fix ugly aliasing effects in moving scales (caused by integer calculation
[flightgear.git] / src / Cockpit / panel.hxx
index 01ccc469db7562c1e0e50d9d774f95acdd266d22..04f7352334a26a48dbe01337b8f5b2905dd42824 100644 (file)
 //  WITHOUT ANY WARRANTY; without even the implied warranty of
 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 //  General Public License for more details.
-// 
+//
 //  You should have received a copy of the GNU General Public License
 //  along with this program; if not, write to the Free Software
-//  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+//  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 //
 //  $Id$
 
@@ -34,7 +34,6 @@
 #  include <windows.h>
 #endif
 
-#include <plib/ssg.h>
 #include <plib/fnt.h>
 
 #include <simgear/compiler.h>
 
 #include <Main/fg_props.hxx>
 #include <Input/input.hxx>
+#include <Instrumentation/dclgps.hxx>
 
 SG_USING_STD(vector);
 SG_USING_STD(map);
 
+
+class ssgTexture;
 class FGPanelInstrument;
 
 
@@ -182,6 +184,8 @@ public:
   virtual bool doMouseAction (int button, int updown, int x, int y);
   virtual bool doLocalMouseAction(int button, int updown, int x, int y);
 
+  virtual void setDepthTest (bool enable);
+
 private:
   void setupVirtualCockpit();
   void cleanupVirtualCockpit();
@@ -195,19 +199,20 @@ private:
   int _height;
   int _view_height;
 
-  SGPropertyNode * _visibility;
-  SGPropertyNode * _x_offset;
-  SGPropertyNode * _y_offset;
-  SGPropertyNode * _jitter;
-  SGPropertyNode * _flipx;
+  SGPropertyNode_ptr _visibility;
+  SGPropertyNode_ptr _x_offset;
+  SGPropertyNode_ptr _y_offset;
+  SGPropertyNode_ptr _jitter;
+  SGPropertyNode_ptr _flipx;
 
-  const SGPropertyNode * _xsize_node;
-  const SGPropertyNode * _ysize_node;
+  SGConstPropertyNode_ptr _xsize_node;
+  SGConstPropertyNode_ptr _ysize_node;
   
   ssgTexture * _bg;
   ssgTexture * _mbg[8];
                                // List of instruments in panel.
   instrument_list_type _instruments;
+  bool _enable_depth_test;
 };
 
 
@@ -298,7 +303,7 @@ public:
   virtual ~FGPanelTransformation ();
 
   Type type;
-  const SGPropertyNode * node;
+  SGConstPropertyNode_ptr node;
   float min;
   float max;
   bool has_mod;
@@ -413,7 +418,7 @@ public:
 
                                // Transfer pointer ownership!!
   virtual int addLayer (FGInstrumentLayer *layer);
-  virtual int addLayer (FGCroppedTexture &texture, int w = -1, int h = -1);
+  virtual int addLayer (const FGCroppedTexture &texture, int w = -1, int h = -1);
 
                                // Transfer pointer ownership!!
   virtual void addTransformation (FGPanelTransformation * transformation);
@@ -424,6 +429,28 @@ protected:
 };
 
 
+/**
+ * An empty-shell instrument that exists soley in
+ * order to redirect commands from the panel to a
+ * complex instrument inherited from SGSubsystem.
+ *
+ * Currently the only complex instrument is the KLN89,
+ * which we've hardwired this to for now.
+ */
+class FGSpecialInstrument : public FGPanelInstrument
+{
+public:
+  FGSpecialInstrument(DCLGPS* sb);
+  //FGSpecialInstrument (int x, int y, int w, int h);
+  virtual ~FGSpecialInstrument ();
+
+  virtual void draw ();
+  
+protected:
+  DCLGPS* complex;
+};
+
+
 /**
  * An instrument layer containing a group of sublayers.
  *
@@ -463,11 +490,14 @@ public:
   virtual void setTexture (const FGCroppedTexture &texture) {
     _texture = texture;
   }
-  virtual FGCroppedTexture &getTexture () { return _texture; }
   virtual const FGCroppedTexture &getTexture () const { return _texture; }
+  virtual FGCroppedTexture *getTexture() { return &_texture; }
+
+  void setEmissive(bool e) { _emissive = e; }
 
 private:
-  mutable FGCroppedTexture _texture;
+  FGCroppedTexture _texture;
+  bool _emissive;
 };
 
 
@@ -492,16 +522,18 @@ public:
   public:
     Chunk (const string &text, const string &fmt = "%s");
     Chunk (ChunkType type, const SGPropertyNode * node,
-          const string &fmt = "", float mult = 1.0, float offs = 0.0);
+          const string &fmt = "", float mult = 1.0, float offs = 0.0,
+           bool truncation = false);
 
     const char * getValue () const;
   private:
     ChunkType _type;
     string _text;
-    const SGPropertyNode * _node;
+    SGConstPropertyNode_ptr _node;
     string _fmt;
     float _mult;
     float _offs;
+    bool _trunc;
     mutable char _buf[1024];
   };