Mercurial > sdl-ios-xcode
diff touchTest/gestureTest.c @ 4655:4c94f2023d62
Fixed bugs in input, cleaned up $1
author | Jim Grandpre <jim.tla@gmail.com> |
---|---|
date | Fri, 18 Jun 2010 01:43:02 -0400 |
parents | 7dbcd71216df |
children | b5007b7995c6 |
line wrap: on
line diff
--- a/touchTest/gestureTest.c Thu Jun 17 03:41:27 2010 -0400 +++ b/touchTest/gestureTest.c Fri Jun 18 01:43:02 2010 -0400 @@ -214,11 +214,12 @@ int i; int k; + /* for(k = 0;k<DOLLARNPOINTS;k++) { printf("(%f,%f)\n",points[k].x, points[k].y); } - + */ drawDollarPath(screen,points,numPoints,-15,0xFF6600); int bestDiff = 10000; @@ -367,23 +368,13 @@ gestureLine[j].points = 0; #endif - //ignore last point - probably invalid - dollarPath[j].numPoints--; - - - float dx = dollarPath[j].p[dollarPath[j].numPoints].x - - dollarPath[j].p[dollarPath[j].numPoints - 1].x; - float dy = dollarPath[j].p[dollarPath[j].numPoints].y - - dollarPath[j].p[dollarPath[j].numPoints - 1].y; - dollarPath[j].length -= sqrt(dx*dx+dy*dy); if(!keystat[32]){ //spacebar int bestTempl; float error = dollarRecognize(screen,dollarPath[j],&bestTempl); - printf("%i\n",bestTempl); if(bestTempl >= 0){ drawDollarPath(screen,dollarTemplate[bestTempl] - ,DOLLARNPOINTS,-15,0x0066FF);\ + ,DOLLARNPOINTS,-15,0x0066FF); printf("ERROR: %f\n",error); } @@ -475,8 +466,8 @@ if(gestureLast[j].id < 0) continue; //Finger up. Or some error... int k; for(k = 0; k < MAXFINGERS;k++) { - if(gestureLast[k].id < 0) continue; + //printf("k = %i, id: %i\n",k,gestureLast[k].id); //colors have no alpha, so shouldn't overflow unsigned int c = (colors[gestureLast[j].id%7] + colors[gestureLast[k].id%7])/2;