SDL: Fix SDL 1.2 build

This commit is contained in:
Jeffrey Pfau 2016-05-11 23:09:22 -07:00
parent f2829eef01
commit 9c6b81841e
2 changed files with 4 additions and 1 deletions

View File

@ -18,6 +18,7 @@ Bugfixes:
- 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

View File

@ -63,10 +63,12 @@ bool GBASDLInitEvents(struct GBASDLEvents* context) {
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
}
}