Skip to content

Commit

Permalink
Don't bother calling SDL_SYS_HapticEffectType() at all for XInput dev…
Browse files Browse the repository at this point in the history
…ices.
  • Loading branch information
icculus committed Oct 20, 2013
1 parent 5e74299 commit 54dce3f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/haptic/windows/SDL_syshaptic.c
Expand Up @@ -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. */
Expand Down

0 comments on commit 54dce3f

Please sign in to comment.