# HG changeset patch # User Jim Grandpre # Date 1280809080 14400 # Node ID 4ba1048a324c8d7161d2c02d0eb1adae5d621544 # Parent 5378f2d0754f6d47cdc629013f80333e7281fc5f Minimized functionality of gestureSDLTest. diff -r 5378f2d0754f -r 4ba1048a324c src/events/SDL_gesture.c --- a/src/events/SDL_gesture.c Mon Aug 02 00:14:53 2010 -0400 +++ b/src/events/SDL_gesture.c Tue Aug 03 00:18:00 2010 -0400 @@ -117,17 +117,12 @@ int i; //No Longer storing the Hash, rehash on load - //fprintf(fp,"%lu ",templ->hash); //if(SDL_RWops.write(src,&(templ->hash),sizeof(templ->hash),1) != 1) return 0; - - /* - for(i = 0;i < DOLLARNPOINTS;i++) { - fprintf(fp,"%i %i ",(int)templ->path[i].x,(int)templ->path[i].y); - } - fprintf(fp,"\n"); - */ - if(SDL_RWwrite(src,templ->path,sizeof(templ->path[0]),DOLLARNPOINTS) != DOLLARNPOINTS) return 0; + if(SDL_RWwrite(src,templ->path, + sizeof(templ->path[0]),DOLLARNPOINTS) != DOLLARNPOINTS) + return 0; + return 1; } @@ -499,7 +494,7 @@ j = -1; break; } - else { + else if(event->type == SDL_FINGERMOTION) { float dx = x - inTouch->gestureLast[j].f.p.x; float dy = y - inTouch->gestureLast[j].f.p.y; DollarPath* path = &inTouch->gestureLast[j].dollarPath; diff -r 5378f2d0754f -r 4ba1048a324c touchTest/gestureSDLTest.c --- a/touchTest/gestureSDLTest.c Mon Aug 02 00:14:53 2010 -0400 +++ b/touchTest/gestureSDLTest.c Tue Aug 03 00:18:00 2010 -0400 @@ -240,19 +240,10 @@ drawCircle(screen,x*screen->w,y*screen->h,5,col); else if(event.type == SDL_FINGERDOWN) drawCircle(screen,x*screen->w,y*screen->h,-10,col); - /* - //if there is a centroid, draw it - if(numDownFingers > 1) { - unsigned int col = - ((unsigned int)(0xFFFFFF)) | - ((unsigned int)((0xFF*(1-((float)age)/EVENT_BUF_SIZE))) & 0xFF)<<24; - drawCircle(screen,centroid.x*screen->w,centroid.y*screen->h,5,col); - } - */ } } - + /* for(i=0;i= 0 && finger[i].p.y >= 0) if(finger[i].pressure > 0) @@ -261,7 +252,7 @@ else drawCircle(screen,finger[i].p.x*screen->w,finger[i].p.y*screen->h ,20,0xFF); - + */ keystat[32] = 0; @@ -375,7 +366,7 @@ // event.tfinger.x,event.tfinger.y); SDL_Touch* inTouch = SDL_GetTouch(event.tfinger.touchId); SDL_Finger* inFinger = SDL_GetFinger(inTouch,event.tfinger.fingerId); - + /* for(i = 0;ipressureres; + */ /* printf("Finger: %i, Pressure: %f Pressureres: %i\n", event.tfinger.fingerId, @@ -396,12 +388,12 @@ */ //printf("Finger: %i, pressure: %f\n",event.tfinger.fingerId, // finger[event.tfinger.fingerId].pressure); - } + //} break; case SDL_FINGERDOWN: //printf("Finger: %"PRIs64" down - x: %i, y: %i\n",event.tfinger.fingerId,event.tfinger.x,event.tfinger.y); - + /* for(i = 0;i