[PATCH] dinput: Log effect directions, and use effective flags

Andrew Eikum aeikum at codeweavers.com
Wed Dec 11 09:28:26 CST 2019


From: Bernat Arlandis <berarma at hotmail.com>

Signed-off-by: Andrew Eikum <aeikum at codeweavers.com>
---
 dlls/dinput/effect_linuxinput.c | 4 ++--
 dlls/dinput/joystick.c          | 6 ++++++
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/dlls/dinput/effect_linuxinput.c b/dlls/dinput/effect_linuxinput.c
index 4b2f317ce37..cc2df3ce876 100644
--- a/dlls/dinput/effect_linuxinput.c
+++ b/dlls/dinput/effect_linuxinput.c
@@ -489,8 +489,6 @@ static HRESULT WINAPI LinuxInputEffectImpl_SetParameters(
 
     TRACE("(this=%p,%p,%d)\n", This, peff, dwFlags);
 
-    dump_DIEFFECT(peff, &This->guid, dwFlags);
-
     if ((dwFlags & ~DIEP_NORESTART & ~DIEP_NODOWNLOAD & ~DIEP_START) == 0) {
 	/* set everything */
 	dwFlags = DIEP_AXES | DIEP_DIRECTION | DIEP_DURATION | DIEP_ENVELOPE |
@@ -498,6 +496,8 @@ static HRESULT WINAPI LinuxInputEffectImpl_SetParameters(
 	    DIEP_TRIGGERREPEATINTERVAL | DIEP_TYPESPECIFICPARAMS;
     }
 
+    dump_DIEFFECT(peff, &This->guid, dwFlags);
+
     if (dwFlags & DIEP_AXES) {
 	/* the linux input effect system only supports one or two axes */
 	if (peff->cAxes > 2)
diff --git a/dlls/dinput/joystick.c b/dlls/dinput/joystick.c
index 2220b5d576c..01611b0e444 100644
--- a/dlls/dinput/joystick.c
+++ b/dlls/dinput/joystick.c
@@ -207,6 +207,12 @@ void dump_DIEFFECT(LPCDIEFFECT eff, REFGUID guid, DWORD dwFlags)
     TRACE("  - dwTriggerButton: %d\n", eff->dwTriggerButton);
     TRACE("  - dwTriggerRepeatInterval: %d\n", eff->dwTriggerRepeatInterval);
     TRACE("  - rglDirection: %p\n", eff->rglDirection);
+    if (dwFlags & DIEP_DIRECTION) {
+        TRACE("    ");
+        for (i = 0; i < eff->cAxes; ++i)
+            TRACE("%d ", eff->rglDirection[i]);
+        TRACE("\n");
+    }
     TRACE("  - cbTypeSpecificParams: %d\n", eff->cbTypeSpecificParams);
     TRACE("  - lpvTypeSpecificParams: %p\n", eff->lpvTypeSpecificParams);
 
-- 
2.24.1




More information about the wine-devel mailing list