SDL: Fix SDL 1.2 build
Jeffrey Pfau jeffrey@endrift.com
Wed, 11 May 2016 23:09:22 -0700
2 files changed,
4 insertions(+),
1 deletions(-)
M
CHANGES
→
CHANGES
@@ -23,6 +23,7 @@ - Util: Use closesocket on Windows
- GBA Memory: Fix executing code from OBJ region of VRAM - Util: Fix socket bind addresses - All: Fix instruction tables getting zeroed when linking sometimes + - SDL: Fix SDL 1.2 build Misc: - GBA: Slightly optimize GBAProcessEvents - Qt: Add preset for DualShock 4
M
src/platform/sdl/sdl-events.c
→
src/platform/sdl/sdl-events.c
@@ -68,10 +68,12 @@ int i;
for (i = 0; i < nJoysticks; ++i) { struct SDL_JoystickCombo* joystick = SDL_JoystickListAppend(&context->joysticks); joystick->joystick = SDL_JoystickOpen(i); - joystick->id = SDL_JoystickInstanceID(joystick->joystick); joystick->index = SDL_JoystickListSize(&context->joysticks) - 1; #if SDL_VERSION_ATLEAST(2, 0, 0) + joystick->id = SDL_JoystickInstanceID(joystick->joystick); joystick->haptic = SDL_HapticOpenFromJoystick(joystick->joystick); +#else + joystick->id = SDL_JoystickIndex(joystick->joystick); #endif } }