Finished flower tool.

Added foam tool.
Cleanup.
This commit is contained in:
William Kendrick 2007-07-11 06:20:05 +00:00
parent f8249b1e4d
commit 1f0d12ba91
17 changed files with 840 additions and 92 deletions

View file

@ -60,27 +60,20 @@ char * waves_get_description(magic_api * api, int which)
void waves_drag(magic_api * api, int which, SDL_Surface * canvas,
SDL_Surface * last, int ox, int oy, int x, int y,
SDL_Rect * update_rect)
{
}
// Affect the canvas on click:
void waves_click(magic_api * api, int which,
SDL_Surface * canvas, SDL_Surface * last,
int x, int y, SDL_Rect * update_rect)
{
int xx, yy;
SDL_Rect src, dest;
int offset;
int width;
int height;
offset = (y % 72); // kinda random...
width = ((x * 16) / canvas->w) + 16;
height = 10 - ((y * 5) / canvas->h);
SDL_BlitSurface(last, NULL, canvas, NULL);
width = ((x * 10) / canvas->w) + 10;
height = ((canvas->h - y) / 10) + 1;
for (yy = 0; yy < canvas->h; yy++)
{
xx = sin(((yy + offset) * height) * M_PI / 180.0) * width;
xx = sin((yy * height) * M_PI / 180.0) * width;
src.x = 0;
src.y = yy;
@ -99,6 +92,14 @@ void waves_click(magic_api * api, int which,
update_rect->h = canvas->h;
}
// Affect the canvas on click:
void waves_click(magic_api * api, int which,
SDL_Surface * canvas, SDL_Surface * last,
int x, int y, SDL_Rect * update_rect)
{
waves_drag(api, which, canvas, last, x, y, x, y, update_rect);
}
// Affect the canvas on release:
void waves_release(magic_api * api, int which,
SDL_Surface * canvas, SDL_Surface * last,