summaryrefslogtreecommitdiff
path: root/Source/Core/InputCommon/Src/ControllerInterface/SDL
diff options
context:
space:
mode:
authorskidau <skidau@gmail.com>2013-02-16 11:10:03 +1100
committerskidau <skidau@gmail.com>2013-02-16 11:10:03 +1100
commit51795d8811a014a9cb0aaac6938ab83effb8797a (patch)
treed12d65a23eec618a50ee11c6af3c0aa30476fc2e /Source/Core/InputCommon/Src/ControllerInterface/SDL
parentf26650e55bf1fc1a59c890008f00a96041b13fa8 (diff)
parent5a3435255be0271023371eb524d8955703a7b503 (diff)
Merge branch 'master' into FIFO-BP
# By Jordan Woyak (24) and others # Via Jordan Woyak (3) and others * master: (66 commits) Reduce some DI command delays. Fix DKCR hanging with DSP HLE. My other games continue to work. Video_Software: Fix ZComploc option breaking stuff. Video_Software: Fix the ZFreeze option doing nothing. Video_Software: Toggable zfreeze and early_z support for testing. Fix header guard and definitions not being set to 1 Add the option to turn on only the EGL interface to use desktop OpenGL with it. Change the ugly "no banner" banner to the sexy "X" from the website. Fix a crash in the FifoPlayer dialog. Use different reply delays for various DI commands. Fixes issue 5983. Revert "[bugfix] DX9::TextureCache: Use max_lod instead of min_lod where necessary." Fix some potential issues when blending on EFB formats without alpha. Clean up state transition tables. Disable play and record buttons if an iso was selected, but is later deselected. Disable start/play recording buttons when no iso is selected. Only delay DI and fs IPC replies. Fixes issue 5982. Fix compilation with SDL2. (based on a patch from matthewharveys) Fixes issue 5971. "Fix" using SDL from externals. Clean up SDL includes a bit. Maybe fix an SDL2 problem. Number "unknown" axes in OSX rather than call them all "unk". Revert "Only delay DI command replies." Fix "Wii Party" again. Hopefully make wiimote speaker less crappy. ...
Diffstat (limited to 'Source/Core/InputCommon/Src/ControllerInterface/SDL')
-rw-r--r--Source/Core/InputCommon/Src/ControllerInterface/SDL/SDL.cpp13
-rw-r--r--Source/Core/InputCommon/Src/ControllerInterface/SDL/SDL.h12
2 files changed, 13 insertions, 12 deletions
diff --git a/Source/Core/InputCommon/Src/ControllerInterface/SDL/SDL.cpp b/Source/Core/InputCommon/Src/ControllerInterface/SDL/SDL.cpp
index 5473f7bcb3..c5ee3af23f 100644
--- a/Source/Core/InputCommon/Src/ControllerInterface/SDL/SDL.cpp
+++ b/Source/Core/InputCommon/Src/ControllerInterface/SDL/SDL.cpp
@@ -17,6 +17,15 @@ namespace ciface
{
namespace SDL
{
+
+std::string GetJoystickName(int index)
+{
+#if SDL_VERSION_ATLEAST(2, 0, 0)
+ return SDL_JoystickNameForIndex(index);
+#else
+ return SDL_JoystickName(index);
+#endif
+}
void Init( std::vector<ControllerInterface::Device*>& devices )
{
@@ -32,7 +41,7 @@ void Init( std::vector<ControllerInterface::Device*>& devices )
SDL_Joystick* dev = SDL_JoystickOpen(i);
if (dev)
{
- Joystick* js = new Joystick(dev, i, name_counts[SDL_JoystickName(i)]++);
+ Joystick* js = new Joystick(dev, i, name_counts[GetJoystickName(i)]++);
// only add if it has some inputs/outputs
if (js->Inputs().size() || js->Outputs().size())
devices.push_back( js );
@@ -325,7 +334,7 @@ bool Joystick::UpdateOutput()
std::string Joystick::GetName() const
{
- return StripSpaces(SDL_JoystickName(m_sdl_index));
+ return StripSpaces(GetJoystickName(m_sdl_index));
}
std::string Joystick::GetSource() const
diff --git a/Source/Core/InputCommon/Src/ControllerInterface/SDL/SDL.h b/Source/Core/InputCommon/Src/ControllerInterface/SDL/SDL.h
index 139e9f232d..fa770c403d 100644
--- a/Source/Core/InputCommon/Src/ControllerInterface/SDL/SDL.h
+++ b/Source/Core/InputCommon/Src/ControllerInterface/SDL/SDL.h
@@ -5,22 +5,14 @@
#include <list>
-#ifdef _WIN32
- #include <SDL.h>
-#else
- #include <SDL/SDL.h>
-#endif
+#include <SDL.h>
#if SDL_VERSION_ATLEAST(1, 3, 0)
#define USE_SDL_HAPTIC
#endif
#ifdef USE_SDL_HAPTIC
- #ifdef _WIN32
- #include <SDL_haptic.h>
- #else
- #include <SDL/SDL_haptic.h>
- #endif
+ #include <SDL_haptic.h>
#define SDL_INIT_FLAGS SDL_INIT_JOYSTICK | SDL_INIT_HAPTIC
#else
#define SDL_INIT_FLAGS SDL_INIT_JOYSTICK