]> git.mxchange.org Git - flightgear.git/blobdiff - src/Input/FGJoystickInput.hxx
Allow using the system version of flite and the HTS engine
[flightgear.git] / src / Input / FGJoystickInput.hxx
index 1ab5a6f59ed5d82a0925319f80542cc4660ae97f..b161da9a3dc9d1c3521d9dbb7ff65cb00a6e9a3f 100644 (file)
 #ifndef _FGJOYSTICKINPUT_HXX
 #define _FGJOYSTICKINPUT_HXX
 
-#ifndef __cplusplus
-# error This library requires C++
-#endif
-
 #include "FGCommonInput.hxx"
 #include "FGButton.hxx"
+
+#include <memory> // for std::auto_ptr
 #include <simgear/structure/subsystem_mgr.hxx>
 #include <plib/js.h>
 
@@ -52,6 +50,8 @@ public:
   static const int MAX_JOYSTICK_BUTTONS = 32;
 
 private:
+    
    void _remove(bool all);
    SGPropertyNode_ptr status_node;
 
@@ -68,7 +68,7 @@ private:
     float high_threshold;
     FGButton low;
     FGButton high;
-    float interval_sec;
+    float interval_sec, delay_sec, release_delay_sec;
     double last_dt;
   };
 
@@ -79,15 +79,19 @@ private:
     joystick ();
     virtual ~joystick ();
     int jsnum;
-    jsJoystick * js;
+    std::auto_ptr<jsJoystick> plibJS;
     int naxes;
     int nbuttons;
     axis * axes;
     FGButton * buttons;
-    bool predefined;    
+    bool predefined;
+      
+    void clearAxesAndButtons();
   };
-  joystick bindings[MAX_JOYSTICKS];
-
+    
+  joystick joysticks[MAX_JOYSTICKS];
+  void updateJoystick(int index, joystick* joy, double dt);
+    
 };
 
 #endif