From: Tyson Whitehead twhitehead@gmail.com
The max value of a INT16 is 32768, which is less than the 36000 required for a full rotation angle. Change type to INT32 as that is what the underlying SDL paramerter is.
Rotate by +270 instead of -90 to elimante negative value fixup too. --- dlls/winebus.sys/bus_sdl.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/dlls/winebus.sys/bus_sdl.c b/dlls/winebus.sys/bus_sdl.c index 91cb785fdff..ddc32f7243f 100644 --- a/dlls/winebus.sys/bus_sdl.c +++ b/dlls/winebus.sys/bus_sdl.c @@ -652,7 +652,7 @@ static NTSTATUS sdl_device_physical_effect_update(struct unix_device *iface, BYT struct sdl_device *impl = impl_from_unix_device(iface); int id = impl->effect_ids[index]; SDL_HapticEffect effect = {0}; - INT16 direction; + INT32 direction; NTSTATUS status;
TRACE("iface %p, index %u, params %p.\n", iface, index, params); @@ -662,8 +662,7 @@ static NTSTATUS sdl_device_physical_effect_update(struct unix_device *iface, BYT
/* The first direction we get from PID is in polar coordinate space, so we need to * remove 90° to make it match SDL spherical coordinates. */ - direction = (params->direction[0] - 9000) % 36000; - if (direction < 0) direction += 36000; + direction = (params->direction[0] + (36000-9000)) % 36000;
switch (params->effect_type) {