comparison src/events/SDL_gesture.c @ 4682:4ba1048a324c

Minimized functionality of gestureSDLTest.
author Jim Grandpre <jim.tla@gmail.com>
date Tue, 03 Aug 2010 00:18:00 -0400
parents 5378f2d0754f
children 15dfe42edbfd
comparison
equal deleted inserted replaced
4681:5378f2d0754f 4682:4ba1048a324c
115 if(src == NULL) return 0; 115 if(src == NULL) return 0;
116 116
117 int i; 117 int i;
118 118
119 //No Longer storing the Hash, rehash on load 119 //No Longer storing the Hash, rehash on load
120 //fprintf(fp,"%lu ",templ->hash);
121 //if(SDL_RWops.write(src,&(templ->hash),sizeof(templ->hash),1) != 1) return 0; 120 //if(SDL_RWops.write(src,&(templ->hash),sizeof(templ->hash),1) != 1) return 0;
122 121
123 /* 122 if(SDL_RWwrite(src,templ->path,
124 for(i = 0;i < DOLLARNPOINTS;i++) { 123 sizeof(templ->path[0]),DOLLARNPOINTS) != DOLLARNPOINTS)
125 fprintf(fp,"%i %i ",(int)templ->path[i].x,(int)templ->path[i].y); 124 return 0;
126 } 125
127 fprintf(fp,"\n");
128
129 */
130 if(SDL_RWwrite(src,templ->path,sizeof(templ->path[0]),DOLLARNPOINTS) != DOLLARNPOINTS) return 0;
131 return 1; 126 return 1;
132 } 127 }
133 128
134 129
135 int SDL_SaveAllDollarTemplates(SDL_RWops *src) { 130 int SDL_SaveAllDollarTemplates(SDL_RWops *src) {
497 } 492 }
498 inTouch->gestureLast[j] = inTouch->gestureLast[inTouch->numDownFingers]; 493 inTouch->gestureLast[j] = inTouch->gestureLast[inTouch->numDownFingers];
499 j = -1; 494 j = -1;
500 break; 495 break;
501 } 496 }
502 else { 497 else if(event->type == SDL_FINGERMOTION) {
503 float dx = x - inTouch->gestureLast[j].f.p.x; 498 float dx = x - inTouch->gestureLast[j].f.p.x;
504 float dy = y - inTouch->gestureLast[j].f.p.y; 499 float dy = y - inTouch->gestureLast[j].f.p.y;
505 DollarPath* path = &inTouch->gestureLast[j].dollarPath; 500 DollarPath* path = &inTouch->gestureLast[j].dollarPath;
506 if(path->numPoints < MAXPATHSIZE) { 501 if(path->numPoints < MAXPATHSIZE) {
507 path->p[path->numPoints].x = x; 502 path->p[path->numPoints].x = x;