Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Clean up SDL includes a bit. Maybe fix an SDL2 problem.
  • Loading branch information
jordan-woyak committed Feb 5, 2013
1 parent f506783 commit 708fed9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
8 changes: 7 additions & 1 deletion Source/Core/InputCommon/Src/ControllerInterface/SDL/SDL.cpp
Expand Up @@ -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
Expand Down
12 changes: 2 additions & 10 deletions Source/Core/InputCommon/Src/ControllerInterface/SDL/SDL.h
Expand Up @@ -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
Expand Down

0 comments on commit 708fed9

Please sign in to comment.