Minimized functionality of gestureSDLTest.
authorJim Grandpre <jim.tla@gmail.com>
Tue, 03 Aug 2010 00:18:00 -0400
changeset 46824ba1048a324c
parent 4681 5378f2d0754f
child 4683 15dfe42edbfd
Minimized functionality of gestureSDLTest.
src/events/SDL_gesture.c
touchTest/gestureSDLTest.c
     1.1 --- a/src/events/SDL_gesture.c	Mon Aug 02 00:14:53 2010 -0400
     1.2 +++ b/src/events/SDL_gesture.c	Tue Aug 03 00:18:00 2010 -0400
     1.3 @@ -117,17 +117,12 @@
     1.4    int i;
     1.5    
     1.6    //No Longer storing the Hash, rehash on load
     1.7 -  //fprintf(fp,"%lu ",templ->hash);
     1.8    //if(SDL_RWops.write(src,&(templ->hash),sizeof(templ->hash),1) != 1) return 0;
     1.9 -  
    1.10 -  /*
    1.11 -  for(i = 0;i < DOLLARNPOINTS;i++) {
    1.12 -    fprintf(fp,"%i %i ",(int)templ->path[i].x,(int)templ->path[i].y);
    1.13 -  }
    1.14 -  fprintf(fp,"\n");
    1.15  
    1.16 -  */
    1.17 -  if(SDL_RWwrite(src,templ->path,sizeof(templ->path[0]),DOLLARNPOINTS) != DOLLARNPOINTS) return 0;
    1.18 +  if(SDL_RWwrite(src,templ->path,
    1.19 +		 sizeof(templ->path[0]),DOLLARNPOINTS) != DOLLARNPOINTS) 
    1.20 +    return 0;
    1.21 +
    1.22    return 1;
    1.23  }
    1.24  
    1.25 @@ -499,7 +494,7 @@
    1.26  	j = -1;
    1.27  	break;
    1.28        }
    1.29 -      else {
    1.30 +      else if(event->type == SDL_FINGERMOTION) {
    1.31  	float dx = x - inTouch->gestureLast[j].f.p.x;
    1.32  	float dy = y - inTouch->gestureLast[j].f.p.y;
    1.33  	DollarPath* path = &inTouch->gestureLast[j].dollarPath;
     2.1 --- a/touchTest/gestureSDLTest.c	Mon Aug 02 00:14:53 2010 -0400
     2.2 +++ b/touchTest/gestureSDLTest.c	Tue Aug 03 00:18:00 2010 -0400
     2.3 @@ -240,19 +240,10 @@
     2.4  	drawCircle(screen,x*screen->w,y*screen->h,5,col);
     2.5        else if(event.type == SDL_FINGERDOWN)
     2.6  	drawCircle(screen,x*screen->w,y*screen->h,-10,col);     
     2.7 -      /*      
     2.8 -      //if there is a centroid, draw it
     2.9 -      if(numDownFingers > 1) {
    2.10 -	unsigned int col = 
    2.11 -	  ((unsigned int)(0xFFFFFF)) |
    2.12 -	  ((unsigned int)((0xFF*(1-((float)age)/EVENT_BUF_SIZE))) & 0xFF)<<24;
    2.13 -	drawCircle(screen,centroid.x*screen->w,centroid.y*screen->h,5,col);
    2.14 -      }
    2.15 -      */
    2.16      }
    2.17    }
    2.18    
    2.19 -
    2.20 +  /*
    2.21    for(i=0;i<MAXFINGERS;i++)
    2.22      if(finger[i].p.x >= 0 && finger[i].p.y >= 0)
    2.23        if(finger[i].pressure > 0)
    2.24 @@ -261,7 +252,7 @@
    2.25        else
    2.26  	drawCircle(screen,finger[i].p.x*screen->w,finger[i].p.y*screen->h
    2.27  		   ,20,0xFF);
    2.28 -
    2.29 +  */
    2.30  
    2.31    
    2.32    keystat[32] = 0;
    2.33 @@ -375,7 +366,7 @@
    2.34  	    //	   event.tfinger.x,event.tfinger.y);
    2.35  	    SDL_Touch* inTouch = SDL_GetTouch(event.tfinger.touchId);
    2.36  	    SDL_Finger* inFinger = SDL_GetFinger(inTouch,event.tfinger.fingerId);
    2.37 -
    2.38 +	    /*
    2.39  	    for(i = 0;i<MAXFINGERS;i++) 
    2.40  	      if(index2fingerid[i] == event.tfinger.fingerId) 	      
    2.41  		break;
    2.42 @@ -388,6 +379,7 @@
    2.43  	      
    2.44  	      finger[i].pressure = 
    2.45  		((float)event.tfinger.pressure)/inTouch->pressureres;
    2.46 +	    */
    2.47  	      /*
    2.48  	      printf("Finger: %i, Pressure: %f Pressureres: %i\n",
    2.49  		     event.tfinger.fingerId,
    2.50 @@ -396,12 +388,12 @@
    2.51  	      */
    2.52  	      //printf("Finger: %i, pressure: %f\n",event.tfinger.fingerId,
    2.53  	      //   finger[event.tfinger.fingerId].pressure);
    2.54 -	    }
    2.55 +	    //}
    2.56  	    
    2.57  	    break;	    
    2.58  	  case SDL_FINGERDOWN:
    2.59  	    //printf("Finger: %"PRIs64" down - x: %i, y: %i\n",event.tfinger.fingerId,event.tfinger.x,event.tfinger.y);
    2.60 -
    2.61 +	    /*
    2.62  	    for(i = 0;i<MAXFINGERS;i++) 
    2.63  	      if(index2fingerid[i] == -1) {
    2.64  		index2fingerid[i] = event.tfinger.fingerId;
    2.65 @@ -419,6 +411,7 @@
    2.66  	      }
    2.67  	    finger[i].p.x = -1;
    2.68  	    finger[i].p.y = -1;
    2.69 +	    */
    2.70  	    break;
    2.71  	  case SDL_MULTIGESTURE:
    2.72  	    printf("Multi Gesture: x = %f, y = %f, dAng = %f, dR = %f\n",