浏览代码

Don't bother calling SDL_SYS_HapticEffectType() at all for XInput devices.

Ryan C. Gordon 12 年之前
父节点
当前提交
54dce3f53a
共有 1 个文件被更改,包括 6 次插入3 次删除
  1. 6 3
      src/haptic/windows/SDL_syshaptic.c

+ 6 - 3
src/haptic/windows/SDL_syshaptic.c

@@ -1202,10 +1202,13 @@ SDL_SYS_HapticNewEffect(SDL_Haptic * haptic, struct haptic_effect *effect,
                         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. */