Fixed SDL_HapticRumblePlay() maybe working because of SDL_HapticUpdateEffect().
This commit is contained in:
parent
eab7f43fc2
commit
c2d852cb79
1 changed files with 2 additions and 4 deletions
|
@ -781,7 +781,6 @@ SDL_HapticRumbleInit(SDL_Haptic * haptic)
|
||||||
int
|
int
|
||||||
SDL_HapticRumblePlay(SDL_Haptic * haptic, float strength, Uint32 length)
|
SDL_HapticRumblePlay(SDL_Haptic * haptic, float strength, Uint32 length)
|
||||||
{
|
{
|
||||||
int ret;
|
|
||||||
SDL_HapticPeriodic *efx;
|
SDL_HapticPeriodic *efx;
|
||||||
|
|
||||||
if (!ValidHaptic(haptic)) {
|
if (!ValidHaptic(haptic)) {
|
||||||
|
@ -804,9 +803,8 @@ SDL_HapticRumblePlay(SDL_Haptic * haptic, float strength, Uint32 length)
|
||||||
efx = &haptic->rumble_effect.periodic;
|
efx = &haptic->rumble_effect.periodic;
|
||||||
efx->magnitude = (Sint16)(32767.0f*strength);
|
efx->magnitude = (Sint16)(32767.0f*strength);
|
||||||
efx->length = length;
|
efx->length = length;
|
||||||
ret = SDL_HapticUpdateEffect(haptic, haptic->rumble_id, &haptic->rumble_effect);
|
if (SDL_HapticUpdateEffect(haptic, haptic->rumble_id, &haptic->rumble_effect) < 0) {
|
||||||
if (ret) {
|
return -1;
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return SDL_HapticRunEffect(haptic, haptic->rumble_id, 1);
|
return SDL_HapticRunEffect(haptic, haptic->rumble_id, 1);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue