diff --git a/docs/CHANGES.txt b/docs/CHANGES.txt index 36bf48d83..4896fe7ae 100644 --- a/docs/CHANGES.txt +++ b/docs/CHANGES.txt @@ -8,7 +8,7 @@ http://www.tuxpaint.org/ $Id$ -2009.June.20 (0.9.21) +2009.June.21 (0.9.21) * New Starters: ------------- * Silver Frame @@ -35,7 +35,6 @@ $Id$ (Part of Tux4Kids' participation in Google Summer of Code 2008) * + Confetti - Paints random confetti bits on the canvas. - + Fisheye - Warps part of the picture, as though seen through a fisheye. + TV - Adds television (CRT) interlacing lines over the image. + Rosette - Paints at 3 points on the screen, in a rosette shape. + Picasso - Paints at 3 points, in a "Picasso" art style. @@ -44,6 +43,7 @@ $Id$ (Part of Tux4Kids' participation in Google Summer of Code 2008) * + Rails - Draws train tracks / rails over the image. + + Fisheye - Warps part of the picture, as though seen through a fisheye. + Fold - Folds the corners of the image up, like a piece of paper. By Adam 'foo-script' Rakowski (GSOC 2008), with modifications by Bill Kendrick diff --git a/magic/src/fisheye.c b/magic/src/fisheye.c index 95d42a004..891925923 100644 --- a/magic/src/fisheye.c +++ b/magic/src/fisheye.c @@ -32,6 +32,7 @@ #include "SDL_mixer.h" Mix_Chunk * fisheye_snd; +int last_x, last_y; // Housekeeping functions @@ -102,7 +103,11 @@ void fisheye_draw(void * ptr, int which, SDL_Surface * canvas, SDL_Surface * las int xx, yy; unsigned short int i; - /*SDL_BlitSurface(canvas, NULL, last, NULL); */ + if(api->in_circle(last_x - x, last_y - y, 80)) return; + + last_x = x; + last_y = y; + oryg=SDL_CreateRGBSurface(SDL_ANYFORMAT, 80, 80, canvas->format->BitsPerPixel, canvas->format->Rmask, canvas->format->Gmask, canvas->format->Bmask, canvas->format->Amask); @@ -212,17 +217,21 @@ void fisheye_drag(magic_api * api, int which, SDL_Surface * canvas, SDL_Surface * snapshot, int ox, int oy, int x, int y, SDL_Rect * update_rect) { + + api->line(api, which, canvas, snapshot, ox, oy, x, y, 1, fisheye_draw); + update_rect->x = min(ox, x) - 40; + update_rect->y = min(oy, y) - 40; + update_rect->w = max(ox, x) - update_rect->x + 40; + update_rect->h = max(oy, y) - update_rect->y + 40; } void fisheye_click(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect) { - fisheye_draw(api, which, canvas, last, x, y); - - update_rect->x=x-40; - update_rect->y=y-40; - update_rect->w=update_rect->h=80; + last_x = -80; /* A value that will be beyond any clicked position */ + last_y = -80; + fisheye_drag(api, which, canvas, last, x, y, x, y, update_rect); } void fisheye_switchin(magic_api * api, int which, int mode, SDL_Surface * canvas)