Commit bcc113a7 authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

winebus.sys: Request haptics effect to stop when only when needed.

Instead of stopping them, then re-starting them when a new effect is requested. Signed-off-by: 's avatarRémi Bernon <rbernon@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent ba0ce3c7
......@@ -416,12 +416,15 @@ NTSTATUS sdl_device_haptics_start(struct unix_device *iface, UINT duration_ms,
effect.leftright.large_magnitude = rumble_intensity;
effect.leftright.small_magnitude = buzz_intensity;
if (impl->effect_support & WINE_SDL_JOYSTICK_RUMBLE)
pSDL_JoystickRumble(impl->sdl_joystick, 0, 0, 0);
else if (impl->sdl_haptic)
pSDL_HapticStopAll(impl->sdl_haptic);
if (!effect.leftright.large_magnitude && !effect.leftright.small_magnitude)
{
if (impl->effect_support & WINE_SDL_JOYSTICK_RUMBLE)
pSDL_JoystickRumble(impl->sdl_joystick, 0, 0, 0);
else if (impl->sdl_haptic)
pSDL_HapticStopAll(impl->sdl_haptic);
return STATUS_SUCCESS;
}
if (impl->effect_support & SDL_HAPTIC_LEFTRIGHT)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment