mirror of https://github.com/mgba-emu/mgba.git
SDL: Fix potential joystick crash in games with rumble
This commit is contained in:
parent
9c73cf536a
commit
d7f530ddcf
1
CHANGES
1
CHANGES
|
@ -7,6 +7,7 @@ Bugfixes:
|
||||||
- OpenGL: Correct boolean vector strcmp strings for uniforms
|
- OpenGL: Correct boolean vector strcmp strings for uniforms
|
||||||
- Wii: Fix tilting direction
|
- Wii: Fix tilting direction
|
||||||
- SDL: Fix joystick initialization on BS
|
- SDL: Fix joystick initialization on BS
|
||||||
|
- SDL: Fix potential joystick crash in games with rumble
|
||||||
Misc:
|
Misc:
|
||||||
- GBA: Slightly optimize GBAProcessEvents
|
- GBA: Slightly optimize GBAProcessEvents
|
||||||
- Qt: Add preset for DualShock 4
|
- Qt: Add preset for DualShock 4
|
||||||
|
|
|
@ -593,7 +593,7 @@ void GBASDLHandleEvent(struct GBAThread* context, struct GBASDLPlayer* sdlContex
|
||||||
#if SDL_VERSION_ATLEAST(2, 0, 0)
|
#if SDL_VERSION_ATLEAST(2, 0, 0)
|
||||||
static void _GBASDLSetRumble(struct GBARumble* rumble, int enable) {
|
static void _GBASDLSetRumble(struct GBARumble* rumble, int enable) {
|
||||||
struct GBASDLRumble* sdlRumble = (struct GBASDLRumble*) rumble;
|
struct GBASDLRumble* sdlRumble = (struct GBASDLRumble*) rumble;
|
||||||
if (!sdlRumble->p->joystick->haptic || !SDL_HapticRumbleSupported(sdlRumble->p->joystick->haptic)) {
|
if (!sdlRumble->p->joystick || !sdlRumble->p->joystick->haptic || !SDL_HapticRumbleSupported(sdlRumble->p->joystick->haptic)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
sdlRumble->level += enable;
|
sdlRumble->level += enable;
|
||||||
|
|
Loading…
Reference in New Issue