Gesture: remove warnings when ENABLE_DOLLAR is undefined.
authorSylvain Becker <sylvain.becker@gmail.com>
Sun, 16 Dec 2018 11:15:21 +0100
changeset 12479f2c510ee0f2a
parent 12478 b801d44da5dc
child 12480 bc0bc8a54387
Gesture: remove warnings when ENABLE_DOLLAR is undefined.
src/events/SDL_gesture.c
     1.1 --- a/src/events/SDL_gesture.c	Sun Dec 16 01:04:07 2018 -0500
     1.2 +++ b/src/events/SDL_gesture.c	Sun Dec 16 11:15:21 2018 +0100
     1.3 @@ -279,6 +279,7 @@
     1.4  }
     1.5  
     1.6  
     1.7 +#if defined(ENABLE_DOLLAR)
     1.8  static float dollarDifference(SDL_FloatPoint* points,SDL_FloatPoint* templ,float ang)
     1.9  {
    1.10      /*  SDL_FloatPoint p[DOLLARNPOINTS]; */
    1.11 @@ -444,6 +445,7 @@
    1.12      }
    1.13      return bestDiff;
    1.14  }
    1.15 +#endif
    1.16  
    1.17  int SDL_GestureAddTouch(SDL_TouchID touchId)
    1.18  {
    1.19 @@ -509,6 +511,7 @@
    1.20      return SDL_PushEvent(&event) > 0;
    1.21  }
    1.22  
    1.23 +#if defined(ENABLE_DOLLAR)
    1.24  static int SDL_SendGestureDollar(SDL_GestureTouch* touch,
    1.25                            SDL_GestureID gestureId,float error)
    1.26  {
    1.27 @@ -533,14 +536,17 @@
    1.28      event.dgesture.gestureId = gestureId;
    1.29      return SDL_PushEvent(&event) > 0;
    1.30  }
    1.31 +#endif
    1.32  
    1.33  
    1.34  void SDL_GestureProcessEvent(SDL_Event* event)
    1.35  {
    1.36      float x,y;
    1.37 +#if defined(ENABLE_DOLLAR)
    1.38      int index;
    1.39      int i;
    1.40      float pathDx, pathDy;
    1.41 +#endif
    1.42      SDL_FloatPoint lastP;
    1.43      SDL_FloatPoint lastCentroid;
    1.44      float lDist;
    1.45 @@ -561,11 +567,13 @@
    1.46  
    1.47          /* Finger Up */
    1.48          if (event->type == SDL_FINGERUP) {
    1.49 +#if defined(ENABLE_DOLLAR)
    1.50              SDL_FloatPoint path[DOLLARNPOINTS];
    1.51 +#endif
    1.52  
    1.53              inTouch->numDownFingers--;
    1.54  
    1.55 -#ifdef ENABLE_DOLLAR
    1.56 +#if defined(ENABLE_DOLLAR)
    1.57              if (inTouch->recording) {
    1.58                  inTouch->recording = SDL_FALSE;
    1.59                  dollarNormalize(&inTouch->dollarPath,path);
    1.60 @@ -610,7 +618,7 @@
    1.61          else if (event->type == SDL_FINGERMOTION) {
    1.62              float dx = event->tfinger.dx;
    1.63              float dy = event->tfinger.dy;
    1.64 -#ifdef ENABLE_DOLLAR
    1.65 +#if defined(ENABLE_DOLLAR)
    1.66              SDL_DollarPath* path = &inTouch->dollarPath;
    1.67              if (path->numPoints < MAXPATHSIZE) {
    1.68                  path->p[path->numPoints].x = inTouch->centroid.x;
    1.69 @@ -687,7 +695,7 @@
    1.70              /* printf("Finger Down: (%f,%f). Centroid: (%f,%f\n",x,y,
    1.71                   inTouch->centroid.x,inTouch->centroid.y); */
    1.72  
    1.73 -#ifdef ENABLE_DOLLAR
    1.74 +#if defined(ENABLE_DOLLAR)
    1.75              inTouch->dollarPath.length = 0;
    1.76              inTouch->dollarPath.p[0].x = x;
    1.77              inTouch->dollarPath.p[0].y = y;