From 92b6a9800d580689663b7c1985021ca68989100c Mon Sep 17 00:00:00 2001 From: ergo720 <45463469+ergo720@users.noreply.github.com> Date: Sat, 19 Sep 2020 20:27:01 +0200 Subject: [PATCH] Fix an issue with sdl input binding --- src/common/input/InputDevice.h | 25 ------------------------- src/common/input/SdlJoystick.cpp | 3 ++- 2 files changed, 2 insertions(+), 26 deletions(-) diff --git a/src/common/input/InputDevice.h b/src/common/input/InputDevice.h index be42e4cf3..75d2d8210 100644 --- a/src/common/input/InputDevice.h +++ b/src/common/input/InputDevice.h @@ -146,31 +146,6 @@ public: m_Bindings[XButton] = Control; } -protected: - class FullAnalogSurface : public Input - { - public: - FullAnalogSurface(Input* Low, Input* High) : m_Low(*Low), m_High(*High) {} - ControlState GetState() const override - { - return (1 + m_High.GetState() - m_Low.GetState()) / 2; - } - - std::string GetName() const override { return m_Low.GetName() + *m_High.GetName().rbegin(); } - - private: - Input& m_Low; - Input& m_High; - }; - - void AddAnalogInputs(Input* Low, Input* High) - { - AddInput(Low); - AddInput(High); - AddInput(new FullAnalogSurface(Low, High)); - AddInput(new FullAnalogSurface(High, Low)); - } - private: // arbitrary ID assigned by to the device int m_ID; diff --git a/src/common/input/SdlJoystick.cpp b/src/common/input/SdlJoystick.cpp index 33e19a747..0fe4ee835 100644 --- a/src/common/input/SdlJoystick.cpp +++ b/src/common/input/SdlJoystick.cpp @@ -301,7 +301,8 @@ namespace Sdl // get axes for (i = 0; i != NumAxes; ++i) { // each axis gets a negative and a positive input instance associated with it - AddAnalogInputs(new Axis(i, m_Joystick, -32768), new Axis(i, m_Joystick, 32767)); + AddInput(new Axis(i, m_Joystick, -32768)); + AddInput(new Axis(i, m_Joystick, 32767)); } // try to get supported ff effects