Browse Source

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

Fixes Bugzilla #2673.
Ryan C. Gordon 10 years ago
parent
commit
05a9206a4f
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/events/SDL_gesture.c

+ 2 - 2
src/events/SDL_gesture.c

@@ -184,7 +184,7 @@ static int SDL_AddDollarGesture(SDL_GestureTouch* inTouch, SDL_FloatPoint* path)
     int index = -1;
     int i = 0;
     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++) {
             inTouch = &SDL_gestureTouch[i];
             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++)
             if (SDL_gestureTouch[i].id == touchId)
                 touch = &SDL_gestureTouch[i];
-        if (touch == NULL) return -1;
+        if (touch == NULL) return SDL_SetError("given touch id not found");
     }
 
     while (1) {