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@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Rémi Bernon 2022-02-14 17:26:16 +01:00 committed by Alexandre Julliard
parent dfbfe0ee44
commit ba0ce3c7b5
1 changed files with 3 additions and 4 deletions

View File

@ -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 &&