Gesture: remove warnings when ENABLE_DOLLAR is undefined.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
diff --git a/src/events/SDL_gesture.c b/src/events/SDL_gesture.c
index c3b73e0..eb5c341 100644
--- a/src/events/SDL_gesture.c
+++ b/src/events/SDL_gesture.c
@@ -279,6 +279,7 @@ int SDL_LoadDollarTemplates(SDL_TouchID touchId, SDL_RWops *src)
}
+#if defined(ENABLE_DOLLAR)
static float dollarDifference(SDL_FloatPoint* points,SDL_FloatPoint* templ,float ang)
{
/* SDL_FloatPoint p[DOLLARNPOINTS]; */
@@ -444,6 +445,7 @@ static float dollarRecognize(const SDL_DollarPath *path,int *bestTempl,SDL_Gestu
}
return bestDiff;
}
+#endif
int SDL_GestureAddTouch(SDL_TouchID touchId)
{
@@ -509,6 +511,7 @@ static int SDL_SendGestureMulti(SDL_GestureTouch* touch,float dTheta,float dDist
return SDL_PushEvent(&event) > 0;
}
+#if defined(ENABLE_DOLLAR)
static int SDL_SendGestureDollar(SDL_GestureTouch* touch,
SDL_GestureID gestureId,float error)
{
@@ -533,14 +536,17 @@ static int SDL_SendDollarRecord(SDL_GestureTouch* touch,SDL_GestureID gestureId)
event.dgesture.gestureId = gestureId;
return SDL_PushEvent(&event) > 0;
}
+#endif
void SDL_GestureProcessEvent(SDL_Event* event)
{
float x,y;
+#if defined(ENABLE_DOLLAR)
int index;
int i;
float pathDx, pathDy;
+#endif
SDL_FloatPoint lastP;
SDL_FloatPoint lastCentroid;
float lDist;
@@ -561,11 +567,13 @@ void SDL_GestureProcessEvent(SDL_Event* event)
/* Finger Up */
if (event->type == SDL_FINGERUP) {
+#if defined(ENABLE_DOLLAR)
SDL_FloatPoint path[DOLLARNPOINTS];
+#endif
inTouch->numDownFingers--;
-#ifdef ENABLE_DOLLAR
+#if defined(ENABLE_DOLLAR)
if (inTouch->recording) {
inTouch->recording = SDL_FALSE;
dollarNormalize(&inTouch->dollarPath,path);
@@ -610,7 +618,7 @@ void SDL_GestureProcessEvent(SDL_Event* event)
else if (event->type == SDL_FINGERMOTION) {
float dx = event->tfinger.dx;
float dy = event->tfinger.dy;
-#ifdef ENABLE_DOLLAR
+#if defined(ENABLE_DOLLAR)
SDL_DollarPath* path = &inTouch->dollarPath;
if (path->numPoints < MAXPATHSIZE) {
path->p[path->numPoints].x = inTouch->centroid.x;
@@ -687,7 +695,7 @@ void SDL_GestureProcessEvent(SDL_Event* event)
/* printf("Finger Down: (%f,%f). Centroid: (%f,%f\n",x,y,
inTouch->centroid.x,inTouch->centroid.y); */
-#ifdef ENABLE_DOLLAR
+#if defined(ENABLE_DOLLAR)
inTouch->dollarPath.length = 0;
inTouch->dollarPath.p[0].x = x;
inTouch->dollarPath.p[0].y = y;