Negative, Fade, Darken, Tint and Cartoon all now apply with a circular shape, rather than a square.
This commit is contained in:
parent
7448cd879d
commit
79141902ee
2 changed files with 97 additions and 67 deletions
|
|
@ -33,6 +33,10 @@ $Id$
|
|||
------------------------
|
||||
* Sparkles can now be different colors.
|
||||
|
||||
* Negative, Fade, Darken, Tint and Cartoon all now apply with a circular
|
||||
shape, rather than a square.
|
||||
|
||||
|
||||
* Translation Updates:
|
||||
--------------------
|
||||
* Brazilian Portuguese
|
||||
|
|
|
|||
|
|
@ -1790,6 +1790,7 @@ static SDL_Surface * duplicate_surface(SDL_Surface * orig);
|
|||
static void mirror_starter(void);
|
||||
static void flip_starter(void);
|
||||
int valid_click(Uint8 button);
|
||||
int in_circle(int x, int y);
|
||||
|
||||
#ifdef DEBUG
|
||||
static char * debug_gettext(const char * str);
|
||||
|
|
@ -4944,6 +4945,8 @@ static void blit_magic(int x, int y, int button_down)
|
|||
for (yy = y - 16; yy < y + 16; yy++)
|
||||
{
|
||||
for (xx = x - 16; xx < x + 16; xx++)
|
||||
{
|
||||
if (in_circle(xx - x, yy - y))
|
||||
{
|
||||
SDL_GetRGB(getpixel_last(last, xx, yy), last->format,
|
||||
&r, &g, &b);
|
||||
|
|
@ -4955,6 +4958,7 @@ static void blit_magic(int x, int y, int button_down)
|
|||
putpixel(canvas, xx, yy, SDL_MapRGB(canvas->format, r, g, b));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SDL_UnlockSurface(canvas);
|
||||
SDL_UnlockSurface(last);
|
||||
|
|
@ -4967,6 +4971,8 @@ static void blit_magic(int x, int y, int button_down)
|
|||
for (yy = y - 16; yy < y + 16; yy++)
|
||||
{
|
||||
for (xx = x - 16; xx < x + 16; xx++)
|
||||
{
|
||||
if (in_circle(xx - x, yy - y))
|
||||
{
|
||||
/* Get original color: */
|
||||
|
||||
|
|
@ -4989,6 +4995,7 @@ static void blit_magic(int x, int y, int button_down)
|
|||
putpixel(canvas, xx, yy, SDL_MapRGB(canvas->format, r, g, b));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SDL_UnlockSurface(canvas);
|
||||
SDL_UnlockSurface(last);
|
||||
|
|
@ -5006,6 +5013,8 @@ static void blit_magic(int x, int y, int button_down)
|
|||
for (yy = y - 16; yy < y + 16; yy++)
|
||||
{
|
||||
for (xx = x - 16; xx < x + 16; xx++)
|
||||
{
|
||||
if (in_circle(xx - x, yy - y))
|
||||
{
|
||||
/* Get original pixel: */
|
||||
|
||||
|
|
@ -5023,6 +5032,7 @@ static void blit_magic(int x, int y, int button_down)
|
|||
linear_to_sRGB(bd * old)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SDL_UnlockSurface(canvas);
|
||||
SDL_UnlockSurface(last);
|
||||
|
|
@ -5041,6 +5051,8 @@ static void blit_magic(int x, int y, int button_down)
|
|||
for (yy = y - 16; yy < y + 16; yy = yy + 1)
|
||||
{
|
||||
for (xx = x - 16; xx < x + 16; xx = xx + 1)
|
||||
{
|
||||
if (in_circle(xx - x, yy - y))
|
||||
{
|
||||
/* Get original color: */
|
||||
|
||||
|
|
@ -5100,12 +5112,15 @@ static void blit_magic(int x, int y, int button_down)
|
|||
*/
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Then, draw dark outlines where there's a large contrast change */
|
||||
|
||||
for (yy = y - 16; yy < y + 16; yy++)
|
||||
{
|
||||
for (xx = x - 16; xx < x + 16; xx++)
|
||||
{
|
||||
if (in_circle(xx - x, yy - y))
|
||||
{
|
||||
/* Get original color: */
|
||||
|
||||
|
|
@ -5133,6 +5148,7 @@ static void blit_magic(int x, int y, int button_down)
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SDL_UnlockSurface(canvas);
|
||||
SDL_UnlockSurface(last);
|
||||
|
|
@ -15041,3 +15057,13 @@ int valid_click(Uint8 button)
|
|||
else
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
int in_circle(int x, int y)
|
||||
{
|
||||
if ((x * x) + (y * y) - (16 * 16) < 0)
|
||||
return(1);
|
||||
else
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue