Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Fixed linux implementation of SDL_HapticStopAll.
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbens committed Aug 24, 2008
1 parent 2ed82eb commit 7dc66ca
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/haptic/linux/SDL_syshaptic.c
Expand Up @@ -916,16 +916,18 @@ SDL_SYS_HapticUnpause(SDL_Haptic * haptic)
int
SDL_SYS_HapticStopAll(SDL_Haptic * haptic)
{
int i, ret;;
int i, ret;

/* Linux does not support this natively so we have to loop. */
for (i=0; i<haptic->neffects; i++) {
ret = SDL_SYS_HapticStopEffect(haptic, &haptic->effects[i]);
if (ret < 0) {
SDL_SetError("Haptic: Error while trying to stop all playing effects.");
return -1;
if (haptic->effects[i].hweffect != NULL) {
ret = SDL_SYS_HapticStopEffect(haptic, &haptic->effects[i]);
if (ret < 0) {
SDL_SetError("Haptic: Error while trying to stop all playing effects.");
return -1;
}
}
}

return 0;
}

Expand Down

0 comments on commit 7dc66ca

Please sign in to comment.