mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-05-30 21:37:43 +08:00
linux/SDL_syshaptic.c:SDL_SYS_HapticStopAll(): Fix return on error
(cherry picked from commit 43f3991398)
This commit is contained in:
committed by
Sam Lantinga
parent
68e0108b1c
commit
15cc0f5f91
@@ -1117,13 +1117,12 @@ bool SDL_SYS_HapticResume(SDL_Haptic *haptic)
|
|||||||
*/
|
*/
|
||||||
bool SDL_SYS_HapticStopAll(SDL_Haptic *haptic)
|
bool SDL_SYS_HapticStopAll(SDL_Haptic *haptic)
|
||||||
{
|
{
|
||||||
int i, ret;
|
int i;
|
||||||
|
|
||||||
// Linux does not support this natively so we have to loop.
|
// Linux does not support this natively so we have to loop.
|
||||||
for (i = 0; i < haptic->neffects; i++) {
|
for (i = 0; i < haptic->neffects; i++) {
|
||||||
if (haptic->effects[i].hweffect != NULL) {
|
if (haptic->effects[i].hweffect != NULL) {
|
||||||
ret = SDL_SYS_HapticStopEffect(haptic, &haptic->effects[i]);
|
if (!SDL_SYS_HapticStopEffect(haptic, &haptic->effects[i])) {
|
||||||
if (ret < 0) {
|
|
||||||
return SDL_SetError("Haptic: Error while trying to stop all playing effects.");
|
return SDL_SetError("Haptic: Error while trying to stop all playing effects.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user