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 7845b92b8c52946c
parent 7844 97fa86ce5a2e
child 7846 70f1d63482d0
Don't bother calling SDL_SYS_HapticEffectType() at all for XInput devices.
src/haptic/windows/SDL_syshaptic.c
     1.1 --- a/src/haptic/windows/SDL_syshaptic.c	Sun Oct 20 15:40:20 2013 -0400
     1.2 +++ b/src/haptic/windows/SDL_syshaptic.c	Sun Oct 20 15:45:48 2013 -0400
     1.3 @@ -1202,10 +1202,13 @@
     1.4                          SDL_HapticEffect * base)
     1.5  {
     1.6      HRESULT ret;
     1.7 -    REFGUID type = SDL_SYS_HapticEffectType(base);
     1.8 +    REFGUID type = NULL;
     1.9  
    1.10 -    if ((type == NULL) && (!haptic->hwdata->bXInputHaptic)) {
    1.11 -        goto err_hweffect;
    1.12 +    if (!haptic->hwdata->bXInputHaptic) {
    1.13 +        type = SDL_SYS_HapticEffectType(base);
    1.14 +        if (type == NULL) {
    1.15 +            goto err_hweffect;
    1.16 +        }
    1.17      }
    1.18  
    1.19      /* Alloc the effect. */