Allowed for more than 14 Magic tools.
Began work to add new Magic tools: Tint, Darken, Cartoon.
This commit is contained in:
parent
c8ee015738
commit
6a26679fa1
5 changed files with 105 additions and 45 deletions
BIN
data/images/magic/cartoon.png
Normal file
BIN
data/images/magic/cartoon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
BIN
data/images/magic/darken.png
Normal file
BIN
data/images/magic/darken.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 791 B |
BIN
data/images/magic/tint.png
Normal file
BIN
data/images/magic/tint.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 931 B |
67
src/magic.h
67
src/magic.h
|
|
@ -8,13 +8,10 @@
|
|||
bill@newbreedsoftware.com
|
||||
http://www.newbreedsoftware.com/tuxpaint/
|
||||
|
||||
June 29, 2002 - December 6, 2004
|
||||
June 29, 2002 - December 11, 2004
|
||||
*/
|
||||
|
||||
|
||||
#include "tip_tux.h"
|
||||
|
||||
|
||||
/* What tools are available: */
|
||||
|
||||
enum {
|
||||
|
|
@ -25,19 +22,24 @@ enum {
|
|||
MAGIC_FLIP,
|
||||
|
||||
MAGIC_BLUR,
|
||||
MAGIC_BLOCKS,
|
||||
MAGIC_SMUDGE,
|
||||
|
||||
MAGIC_NEGATIVE,
|
||||
MAGIC_FADE,
|
||||
MAGIC_DARKEN,
|
||||
|
||||
MAGIC_CHALK,
|
||||
MAGIC_DRIP,
|
||||
MAGIC_BLOCKS,
|
||||
|
||||
MAGIC_THICK,
|
||||
MAGIC_THIN,
|
||||
|
||||
MAGIC_NEGATIVE,
|
||||
MAGIC_TINT,
|
||||
|
||||
MAGIC_DRIP,
|
||||
MAGIC_CARTOON,
|
||||
|
||||
MAGIC_FILL,
|
||||
MAGIC_SMUDGE,
|
||||
|
||||
NUM_MAGICS
|
||||
};
|
||||
|
|
@ -53,19 +55,24 @@ const char * const magic_names[NUM_MAGICS] = {
|
|||
gettext_noop("Flip"),
|
||||
|
||||
gettext_noop("Blur"),
|
||||
gettext_noop("Blocks"),
|
||||
gettext_noop("Smudge"),
|
||||
|
||||
gettext_noop("Negative"),
|
||||
gettext_noop("Fade"),
|
||||
gettext_noop("Darken"),
|
||||
|
||||
gettext_noop("Chalk"),
|
||||
gettext_noop("Drip"),
|
||||
gettext_noop("Blocks"),
|
||||
|
||||
gettext_noop("Thick"),
|
||||
gettext_noop("Thin"),
|
||||
|
||||
gettext_noop("Fill"),
|
||||
gettext_noop("Smudge"),
|
||||
gettext_noop("Negative"),
|
||||
gettext_noop("Tint"),
|
||||
|
||||
gettext_noop("Drip"),
|
||||
gettext_noop("Cartoon"),
|
||||
|
||||
gettext_noop("Fill")
|
||||
};
|
||||
|
||||
|
||||
|
|
@ -79,25 +86,30 @@ const char * const magic_tips[NUM_MAGICS] = {
|
|||
gettext_noop("Click to flip the picture upside-down."),
|
||||
|
||||
gettext_noop("Click and move the mouse around to blur the picture."),
|
||||
gettext_noop("Click and move the mouse around to make the picture blocky."),
|
||||
gettext_noop("Click and move the mouse around to smudge the picture."),
|
||||
|
||||
gettext_noop("Click and move the mouse around to draw a negative."),
|
||||
gettext_noop("Click and move to fade the colors."),
|
||||
gettext_noop("Click and move to darken the colors."),
|
||||
|
||||
gettext_noop("Click and move the mouse around to turn the picture into a chalk drawing."),
|
||||
gettext_noop("Click and move the mouse around to make the picture drip."),
|
||||
gettext_noop("Click and move the mouse around to make the picture blocky."),
|
||||
|
||||
gettext_noop("Click and move the mouse to thicken the picture."),
|
||||
gettext_noop("Click and move the mouse to thin the picture."),
|
||||
|
||||
gettext_noop("Click in the picture to fill that area with color."),
|
||||
gettext_noop("Click and move the mouse around to smudge the picture."),
|
||||
gettext_noop("Click and move the mouse around to draw a negative."),
|
||||
gettext_noop("Click and move the mouse around to change the picture's color."),
|
||||
|
||||
gettext_noop("Click and move the mouse around to make the picture drip."),
|
||||
gettext_noop("Click and move the mouse around to turn the picture into a cartoon."),
|
||||
|
||||
gettext_noop("Click in the picture to fill that area with color.")
|
||||
};
|
||||
|
||||
|
||||
/* Tool icon filenames: */
|
||||
|
||||
const char * const magic_img_fnames[NUM_TOOLS] = {
|
||||
const char * const magic_img_fnames[NUM_MAGICS] = {
|
||||
DATA_PREFIX "images/magic/rainbow.png",
|
||||
DATA_PREFIX "images/magic/sparkles.png",
|
||||
|
||||
|
|
@ -105,23 +117,28 @@ const char * const magic_img_fnames[NUM_TOOLS] = {
|
|||
DATA_PREFIX "images/magic/flip.png",
|
||||
|
||||
DATA_PREFIX "images/magic/blur.png",
|
||||
DATA_PREFIX "images/magic/blocks.png",
|
||||
DATA_PREFIX "images/magic/smudge.png",
|
||||
|
||||
DATA_PREFIX "images/magic/negative.png",
|
||||
DATA_PREFIX "images/magic/fade.png",
|
||||
DATA_PREFIX "images/magic/darken.png",
|
||||
|
||||
DATA_PREFIX "images/magic/chalk.png",
|
||||
DATA_PREFIX "images/magic/drip.png",
|
||||
DATA_PREFIX "images/magic/blocks.png",
|
||||
|
||||
DATA_PREFIX "images/magic/thick.png",
|
||||
DATA_PREFIX "images/magic/thin.png",
|
||||
|
||||
DATA_PREFIX "images/magic/fill.png",
|
||||
DATA_PREFIX "images/magic/smudge.png"
|
||||
DATA_PREFIX "images/magic/negative.png",
|
||||
DATA_PREFIX "images/magic/tint.png",
|
||||
|
||||
DATA_PREFIX "images/magic/drip.png",
|
||||
DATA_PREFIX "images/magic/cartoon.png",
|
||||
|
||||
DATA_PREFIX "images/magic/fill.png"
|
||||
};
|
||||
|
||||
|
||||
/* FIXME: Should we should different Tux icons depending on magic,
|
||||
/* FIXME: Should we show different Tux icons depending on magic,
|
||||
like tools? */
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -681,7 +681,7 @@ static int colors_are_selectable;
|
|||
static int been_saved;
|
||||
static char file_id[32];
|
||||
static char starter_id[32];
|
||||
static int brush_scroll, stamp_scroll, font_scroll;
|
||||
static int brush_scroll, stamp_scroll, font_scroll, magic_scroll;
|
||||
static int eraser_sound;
|
||||
|
||||
static char texttool_str[256];
|
||||
|
|
@ -950,6 +950,7 @@ int main(int argc, char * argv[])
|
|||
brush_scroll = 0;
|
||||
stamp_scroll = 0;
|
||||
font_scroll = 0;
|
||||
magic_scroll = 0;
|
||||
|
||||
|
||||
reset_avail_tools();
|
||||
|
|
@ -1704,7 +1705,7 @@ static void mainloop(void)
|
|||
else if (cur_tool == TOOL_MAGIC)
|
||||
{
|
||||
num_things = NUM_MAGICS;
|
||||
thing_scroll = 0;
|
||||
thing_scroll = magic_scroll;
|
||||
}
|
||||
else if (cur_tool == TOOL_ERASER)
|
||||
{
|
||||
|
|
@ -2052,6 +2053,7 @@ static void mainloop(void)
|
|||
}
|
||||
|
||||
cur_magic = cur_thing;
|
||||
magic_scroll = thing_scroll;
|
||||
|
||||
draw_tux_text(TUX_GREAT, magic_tips[cur_magic], 1);
|
||||
|
||||
|
|
@ -2334,7 +2336,7 @@ static void mainloop(void)
|
|||
else if (cur_tool == TOOL_MAGIC)
|
||||
{
|
||||
num_things = NUM_MAGICS;
|
||||
thing_scroll = 0;
|
||||
thing_scroll = magic_scroll;
|
||||
}
|
||||
|
||||
do_draw = 0;
|
||||
|
|
@ -2485,6 +2487,7 @@ static void mainloop(void)
|
|||
}
|
||||
|
||||
cur_magic = cur_thing;
|
||||
magic_scroll = thing_scroll;
|
||||
|
||||
draw_tux_text(TUX_GREAT, magic_tips[cur_magic], 1);
|
||||
|
||||
|
|
@ -2673,7 +2676,7 @@ static void mainloop(void)
|
|||
else if (cur_tool == TOOL_MAGIC)
|
||||
{
|
||||
num_things = NUM_MAGICS;
|
||||
thing_scroll = 0;
|
||||
thing_scroll = magic_scroll;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -6794,7 +6797,7 @@ static void draw_toolbar(void)
|
|||
|
||||
static void draw_magic(void)
|
||||
{
|
||||
int i;
|
||||
int magic, i, max, off_y;
|
||||
SDL_Rect dest;
|
||||
|
||||
|
||||
|
|
@ -6803,15 +6806,54 @@ static void draw_magic(void)
|
|||
|
||||
draw_image_title(TITLE_MAGIC, WINDOW_WIDTH - 96);
|
||||
|
||||
for (i = 0; i < 14 + TOOLOFFSET; i++)
|
||||
if (NUM_MAGICS > 14 + TOOLOFFSET)
|
||||
{
|
||||
dest.x = WINDOW_WIDTH - 96 + ((i % 2) * 48);
|
||||
dest.y = ((i / 2) * 48) + 40;
|
||||
off_y = 24;
|
||||
max = 12 + TOOLOFFSET;
|
||||
|
||||
dest.x = WINDOW_WIDTH - 96;
|
||||
dest.y = 40;
|
||||
|
||||
if (i < NUM_MAGICS)
|
||||
if (magic_scroll > 0)
|
||||
{
|
||||
if (i == cur_magic)
|
||||
SDL_BlitSurface(img_scroll_up, NULL, screen, &dest);
|
||||
}
|
||||
else
|
||||
{
|
||||
SDL_BlitSurface(img_scroll_up_off, NULL, screen, &dest);
|
||||
}
|
||||
|
||||
dest.x = WINDOW_WIDTH - 96;
|
||||
dest.y = 40 + 24 + ((6 + TOOLOFFSET / 2) * 48);
|
||||
|
||||
if (magic_scroll < NUM_MAGICS - 12 - TOOLOFFSET)
|
||||
{
|
||||
SDL_BlitSurface(img_scroll_down, NULL, screen, &dest);
|
||||
}
|
||||
else
|
||||
{
|
||||
SDL_BlitSurface(img_scroll_down_off, NULL, screen, &dest);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
off_y = 0;
|
||||
max = 14 + TOOLOFFSET;
|
||||
}
|
||||
|
||||
|
||||
for (magic = magic_scroll;
|
||||
magic < magic_scroll + max;
|
||||
magic++)
|
||||
{
|
||||
i = magic - magic_scroll;
|
||||
|
||||
dest.x = ((i % 2) * 48) + (WINDOW_WIDTH - 96);
|
||||
dest.y = ((i / 2) * 48) + 40 + off_y;
|
||||
|
||||
if (magic < NUM_MAGICS)
|
||||
{
|
||||
if (magic == cur_magic)
|
||||
{
|
||||
SDL_BlitSurface(img_btn_down, NULL, screen, &dest);
|
||||
}
|
||||
|
|
@ -6821,16 +6863,17 @@ static void draw_magic(void)
|
|||
}
|
||||
|
||||
dest.x = WINDOW_WIDTH - 96 + ((i % 2) * 48) + 4;
|
||||
dest.y = ((i / 2) * 48) + 40 + 4;
|
||||
dest.y = ((i / 2) * 48) + 40 + 4 + off_y;
|
||||
|
||||
SDL_BlitSurface(img_magics[i], NULL, screen, &dest);
|
||||
SDL_BlitSurface(img_magics[magic], NULL, screen, &dest);
|
||||
|
||||
|
||||
dest.x = WINDOW_WIDTH - 96 + ((i % 2) * 48) + 4 +
|
||||
(40 - img_magic_names[i]->w) / 2;
|
||||
dest.y = ((i / 2) * 48) + 40 + 4 + (44 - img_magic_names[i]->h);
|
||||
(40 - img_magic_names[magic]->w) / 2;
|
||||
dest.y = (((i / 2) * 48) + 40 + 4 +
|
||||
(44 - img_magic_names[magic]->h) + off_y);
|
||||
|
||||
SDL_BlitSurface(img_magic_names[i], NULL, screen, &dest);
|
||||
SDL_BlitSurface(img_magic_names[magic], NULL, screen, &dest);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue