From 708fed92c851ada9dbe191b20eafa14c378ca664 Mon Sep 17 00:00:00 2001 From: Jordan Woyak Date: Tue, 5 Feb 2013 15:32:13 -0600 Subject: [PATCH] Clean up SDL includes a bit. Maybe fix an SDL2 problem. --- .../InputCommon/Src/ControllerInterface/SDL/SDL.cpp | 8 +++++++- .../InputCommon/Src/ControllerInterface/SDL/SDL.h | 12 ++---------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/Source/Core/InputCommon/Src/ControllerInterface/SDL/SDL.cpp b/Source/Core/InputCommon/Src/ControllerInterface/SDL/SDL.cpp index 5473f7bcb3..b521032e9c 100644 --- a/Source/Core/InputCommon/Src/ControllerInterface/SDL/SDL.cpp +++ b/Source/Core/InputCommon/Src/ControllerInterface/SDL/SDL.cpp @@ -325,7 +325,13 @@ bool Joystick::UpdateOutput() std::string Joystick::GetName() const { - return StripSpaces(SDL_JoystickName(m_sdl_index)); + return StripSpaces( +#if SDL_VERSION_ATLEAST(2, 0, 0) + SDL_JoystickNameForIndex(m_sdl_index) +#else + SDL_JoystickName(m_sdl_index) +#endif + ); } 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 -#ifdef _WIN32 - #include -#else - #include -#endif +#include #if SDL_VERSION_ATLEAST(1, 3, 0) #define USE_SDL_HAPTIC #endif #ifdef USE_SDL_HAPTIC - #ifdef _WIN32 - #include - #else - #include - #endif + #include #define SDL_INIT_FLAGS SDL_INIT_JOYSTICK | SDL_INIT_HAPTIC #else #define SDL_INIT_FLAGS SDL_INIT_JOYSTICK