Rémi Bernon : winebus.sys: Only call SDL_HapticRumbleInit if supported, as a fallback.
Alexandre Julliard
julliard at winehq.org
Mon Feb 14 15:41:31 CST 2022
Module: wine
Branch: master
Commit: ba0ce3c7b5b2e8a4963be1ad8549cbc292ad55fe
URL: https://source.winehq.org/git/wine.git/?a=commit;h=ba0ce3c7b5b2e8a4963be1ad8549cbc292ad55fe
Author: Rémi Bernon <rbernon at codeweavers.com>
Date: Mon Feb 14 17:26:16 2022 +0100
winebus.sys: Only call SDL_HapticRumbleInit if supported, as a fallback.
The SDL_HAPTIC_LEFTRIGHT effect should be preferred when available.
Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/winebus.sys/bus_sdl.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/dlls/winebus.sys/bus_sdl.c b/dlls/winebus.sys/bus_sdl.c
index eba8a959cb4..d036ec2b98e 100644
--- a/dlls/winebus.sys/bus_sdl.c
+++ b/dlls/winebus.sys/bus_sdl.c
@@ -187,11 +187,10 @@ static BOOL descriptor_add_haptic(struct sdl_device *impl)
else
{
impl->effect_support = pSDL_HapticQuery(impl->sdl_haptic);
- if (pSDL_HapticRumbleSupported(impl->sdl_haptic))
+ if (!(impl->effect_support & EFFECT_SUPPORT_HAPTICS) &&
+ pSDL_HapticRumbleSupported(impl->sdl_haptic) &&
+ pSDL_HapticRumbleInit(impl->sdl_haptic) == 0)
impl->effect_support |= WINE_SDL_HAPTIC_RUMBLE;
-
- pSDL_HapticStopAll(impl->sdl_haptic);
- pSDL_HapticRumbleInit(impl->sdl_haptic);
}
if (!(impl->effect_support & EFFECT_SUPPORT_HAPTICS) && pSDL_JoystickRumble &&
More information about the wine-cvs
mailing list