Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwkendrick <wkendrick>2011-07-02 07:16:39 (GMT)
committer wkendrick <wkendrick>2011-07-02 07:16:39 (GMT)
commit8b368da08b285d6c79bf153e117c9f2a72001a63 (patch)
treefbe3d7ac65feade7ce66e4f16d5f694bdb8e2a27
parent3c07a572bced6d1e0f7d3145d5488f1dade4fcc7 (diff)
"Tiles" and "Pattern" tools, based on Kaleidoscope.
-rw-r--r--docs/AUTHORS.txt7
-rw-r--r--docs/CHANGES.txt8
-rw-r--r--magic/icons/kal_pattern.pngbin0 -> 580 bytes
-rw-r--r--magic/icons/kal_tiles.pngbin0 -> 921 bytes
-rw-r--r--magic/magic-docs/html/kal_pattern.html10
-rw-r--r--magic/magic-docs/html/kal_tiles.html10
-rw-r--r--magic/magic-docs/html/kaleidoscope.html4
-rw-r--r--magic/magic-docs/kaleidoscope.txt2
-rw-r--r--magic/src/kalidescope.c25
9 files changed, 56 insertions, 10 deletions
diff --git a/docs/AUTHORS.txt b/docs/AUTHORS.txt
index 7330482..fc1b2fa 100644
--- a/docs/AUTHORS.txt
+++ b/docs/AUTHORS.txt
@@ -7,9 +7,9 @@ bill@newbreedsoftware.com
http://www.tuxpaint.org/
-June 17, 2002 - June 30, 2011
+June 17, 2002 - July 2, 2011
-$Id: AUTHORS.txt,v 1.257 2011/06/30 15:28:26 wkendrick Exp $
+$Id: AUTHORS.txt,v 1.258 2011/07/02 07:16:39 wkendrick Exp $
* Design and Coding:
@@ -106,6 +106,9 @@ $Id: AUTHORS.txt,v 1.257 2011/06/30 15:28:26 wkendrick Exp $
Ankit Choudary <ankit.goaldecided@gmail.com>, as part of GSOC 2010,
with integration and fixes by Pere Pujal i Carabantes <pere@fornol.no-ip.org>
+ Various other improvements and clean-ups by
+ Pere Pujal i Carabantes <pere@fornol.no-ip.org>
+
* Graphics
diff --git a/docs/CHANGES.txt b/docs/CHANGES.txt
index 5642297..cddc10e 100644
--- a/docs/CHANGES.txt
+++ b/docs/CHANGES.txt
@@ -6,9 +6,9 @@ Copyright (c) 2002-2011 by Bill Kendrick and others
bill@newbreedsoftware.com
http://www.tuxpaint.org/
-$Id: CHANGES.txt,v 1.783 2011/06/30 15:28:26 wkendrick Exp $
+$Id: CHANGES.txt,v 1.784 2011/07/02 07:16:39 wkendrick Exp $
-2011.June.30 (0.9.22)
+2011.July.2 (0.9.22)
* New Tools:
----------
@@ -21,8 +21,10 @@ $Id: CHANGES.txt,v 1.783 2011/06/30 15:28:26 wkendrick Exp $
* New Magic Tools:
----------------
* Blinds - Close window blinds over your picture.
+ Pattern - Draws a tiled pattern around the picture.
Perspective - Change the image's perspective.
- Moasic Hexagon, Mosaic irregular, Mosaic square - Glass mosaic effects.
+ Mosaic Hexagon, Mosaic irregular, Mosaic square - Glass mosaic effects.
+ Tiles - Draws a symettric pattern around the picture.
Zoom - Zoom the image in or out.
By Pere Pujal i Carabantes <pere@fornol.no-ip.org>
diff --git a/magic/icons/kal_pattern.png b/magic/icons/kal_pattern.png
new file mode 100644
index 0000000..9a8355f
--- /dev/null
+++ b/magic/icons/kal_pattern.png
Binary files differ
diff --git a/magic/icons/kal_tiles.png b/magic/icons/kal_tiles.png
new file mode 100644
index 0000000..ebf6c05
--- /dev/null
+++ b/magic/icons/kal_tiles.png
Binary files differ
diff --git a/magic/magic-docs/html/kal_pattern.html b/magic/magic-docs/html/kal_pattern.html
new file mode 100644
index 0000000..f4df3a8
--- /dev/null
+++ b/magic/magic-docs/html/kal_pattern.html
@@ -0,0 +1,10 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<body><html><head><title>Tux Paint "Magic" Tool: Pattern</title>
+<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
+</head>
+<body bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#FF0000" alink="#FF00FF">
+<h1 align="center">Tux Paint "Magic" Tool: Pattern</h1>
+<h2 align="center">By Pere Pujal i Carabantes &lt;<a href="mailto:pere@fornol.no-ip.org">pere@fornol.no-ip.org</a>&gt;</h2>
+<p>This paint brush draws a repeating tile around the image.</p>
+<p>See also: <a href="kal_pattern.html">Pattern</a> <a href="kal_pattern.html">Pattern</a></p>
+</body></html>
diff --git a/magic/magic-docs/html/kal_tiles.html b/magic/magic-docs/html/kal_tiles.html
new file mode 100644
index 0000000..bf40b55
--- /dev/null
+++ b/magic/magic-docs/html/kal_tiles.html
@@ -0,0 +1,10 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<body><html><head><title>Tux Paint "Magic" Tool: Tiles</title>
+<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
+</head>
+<body bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#FF0000" alink="#FF00FF">
+<h1 align="center">Tux Paint "Magic" Tool: Tiles</h1>
+<h2 align="center">By Pere Pujal i Carabantes &lt;<a href="mailto:pere@fornol.no-ip.org">pere@fornol.no-ip.org</a>&gt;</h2>
+<p>This paint brush draws symmetrically, tiled around the image.</p>
+<p>See also: <a href="kaleidoscope.html">Kaleidoscope</a> <a href="kal_pattern.html">Pattern</a></p>
+</body></html>
diff --git a/magic/magic-docs/html/kaleidoscope.html b/magic/magic-docs/html/kaleidoscope.html
index 339764a..1ec1bc5 100644
--- a/magic/magic-docs/html/kaleidoscope.html
+++ b/magic/magic-docs/html/kaleidoscope.html
@@ -6,5 +6,5 @@
<h1 align="center">Tux Paint "Magic" Tool: Kaleidoscope</h1>
<h2 align="center">By Bill Kendrick &lt;<a href="mailto:bill@newbreedsoftware.com">bill@newbreedsoftware.com</a>&gt;</h2>
<p>This paint brush draws in four places at the same time, mirroring symmetrically, both horizontally and vertically. It uses the currently selected color.</p>
-<p>See also: <a href="picasso.html">Picasso</a></p>
-</body></html> \ No newline at end of file
+<p>See also: <a href="picasso.html">Picasso</a> <a href="kal_pattern.html">Pattern</a> <a href="kal_tiles.html">Tiles</a></p>
+</body></html>
diff --git a/magic/magic-docs/kaleidoscope.txt b/magic/magic-docs/kaleidoscope.txt
index 65a3c47..695ae0f 100644
--- a/magic/magic-docs/kaleidoscope.txt
+++ b/magic/magic-docs/kaleidoscope.txt
@@ -6,4 +6,4 @@
symmetrically, both horizontally and vertically. It uses the currently
selected color.
- See also: Picasso
+ See also: Picasso Pattern Tiles
diff --git a/magic/src/kalidescope.c b/magic/src/kalidescope.c
index 4ab84bb..c84456e 100644
--- a/magic/src/kalidescope.c
+++ b/magic/src/kalidescope.c
@@ -24,7 +24,7 @@
(See COPYING.txt)
Last updated: July 8, 2008
- $Id: kalidescope.c,v 1.12 2010/06/05 01:39:09 wkendrick Exp $
+ $Id: kalidescope.c,v 1.13 2011/07/02 07:16:40 wkendrick Exp $
*/
#include <stdio.h>
@@ -37,7 +37,7 @@
static Mix_Chunk * kalidescope_snd;
static Uint8 kalidescope_r, kalidescope_g, kalidescope_b;
-
+static int square_size = 128;
Uint32 kalidescope_api_version(void) { return(TP_MAGIC_API_VERSION); }
@@ -45,6 +45,8 @@ enum {
KAL_UD,
KAL_LR,
KAL_BOTH,
+ KAL_PATTERN,
+ KAL_TILES,
KAL_COUNT
};
@@ -52,6 +54,8 @@ char * kal_icon_names[KAL_COUNT] = {
"symmetric_updown.png",
"symmetric_leftright.png",
"kalidescope.png",
+ "kal_pattern.png",
+ "kal_tiles.png"
};
@@ -90,6 +94,10 @@ char * kalidescope_get_name(magic_api * api, int which)
return(strdup(gettext_noop("Symmetric Left/Right")));
} else if (which == KAL_UD) {
return(strdup(gettext_noop("Symmetric Up/Down")));
+ } else if (which == KAL_PATTERN) {
+ return(strdup(gettext_noop("Pattern")));
+ } else if (which == KAL_TILES) {
+ return(strdup(gettext_noop("Tiles")));
} else { /* KAL_BOTH */
return(strdup(gettext_noop("Kaleidoscope")));
}
@@ -102,6 +110,10 @@ char * kalidescope_get_description(magic_api * api, int which, int mode)
return(strdup(gettext_noop("Click and drag the mouse to draw with two brushes that are symmetric across the left and right of your picture.")));
} else if (which == KAL_UD) {
return(strdup(gettext_noop("Click and drag the mouse to draw with two brushes that are symmetric across the top and bottom of your picture.")));
+ } else if (which == KAL_PATTERN) {
+ return(strdup(gettext_noop("Click and drag the mouse to draw a pattern across the picture.")));
+ } else if (which == KAL_TILES) {
+ return(strdup(gettext_noop("Click and drag the mouse to draw a pattern plus its symmetric across the picture.")));
} else { /* KAL_BOTH */
return(strdup(gettext_noop("Click and drag the mouse to draw with symmetric brushes (a kaleidoscope).")));
}
@@ -114,6 +126,7 @@ static void do_kalidescope(void * ptr, int which, SDL_Surface * canvas, SDL_Surf
{
magic_api * api = (magic_api *) ptr;
int xx, yy;
+ int i, j;
Uint32 colr;
colr = SDL_MapRGB(canvas->format,
@@ -139,6 +152,14 @@ static void do_kalidescope(void * ptr, int which, SDL_Surface * canvas, SDL_Surf
if (which == KAL_UD || which == KAL_BOTH) {
api->putpixel(canvas, x + xx, canvas->h - 1 - y + yy, colr);
}
+ if (which == KAL_PATTERN || which == KAL_TILES) {
+ for (i = 0; i <= canvas->w; i += square_size)
+ for (j = 0; j <= canvas->h; j += square_size){
+ api->putpixel(canvas, i + xx + x % square_size, j + yy + y % square_size, colr);
+ if (which == KAL_TILES)
+ api->putpixel(canvas, i + yy + y % square_size, j + xx + x % square_size, colr);
+ }
+ }
}
}
}