X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FInput%2Finput.cxx;h=06122defdc0dd2380a1306ddd1e379d2740c3bca;hb=ab381e5c013292935c598dbe80bdd092bcbdd3ff;hp=32f82bfcae3a3811772ac7f96e560afb67b0430e;hpb=dd440e78292ccda6423aff9adfe63915be2c0a65;p=flightgear.git diff --git a/src/Input/input.cxx b/src/Input/input.cxx index 32f82bfca..06122defd 100644 --- a/src/Input/input.cxx +++ b/src/Input/input.cxx @@ -55,15 +55,8 @@ #include #include -#ifndef FG_OLD_WEATHER -# include -#else -# include -#endif - #include
#include
-#include
#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) } + +//////////////////////////////////////////////////////////////////////// +// 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]; +} + + + +//////////////////////////////////////////////////////////////////////// +// 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]; +} + + + +//////////////////////////////////////////////////////////////////////// +// Implementation of FGInput::joystick. +//////////////////////////////////////////////////////////////////////// + +FGInput::joystick::joystick () +{ +} + +FGInput::joystick::~joystick () +{ +// delete js; +// delete[] axes; +// delete[] buttons; +} + + + +//////////////////////////////////////////////////////////////////////// +// Implementation of GLUT callbacks. +//////////////////////////////////////////////////////////////////////// + + /** * Construct the modifiers. */