Don't bother calling SDL_SYS_HapticEffectType() at all for XInput devices.
authorRyan C. Gordon <icculus@icculus.org>
Sun, 20 Oct 2013 15:45:48 -0400
changeset 7845 b92b8c52946c
parent 7844 97fa86ce5a2e
child 7846 70f1d63482d0
Don't bother calling SDL_SYS_HapticEffectType() at all for XInput devices.
src/haptic/windows/SDL_syshaptic.c
--- a/src/haptic/windows/SDL_syshaptic.c	Sun Oct 20 15:40:20 2013 -0400
+++ b/src/haptic/windows/SDL_syshaptic.c	Sun Oct 20 15:45:48 2013 -0400
@@ -1202,10 +1202,13 @@
                         SDL_HapticEffect * base)
 {
     HRESULT ret;
-    REFGUID type = SDL_SYS_HapticEffectType(base);
+    REFGUID type = NULL;
 
-    if ((type == NULL) && (!haptic->hwdata->bXInputHaptic)) {
-        goto err_hweffect;
+    if (!haptic->hwdata->bXInputHaptic) {
+        type = SDL_SYS_HapticEffectType(base);
+        if (type == NULL) {
+            goto err_hweffect;
+        }
     }
 
     /* Alloc the effect. */