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

Commit

Permalink
Fixed SDL_HapticRumblePlay() maybe working because of SDL_HapticUpdat…
Browse files Browse the repository at this point in the history
…eEffect().
  • Loading branch information
philippwiesemann committed Jul 27, 2013
1 parent 732787c commit d02a1dd
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/haptic/SDL_haptic.c
Expand Up @@ -781,7 +781,6 @@ SDL_HapticRumbleInit(SDL_Haptic * haptic)
int
SDL_HapticRumblePlay(SDL_Haptic * haptic, float strength, Uint32 length)
{
int ret;
SDL_HapticPeriodic *efx;

if (!ValidHaptic(haptic)) {
Expand All @@ -804,9 +803,8 @@ SDL_HapticRumblePlay(SDL_Haptic * haptic, float strength, Uint32 length)
efx = &haptic->rumble_effect.periodic;
efx->magnitude = (Sint16)(32767.0f*strength);
efx->length = length;
ret = SDL_HapticUpdateEffect(haptic, haptic->rumble_id, &haptic->rumble_effect);
if (ret) {
return ret;
if (SDL_HapticUpdateEffect(haptic, haptic->rumble_id, &haptic->rumble_effect) < 0) {
return -1;
}

return SDL_HapticRunEffect(haptic, haptic->rumble_id, 1);
Expand Down

0 comments on commit d02a1dd

Please sign in to comment.