mirror of https://github.com/mgba-emu/mgba.git
SDL: Fix potential joystick crash in games with rumble
This commit is contained in:
parent
dc62c52faa
commit
6acc14d31b
1
CHANGES
1
CHANGES
|
@ -9,6 +9,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
|
||||||
|
|
|
@ -572,7 +572,7 @@ void mSDLHandleEvent(struct mCoreThread* context, struct mSDLPlayer* sdlContext,
|
||||||
#if SDL_VERSION_ATLEAST(2, 0, 0)
|
#if SDL_VERSION_ATLEAST(2, 0, 0)
|
||||||
static void _mSDLSetRumble(struct mRumble* rumble, int enable) {
|
static void _mSDLSetRumble(struct mRumble* rumble, int enable) {
|
||||||
struct mSDLRumble* sdlRumble = (struct mSDLRumble*) rumble;
|
struct mSDLRumble* sdlRumble = (struct mSDLRumble*) 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