Add some SDL_SetError() calls to the dollar gesture code (thanks, Martin!).

Fixes Bugzilla #2673.
main
Ryan C. Gordon 2015-04-05 18:44:24 -04:00
parent 0713c1e53b
commit 05a9206a4f
1 changed files with 2 additions and 2 deletions

View File

@ -184,7 +184,7 @@ static int SDL_AddDollarGesture(SDL_GestureTouch* inTouch, SDL_FloatPoint* path)
int index = -1; int index = -1;
int i = 0; int i = 0;
if (inTouch == NULL) { if (inTouch == NULL) {
if (SDL_numGestureTouches == 0) return -1; if (SDL_numGestureTouches == 0) return SDL_SetError("no gesture touch devices registered");
for (i = 0; i < SDL_numGestureTouches; i++) { for (i = 0; i < SDL_numGestureTouches; i++) {
inTouch = &SDL_gestureTouch[i]; inTouch = &SDL_gestureTouch[i];
index = SDL_AddDollarGesture_one(inTouch, path); index = SDL_AddDollarGesture_one(inTouch, path);
@ -206,7 +206,7 @@ int SDL_LoadDollarTemplates(SDL_TouchID touchId, SDL_RWops *src)
for (i = 0; i < SDL_numGestureTouches; i++) for (i = 0; i < SDL_numGestureTouches; i++)
if (SDL_gestureTouch[i].id == touchId) if (SDL_gestureTouch[i].id == touchId)
touch = &SDL_gestureTouch[i]; touch = &SDL_gestureTouch[i];
if (touch == NULL) return -1; if (touch == NULL) return SDL_SetError("given touch id not found");
} }
while (1) { while (1) {