summaryrefslogtreecommitdiff
path: root/Source/Core/InputCommon/ControllerInterface/SDL/SDL.cpp
diff options
context:
space:
mode:
authorKarol Herbst <git@karolherbst.de>2015-01-08 13:37:06 +0100
committerKarol Herbst <git@karolherbst.de>2015-01-08 13:37:06 +0100
commit17ad68ff86c7508f4e8a82ae65f31bc2d59cee79 (patch)
treef1b334a2f56f9ab54cfe1567772095b61f946a81 /Source/Core/InputCommon/ControllerInterface/SDL/SDL.cpp
parent306c8d14db47a7b3c8d0bd2a3877772bcc8ce21d (diff)
SDL: more global memset
Diffstat (limited to 'Source/Core/InputCommon/ControllerInterface/SDL/SDL.cpp')
-rw-r--r--Source/Core/InputCommon/ControllerInterface/SDL/SDL.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/Source/Core/InputCommon/ControllerInterface/SDL/SDL.cpp b/Source/Core/InputCommon/ControllerInterface/SDL/SDL.cpp
index b75670394c..8ed142740e 100644
--- a/Source/Core/InputCommon/ControllerInterface/SDL/SDL.cpp
+++ b/Source/Core/InputCommon/ControllerInterface/SDL/SDL.cpp
@@ -205,9 +205,14 @@ std::string Joystick::LeftRightEffect::GetName() const
return "LeftRight";
}
-void Joystick::ConstantEffect::SetState(ControlState state)
+void Joystick::HapticEffect::SetState(ControlState state)
{
memset(&m_effect, 0, sizeof(m_effect));
+ _SetState(state);
+}
+
+void Joystick::ConstantEffect::_SetState(ControlState state)
+{
if (state)
{
m_effect.type = SDL_HAPTIC_CONSTANT;
@@ -222,9 +227,8 @@ void Joystick::ConstantEffect::SetState(ControlState state)
Update();
}
-void Joystick::RampEffect::SetState(ControlState state)
+void Joystick::RampEffect::_SetState(ControlState state)
{
- memset(&m_effect, 0, sizeof(m_effect));
if (state)
{
m_effect.type = SDL_HAPTIC_RAMP;
@@ -239,9 +243,8 @@ void Joystick::RampEffect::SetState(ControlState state)
Update();
}
-void Joystick::SineEffect::SetState(ControlState state)
+void Joystick::SineEffect::_SetState(ControlState state)
{
- memset(&m_effect, 0, sizeof(m_effect));
if (state)
{
m_effect.type = SDL_HAPTIC_SINE;
@@ -261,9 +264,8 @@ void Joystick::SineEffect::SetState(ControlState state)
Update();
}
-void Joystick::TriangleEffect::SetState(ControlState state)
+void Joystick::TriangleEffect::_SetState(ControlState state)
{
- memset(&m_effect, 0, sizeof(m_effect));
if (state)
{
m_effect.type = SDL_HAPTIC_TRIANGLE;
@@ -283,9 +285,8 @@ void Joystick::TriangleEffect::SetState(ControlState state)
Update();
}
-void Joystick::LeftRightEffect::SetState(ControlState state)
+void Joystick::LeftRightEffect::_SetState(ControlState state)
{
- memset(&m_effect, 0, sizeof(m_effect));
if (state)
{
m_effect.type = SDL_HAPTIC_LEFTRIGHT;