test/testgesture.c
changeset 9274 f95cc158ed4f
parent 9273 9f1c18388f2c
child 9275 a40415296b77
equal deleted inserted replaced
9273:9f1c18388f2c 9274:f95cc158ed4f
   101 void drawCircle(SDL_Surface* screen,float x,float y,float r,unsigned int c)
   101 void drawCircle(SDL_Surface* screen,float x,float y,float r,unsigned int c)
   102 {
   102 {
   103   float tx,ty;
   103   float tx,ty;
   104   float xr;
   104   float xr;
   105   for(ty = (float)-SDL_fabs(r);ty <= (float)SDL_fabs((int)r);ty++) {
   105   for(ty = (float)-SDL_fabs(r);ty <= (float)SDL_fabs((int)r);ty++) {
   106     xr = (float)sqrt(r*r - ty*ty);
   106     xr = (float)SDL_sqrt(r*r - ty*ty);
   107     if(r > 0) { /* r > 0 ==> filled circle */
   107     if(r > 0) { /* r > 0 ==> filled circle */
   108       for(tx=-xr+.5f;tx<=xr-.5;tx++) {
   108       for(tx=-xr+.5f;tx<=xr-.5;tx++) {
   109     setpix(screen,x+tx,y+ty,c);
   109     setpix(screen,x+tx,y+ty,c);
   110       }
   110       }
   111     }
   111     }