Add some SDL_SetError() calls to the dollar gesture code (thanks, Martin!).
authorRyan C. Gordon <icculus@icculus.org>
Sun, 05 Apr 2015 18:44:24 -0400
changeset 9456 2d6ec08030a0
parent 9455 b452e37e26d9
child 9457 9f2beba999b8
Add some SDL_SetError() calls to the dollar gesture code (thanks, Martin!). Fixes Bugzilla #2673.
src/events/SDL_gesture.c
--- a/src/events/SDL_gesture.c	Sun Apr 05 15:52:37 2015 -0400
+++ b/src/events/SDL_gesture.c	Sun Apr 05 18:44:24 2015 -0400
@@ -184,7 +184,7 @@
     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 @@
         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) {