all repos — mgba @ 4375e7029f0c872b5686ff43d3b55063c301e939

mGBA Game Boy Advance Emulator

SDL: Fix SDL 1.2 build
Jeffrey Pfau jeffrey@endrift.com
Wed, 11 May 2016 23:09:22 -0700
commit

4375e7029f0c872b5686ff43d3b55063c301e939

parent

98922b7a87f6d18bc0d63bc2fd9db092ee4b8318

2 files changed, 4 insertions(+), 1 deletions(-)

jump to
M CHANGESCHANGES

@@ -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.csrc/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 } }