Commit b3faad66 authored by Ivo Ivanov's avatar Ivo Ivanov Committed by Alexandre Julliard

winebus.sys: Use SDL_HAPTIC_INFINITY for the infinity durations in the SDL backend.

parent bc36b50c
...@@ -515,7 +515,7 @@ static NTSTATUS sdl_device_physical_effect_control(struct unix_device *iface, BY ...@@ -515,7 +515,7 @@ static NTSTATUS sdl_device_physical_effect_control(struct unix_device *iface, BY
pSDL_HapticStopAll(impl->sdl_haptic); pSDL_HapticStopAll(impl->sdl_haptic);
/* fallthrough */ /* fallthrough */
case PID_USAGE_OP_EFFECT_START: case PID_USAGE_OP_EFFECT_START:
pSDL_HapticRunEffect(impl->sdl_haptic, id, iterations); pSDL_HapticRunEffect(impl->sdl_haptic, id, (iterations == 0xff ? SDL_HAPTIC_INFINITY : iterations));
break; break;
case PID_USAGE_OP_EFFECT_STOP: case PID_USAGE_OP_EFFECT_STOP:
pSDL_HapticStopEffect(impl->sdl_haptic, id); pSDL_HapticStopEffect(impl->sdl_haptic, id);
...@@ -592,7 +592,7 @@ static NTSTATUS sdl_device_physical_effect_update(struct unix_device *iface, BYT ...@@ -592,7 +592,7 @@ static NTSTATUS sdl_device_physical_effect_update(struct unix_device *iface, BYT
case PID_USAGE_ET_TRIANGLE: case PID_USAGE_ET_TRIANGLE:
case PID_USAGE_ET_SAWTOOTH_UP: case PID_USAGE_ET_SAWTOOTH_UP:
case PID_USAGE_ET_SAWTOOTH_DOWN: case PID_USAGE_ET_SAWTOOTH_DOWN:
effect.periodic.length = params->duration; effect.periodic.length = (params->duration == 0xffff ? SDL_HAPTIC_INFINITY : params->duration);
effect.periodic.delay = params->start_delay; effect.periodic.delay = params->start_delay;
effect.periodic.button = params->trigger_button; effect.periodic.button = params->trigger_button;
effect.periodic.interval = params->trigger_repeat_interval; effect.periodic.interval = params->trigger_repeat_interval;
...@@ -613,7 +613,7 @@ static NTSTATUS sdl_device_physical_effect_update(struct unix_device *iface, BYT ...@@ -613,7 +613,7 @@ static NTSTATUS sdl_device_physical_effect_update(struct unix_device *iface, BYT
case PID_USAGE_ET_DAMPER: case PID_USAGE_ET_DAMPER:
case PID_USAGE_ET_INERTIA: case PID_USAGE_ET_INERTIA:
case PID_USAGE_ET_FRICTION: case PID_USAGE_ET_FRICTION:
effect.condition.length = params->duration; effect.condition.length = (params->duration == 0xffff ? SDL_HAPTIC_INFINITY : params->duration);
effect.condition.delay = params->start_delay; effect.condition.delay = params->start_delay;
effect.condition.button = params->trigger_button; effect.condition.button = params->trigger_button;
effect.condition.interval = params->trigger_repeat_interval; effect.condition.interval = params->trigger_repeat_interval;
...@@ -641,7 +641,7 @@ static NTSTATUS sdl_device_physical_effect_update(struct unix_device *iface, BYT ...@@ -641,7 +641,7 @@ static NTSTATUS sdl_device_physical_effect_update(struct unix_device *iface, BYT
break; break;
case PID_USAGE_ET_CONSTANT_FORCE: case PID_USAGE_ET_CONSTANT_FORCE:
effect.constant.length = params->duration; effect.constant.length = (params->duration == 0xffff ? SDL_HAPTIC_INFINITY : params->duration);
effect.constant.delay = params->start_delay; effect.constant.delay = params->start_delay;
effect.constant.button = params->trigger_button; effect.constant.button = params->trigger_button;
effect.constant.interval = params->trigger_repeat_interval; effect.constant.interval = params->trigger_repeat_interval;
...@@ -655,6 +655,8 @@ static NTSTATUS sdl_device_physical_effect_update(struct unix_device *iface, BYT ...@@ -655,6 +655,8 @@ static NTSTATUS sdl_device_physical_effect_update(struct unix_device *iface, BYT
effect.constant.fade_level = params->envelope.fade_level; effect.constant.fade_level = params->envelope.fade_level;
break; break;
/* According to the SDL documentation, ramp effect doesn't
* support SDL_HAPTIC_INFINITY. */
case PID_USAGE_ET_RAMP: case PID_USAGE_ET_RAMP:
effect.ramp.length = params->duration; effect.ramp.length = params->duration;
effect.ramp.delay = params->start_delay; effect.ramp.delay = params->start_delay;
......
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