]> git.mxchange.org Git - flightgear.git/blobdiff - src/Input/input.cxx
Added a property output feature to ControlMap that allows arbitrary binding
[flightgear.git] / src / Input / input.cxx
index 32f82bfcae3a3811772ac7f96e560afb67b0430e..06122defdc0dd2380a1306ddd1e379d2740c3bca 100644 (file)
 #include <Cockpit/panel_io.hxx>
 #include <GUI/gui.h>
 
-#ifndef FG_OLD_WEATHER
-#  include <WeatherCM/FGLocalWeatherDatabase.h>
-#else
-#  include <Weather/weather.hxx>
-#endif
-
 #include <Main/globals.hxx>
 #include <Main/fg_props.hxx>
-#include <Main/options.hxx>
 
 #include "input.hxx"
 
@@ -103,8 +96,8 @@ FGBinding::FGBinding (const SGPropertyNode * node)
 
 FGBinding::~FGBinding ()
 {
-  delete _arg;                 // Delete the saved arguments
-  delete _command_state;       // Delete the saved command state
+//   delete _arg;                      // Delete the saved arguments
+//   delete _command_state;    // Delete the saved command state
 }
 
 void
@@ -181,7 +174,7 @@ FGInput::FGInput ()
 
 FGInput::~FGInput ()
 {
-  // TODO: delete all FGBinding objects explicitly
+  // no op
 }
 
 void
@@ -204,7 +197,7 @@ FGInput::unbind ()
 }
 
 void 
-FGInput::update ()
+FGInput::update (int dt)
 {
   _update_keyboard();
   _update_joystick();
@@ -632,6 +625,70 @@ FGInput::_find_key_bindings (unsigned int k, int modifiers)
 }
 
 
+\f
+////////////////////////////////////////////////////////////////////////
+// Implementation of FGInput::button.
+////////////////////////////////////////////////////////////////////////
+
+FGInput::button::button ()
+  : is_repeatable(false),
+    last_state(-1)
+{
+}
+
+FGInput::button::~button ()
+{
+                               // FIXME: memory leak
+//   for (int i = 0; i < FG_MOD_MAX; i++)
+//     for (int j = 0; i < bindings[i].size(); j++)
+//       delete bindings[i][j];
+}
+
+
+\f
+////////////////////////////////////////////////////////////////////////
+// Implementation of FGInput::axis.
+////////////////////////////////////////////////////////////////////////
+
+FGInput::axis::axis ()
+  : last_value(9999999),
+    tolerance(0.002),
+    low_threshold(-0.9),
+    high_threshold(0.9)
+{
+}
+
+FGInput::axis::~axis ()
+{
+//   for (int i = 0; i < FG_MOD_MAX; i++)
+//     for (int j = 0; i < bindings[i].size(); j++)
+//       delete bindings[i][j];
+}
+
+
+\f
+////////////////////////////////////////////////////////////////////////
+// Implementation of FGInput::joystick.
+////////////////////////////////////////////////////////////////////////
+
+FGInput::joystick::joystick ()
+{
+}
+
+FGInput::joystick::~joystick ()
+{
+//   delete js;
+//   delete[] axes;
+//   delete[] buttons;
+}
+
+
+\f
+////////////////////////////////////////////////////////////////////////
+// Implementation of GLUT callbacks.
+////////////////////////////////////////////////////////////////////////
+
+
 /**
  * Construct the modifiers.
  */