summaryrefslogtreecommitdiff
path: root/Source/Core/InputCommon/Src/ControllerInterface/SDL
diff options
context:
space:
mode:
authorRyan Houdek <Sonicadvance1@gmail.com>2013-11-13 16:17:42 -0600
committerRyan Houdek <Sonicadvance1@gmail.com>2013-11-13 16:17:42 -0600
commit2a23bdde6f76c0bff0906bbbee298480b52ba0c2 (patch)
tree22a7bccfb1cb25d4c9f247ca3d43904a4a6d79dc /Source/Core/InputCommon/Src/ControllerInterface/SDL
parent3c7613fc83981f9ef8efa2e4ac478af9fe23bdec (diff)
parent63a9dff3bb8c88cdc5b941db1f3813843c7a8564 (diff)
Merge branch 'master' into android-new-control-input-overlay
Conflicts: Source/Core/DolphinWX/Src/Android/ButtonManager.h
Diffstat (limited to 'Source/Core/InputCommon/Src/ControllerInterface/SDL')
-rw-r--r--Source/Core/InputCommon/Src/ControllerInterface/SDL/SDL.cpp26
-rw-r--r--Source/Core/InputCommon/Src/ControllerInterface/SDL/SDL.h32
2 files changed, 27 insertions, 31 deletions
diff --git a/Source/Core/InputCommon/Src/ControllerInterface/SDL/SDL.cpp b/Source/Core/InputCommon/Src/ControllerInterface/SDL/SDL.cpp
index 40c822c577..bcd3586dc6 100644
--- a/Source/Core/InputCommon/Src/ControllerInterface/SDL/SDL.cpp
+++ b/Source/Core/InputCommon/Src/ControllerInterface/SDL/SDL.cpp
@@ -7,18 +7,14 @@
#include <algorithm>
#ifdef _WIN32
- #if SDL_VERSION_ATLEAST(1, 3, 0)
- #pragma comment(lib, "SDL.1.3.lib")
- #else
- #pragma comment(lib, "SDL.lib")
- #endif
+#pragma comment(lib, "SDL2.lib")
#endif
namespace ciface
{
namespace SDL
{
-
+
std::string GetJoystickName(int index)
{
#if SDL_VERSION_ATLEAST(2, 0, 0)
@@ -29,7 +25,7 @@ std::string GetJoystickName(int index)
}
void Init( std::vector<Core::Device*>& devices )
-{
+{
// this is used to number the joysticks
// multiple joysticks with the same name shall get unique ids starting at 0
std::map<std::string, int> name_counts;
@@ -83,7 +79,7 @@ Joystick::Joystick(SDL_Joystick* const joystick, const int sdl_index, const unsi
// get buttons
for (u8 i = 0; i != SDL_JoystickNumButtons(m_joystick); ++i)
AddInput(new Button(i, m_joystick));
-
+
// get hats
for (u8 i = 0; i != SDL_JoystickNumHats(m_joystick); ++i)
{
@@ -155,7 +151,7 @@ Joystick::~Joystick()
{
#ifdef USE_SDL_HAPTIC
if (m_haptic)
- {
+ {
// stop/destroy all effects
SDL_HapticStopAll(m_haptic);
std::list<EffectIDState>::iterator
@@ -201,7 +197,7 @@ std::string Joystick::TriangleEffect::GetName() const
return "Triangle";
}
-void Joystick::ConstantEffect::SetState(const ControlState state)
+void Joystick::ConstantEffect::SetState(ControlState state)
{
if (state)
{
@@ -219,7 +215,7 @@ void Joystick::ConstantEffect::SetState(const ControlState state)
m_effect.changed = true;
}
-void Joystick::RampEffect::SetState(const ControlState state)
+void Joystick::RampEffect::SetState(ControlState state)
{
if (state)
{
@@ -237,7 +233,7 @@ void Joystick::RampEffect::SetState(const ControlState state)
m_effect.changed = true;
}
-void Joystick::SineEffect::SetState(const ControlState state)
+void Joystick::SineEffect::SetState(ControlState state)
{
if (state)
{
@@ -260,7 +256,7 @@ void Joystick::SineEffect::SetState(const ControlState state)
}
#ifdef SDL_HAPTIC_SQUARE
-void Joystick::SquareEffect::SetState(const ControlState state)
+void Joystick::SquareEffect::SetState(ControlState state)
{
if (state)
{
@@ -283,7 +279,7 @@ void Joystick::SquareEffect::SetState(const ControlState state)
}
#endif // defined(SDL_HAPTIC_SQUARE)
-void Joystick::TriangleEffect::SetState(const ControlState state)
+void Joystick::TriangleEffect::SetState(ControlState state)
{
if (state)
{
@@ -310,7 +306,7 @@ bool Joystick::UpdateInput()
{
// each joystick is doin this, o well
SDL_JoystickUpdate();
-
+
return true;
}
diff --git a/Source/Core/InputCommon/Src/ControllerInterface/SDL/SDL.h b/Source/Core/InputCommon/Src/ControllerInterface/SDL/SDL.h
index 9b9794c481..f1714b253e 100644
--- a/Source/Core/InputCommon/Src/ControllerInterface/SDL/SDL.h
+++ b/Source/Core/InputCommon/Src/ControllerInterface/SDL/SDL.h
@@ -43,9 +43,9 @@ private:
class Button : public Core::Device::Input
{
public:
- std::string GetName() const;
+ std::string GetName() const override;
Button(u8 index, SDL_Joystick* js) : m_js(js), m_index(index) {}
- ControlState GetState() const;
+ ControlState GetState() const override;
private:
SDL_Joystick* const m_js;
const u8 m_index;
@@ -54,9 +54,9 @@ private:
class Axis : public Core::Device::Input
{
public:
- std::string GetName() const;
+ std::string GetName() const override;
Axis(u8 index, SDL_Joystick* js, Sint16 range) : m_js(js), m_range(range), m_index(index) {}
- ControlState GetState() const;
+ ControlState GetState() const override;
private:
SDL_Joystick* const m_js;
const Sint16 m_range;
@@ -66,9 +66,9 @@ private:
class Hat : public Input
{
public:
- std::string GetName() const;
+ std::string GetName() const override;
Hat(u8 index, SDL_Joystick* js, u8 direction) : m_js(js), m_direction(direction), m_index(index) {}
- ControlState GetState() const;
+ ControlState GetState() const override;
private:
SDL_Joystick* const m_js;
const u8 m_direction;
@@ -81,7 +81,7 @@ private:
public:
std::string GetName() const;
ConstantEffect(EffectIDState& effect) : m_effect(effect) {}
- void SetState(const ControlState state);
+ void SetState(ControlState state);
private:
EffectIDState& m_effect;
};
@@ -91,7 +91,7 @@ private:
public:
std::string GetName() const;
RampEffect(EffectIDState& effect) : m_effect(effect) {}
- void SetState(const ControlState state);
+ void SetState(ControlState state);
private:
EffectIDState& m_effect;
};
@@ -101,7 +101,7 @@ private:
public:
std::string GetName() const;
SineEffect(EffectIDState& effect) : m_effect(effect) {}
- void SetState(const ControlState state);
+ void SetState(ControlState state);
private:
EffectIDState& m_effect;
};
@@ -112,7 +112,7 @@ private:
public:
std::string GetName() const;
SquareEffect(EffectIDState& effect) : m_effect(effect) {}
- void SetState(const ControlState state);
+ void SetState(ControlState state);
private:
EffectIDState& m_effect;
};
@@ -123,22 +123,22 @@ private:
public:
std::string GetName() const;
TriangleEffect(EffectIDState& effect) : m_effect(effect) {}
- void SetState(const ControlState state);
+ void SetState(ControlState state);
private:
EffectIDState& m_effect;
};
#endif
public:
- bool UpdateInput();
- bool UpdateOutput();
+ bool UpdateInput() override;
+ bool UpdateOutput() override;
Joystick(SDL_Joystick* const joystick, const int sdl_index, const unsigned int index);
~Joystick();
- std::string GetName() const;
- int GetId() const;
- std::string GetSource() const;
+ std::string GetName() const override;
+ int GetId() const override;
+ std::string GetSource() const override;
private:
SDL_Joystick* const m_joystick;