From fba3abe4cf3342ac609d31eec38b1cd1e1a49b1b Mon Sep 17 00:00:00 2001 From: comex Date: Sat, 20 Dec 2014 00:21:40 -0500 Subject: [PATCH] Manually revert d34418100be19fdbdf112febde3303edd48c9247 --- .../ControllerInterface/SDL/SDL.cpp | 91 ------------------- .../InputCommon/ControllerInterface/SDL/SDL.h | 26 ------ 2 files changed, 117 deletions(-) diff --git a/Source/Core/InputCommon/ControllerInterface/SDL/SDL.cpp b/Source/Core/InputCommon/ControllerInterface/SDL/SDL.cpp index a46a08100d..4402b286c3 100644 --- a/Source/Core/InputCommon/ControllerInterface/SDL/SDL.cpp +++ b/Source/Core/InputCommon/ControllerInterface/SDL/SDL.cpp @@ -126,21 +126,6 @@ Joystick::Joystick(SDL_Joystick* const joystick, const int sdl_index, const unsi // ramp effect if (supported_effects & SDL_HAPTIC_RAMP) AddOutput(new RampEffect(m_haptic)); - - // sine effect - if (supported_effects & SDL_HAPTIC_SINE) - AddOutput(new SineEffect(m_haptic)); - -#ifdef SDL_HAPTIC_SQUARE - // square effect - if (supported_effects & SDL_HAPTIC_SQUARE) - AddOutput(new SquareEffect(m_haptic)); - -#endif // defined(SDL_HAPTIC_SQUARE) - - // triangle effect - if (supported_effects & SDL_HAPTIC_TRIANGLE) - AddOutput(new TriangleEffect(m_haptic)); } #endif @@ -193,23 +178,6 @@ std::string Joystick::RampEffect::GetName() const return "Ramp"; } -std::string Joystick::SineEffect::GetName() const -{ - return "Sine"; -} - -#ifdef SDL_HAPTIC_SQUARE -std::string Joystick::SquareEffect::GetName() const -{ - return "Square"; -} -#endif // defined(SDL_HAPTIC_SQUARE) - -std::string Joystick::TriangleEffect::GetName() const -{ - return "Triangle"; -} - void Joystick::ConstantEffect::SetState(ControlState state) { if (state) @@ -241,65 +209,6 @@ void Joystick::RampEffect::SetState(ControlState state) m_effect.ramp.start = (Sint16)(state * 0x7FFF); Update(); } - -void Joystick::SineEffect::SetState(ControlState state) -{ - if (state) - { - m_effect.type = SDL_HAPTIC_SINE; - m_effect.periodic.length = 250; - } - else - { - m_effect.type = 0; - } - - m_effect.periodic.period = 5; - m_effect.periodic.magnitude = (Sint16)(state * 0x5000); - m_effect.periodic.attack_length = 0; - m_effect.periodic.fade_length = 500; - Update(); -} - -#ifdef SDL_HAPTIC_SQUARE -void Joystick::SquareEffect::SetState(ControlState state) -{ - if (state) - { - m_effect.type = SDL_HAPTIC_SQUARE; - m_effect.periodic.length = 250; - } - else - { - m_effect.type = 0; - } - - m_effect.periodic.period = 5; - m_effect.periodic.magnitude = state * 0x5000; - m_effect.periodic.attack_length = 0; - m_effect.periodic.fade_length = 100; - Update(); -} -#endif // defined(SDL_HAPTIC_SQUARE) - -void Joystick::TriangleEffect::SetState(ControlState state) -{ - if (state) - { - m_effect.type = SDL_HAPTIC_TRIANGLE; - m_effect.periodic.length = 250; - } - else - { - m_effect.type = 0; - } - - m_effect.periodic.period = 5; - m_effect.periodic.magnitude = (Sint16)(state * 0x5000); - m_effect.periodic.attack_length = 0; - m_effect.periodic.fade_length = 100; - Update(); -} #endif void Joystick::UpdateInput() diff --git a/Source/Core/InputCommon/ControllerInterface/SDL/SDL.h b/Source/Core/InputCommon/ControllerInterface/SDL/SDL.h index dc4c52063f..dc449e9ab5 100644 --- a/Source/Core/InputCommon/ControllerInterface/SDL/SDL.h +++ b/Source/Core/InputCommon/ControllerInterface/SDL/SDL.h @@ -98,32 +98,6 @@ private: std::string GetName() const override; void SetState(ControlState state) override; }; - - class SineEffect : public HapticEffect - { - public: - SineEffect(SDL_Haptic* haptic) : HapticEffect(haptic) {} - std::string GetName() const override; - void SetState(ControlState state) override; - }; - -#ifdef SDL_HAPTIC_SQUARE - class SquareEffect : public HapticEffect - { - public: - SquareEffect(SDL_Haptic* haptic) : HapticEffect(haptic) {} - std::string GetName() const; - void SetState(ControlState state); - }; -#endif // defined(SDL_HAPTIC_SQUARE) - - class TriangleEffect : public HapticEffect - { - public: - TriangleEffect(SDL_Haptic* haptic) : HapticEffect(haptic) {} - std::string GetName() const override; - void SetState(ControlState state) override; - }; #endif public: