From 6a26679fa12744cc1f0b0318d76762d19a16c45e Mon Sep 17 00:00:00 2001 From: William Kendrick Date: Sat, 11 Dec 2004 11:21:16 +0000 Subject: [PATCH] Allowed for more than 14 Magic tools. Began work to add new Magic tools: Tint, Darken, Cartoon. --- data/images/magic/cartoon.png | Bin 0 -> 1115 bytes data/images/magic/darken.png | Bin 0 -> 791 bytes data/images/magic/tint.png | Bin 0 -> 931 bytes src/magic.h | 77 +++++++++++++++++++++------------- src/tuxpaint.c | 73 +++++++++++++++++++++++++------- 5 files changed, 105 insertions(+), 45 deletions(-) create mode 100644 data/images/magic/cartoon.png create mode 100644 data/images/magic/darken.png create mode 100644 data/images/magic/tint.png diff --git a/data/images/magic/cartoon.png b/data/images/magic/cartoon.png new file mode 100644 index 0000000000000000000000000000000000000000..5613dd21731ffc53e3a010dc7dd91fbd22ca3ae8 GIT binary patch literal 1115 zcmV-h1f=_kP)X00006VoOIv0RI60 z0RN!9r;`8x010qNS#tmY3ljhU3ljkVnw%H_000McNliru)C>y?3@R+q_o4s*03CEi zSad^gZEa<4bO1wgWnpw>WFU8GbZ8({Xk{QrNlj4iWF>9@00X~CL_t(o!^N0MY)w%Z z$A7Qy^$oX%q7_qPikKTQMb!ckBqgL4g2c)e>B35gG+|*QB*ennUa+ERib#Zo4q^%= zh@rHl+Tyi+Hvf}+IquWNg z=m5?DCW@&+1GHQHplL&z=lTpVA6QvPfU|TRG20l|wkM=3GJV8r0BZ{YFs6R0n24*T zq#w|n6p%EwS1i2+zMzl*C(3J`$3{%ti;6`TX5s=EH(;Y$WWfL?jO|6FPa1$O4hCvT z!?tBLo6H0b1Fsb&tn>lbW$#%5rhyU@dWr>h$gr6Zu)wgHls*A;hP=NNr~&o^oBy(a z3&7nlpi$!_Q;j{jEle6PffnI6$7(Zh%L8`;I1S8|?l#b*xy@SCY{k-AE%YAn!)Ndb zu)=t6THBj3^L!Tl*5rY!2M%i72)qDVye$r-p9^dN>ZGrCOgaWXDNs-LvP8mTFz}dj z{Znm|W$uv1H-IZDFw)-Erh&Ht857Vd%cM&r2sIFL!%jr%=A92xSxg4i07BcCjSOK`KaN|6@6L_qTH-$VK7^i3% zVQg*zt^wPCAU4e8y(9d{n>@Cbkigv$R&Iq!HSkcan*SiN9BiW3T#uIY5snJx|oumso$tX6CqqjXrRdljmrtHtso9b0P^ zY-3qcTsCkuz;=z#0{4dl*rf;8X3skI literal 0 HcmV?d00001 diff --git a/data/images/magic/darken.png b/data/images/magic/darken.png new file mode 100644 index 0000000000000000000000000000000000000000..ce5bade636f6fb519085fc2c83fedd9b117e7489 GIT binary patch literal 791 zcmV+y1L*vTP)X00006VoOIv0RI60 z0RN!9r;`8x010qNS#tmY3ljhU3ljkVnw%H_000McNliru)C>y?4hAeg`NIGJ03CEi zSad^gZEa<4bO1wgWnpw>WFU8GbZ8({Xk{QrNlj4iWF>9@00MhSL_t(o!`0YZh>cMc z2k_r8Q!XKcl3O7jT$0EwB}sT8rKETumlq^2QiQx1%H=`A6CNZFLhú|~12q_Zf zmP;79zpQUMKHr)1&CHn`|Ju#j>)UJhZ>_ced+n)`jj9+wwGYN(Nc{eYn|M`>NP_-Y ziZK|38f?J@)M9O{e~im$z^_)2+kk}`_Jc7p2^Mo|4qvbb=OYTGP=$3^(#)DO*qU~# z##MA^L&~1vEN(@F-{D7m>xAyujLA9nT8%5|2#&@Pm4V~fl~sd7ak2sk&c@4RQkd39 z*iiulUlvZ%b$79ioA1MT%)pu``j(<+nUEhb?A&fzI8MZu3kubg{4h=cYQ z+x1vnrZk;EUBSE-2QVzB|3rK%j9~vV*Waj!TvAVsxR3cQNb~i=8l2J JRzte)6 zTps$|MDR&F5FD3btIz5CGwA~og4b}g%mn*o*cx*BE=v=Hy;0oliT63y9L4QoI#?Ic zEC-%v*m{)ksgFPv73!)M=v67)$gqtl;j=AmNE6%`cXBz9bz*0h@cG;v!38nOCDeCP zw$T~VlSc2fArb06I8-Kb=de9xtHsV7X00006VoOIv0RI60 z0RN!9r;`8x010qNS#tmY3ljhU3ljkVnw%H_000McNliru)C>y?5;Ovz^&S8K03CEi zSad^gZEa<4bO1wgWnpw>WFU8GbZ8({Xk{QrNlj4iWF>9@00Rd}L_t(o!|j(%h)rP_ z$A5oBG`^b!&4Ptniju|L9X8llSxB?7P$MbXOg<(Srty)KjbwH9C+V7`{?N|=r{m>u;855XNd>r&fZG*70FD4hL+=W^ zO1*un~*n{0nfQrc~M zw6I2`4&ZJfy(3xusca9QI9tY>SXxt={*2Rsc8sqnpCPJT(^gimg3JisP zkxT>6GH{amB^?g^h@@lT>oV{x>`S}2&vtq*Q#=5UC*!FK(ANOqlMRR`-M&Oprkjg%$N8&m^YUlAY5P$DQBMO;vpSU2 z7qs#<%FDI~W32~Rod(VJz^t4D`cd2oYf0TrML|y`;A%i`3a%hStAa+beGYgId;(r1 z;PwHla#^K5g1<}D4UW2&iQ4u+Lx6w!EY3~w|LazZ@&kkcWipQ#T@nBQ002ovPDHLk FV1lxLrC9&~ literal 0 HcmV?d00001 diff --git a/src/magic.h b/src/magic.h index f6c003e20..d68518370 100644 --- a/src/magic.h +++ b/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,20 +22,25 @@ 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_FILL, - MAGIC_SMUDGE, + MAGIC_NEGATIVE, + MAGIC_TINT, + + MAGIC_DRIP, + MAGIC_CARTOON, + MAGIC_FILL, + 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 draw a negative."), + gettext_noop("Click and move the mouse around to smudge the picture."), + 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/negative.png", + DATA_PREFIX "images/magic/smudge.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? */ diff --git a/src/tuxpaint.c b/src/tuxpaint.c index 793eda28d..43f858955 100644 --- a/src/tuxpaint.c +++ b/src/tuxpaint.c @@ -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 {