dinput: Support INFINITE as number of effect iterations

Marcel Hasler mahasler at gmail.com
Thu Jan 26 13:58:22 CST 2012


According to the DirectX reference, IDirectInputEffect::Start accepts
INFINITE (aka -1) for the number of iterations. However, passing -1 to
Linux via input_event results in no effect being played at all. This
patch sets the number of iterations to the maximum signed value
allowed if INFINITE is passed.

This fixes bug 29712.
-------------- next part --------------
--- wine-1.3.37/dlls/dinput/effect_linuxinput.c	2012-01-13 20:38:53.000000000 +0100
+++ wine-1.3.37-fixed/dlls/dinput/effect_linuxinput.c	2012-01-26 17:54:29.843901143 +0100
@@ -518,7 +518,7 @@
 
     event.type = EV_FF;
     event.code = This->effect.id;
-    event.value = dwIterations;
+    event.value = (dwIterations == INFINITE) ? 0x7fff : dwIterations;
     if (write(*(This->fd), &event, sizeof(event)) == -1) {
 	FIXME("Unable to write event.  Assuming device disconnected.\n");
 	return DIERR_INPUTLOST;


More information about the wine-patches mailing list