From cde09415090ac4533d38455a1c1ce69641a4f799 Mon Sep 17 00:00:00 2001 From: Bill Kendrick Date: Mon, 8 Nov 2021 20:33:57 -0800 Subject: [PATCH 1/4] Blocks/Chalk fullscreen; play sound, add prog bar --- magic/src/blocks_chalk_drip.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/magic/src/blocks_chalk_drip.c b/magic/src/blocks_chalk_drip.c index 935f3a947..715618fb5 100644 --- a/magic/src/blocks_chalk_drip.c +++ b/magic/src/blocks_chalk_drip.c @@ -1,6 +1,6 @@ /* blocks_chalk_drip.c -// + Blocks, Chalk and Drip Magic Tools Plugin Tux Paint - A simple drawing program for children. @@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA (See COPYING.txt) - Last updated: October 27, 2021 + Last updated: November 8, 2021 $Id$ */ @@ -325,6 +325,10 @@ void blocks_chalk_drip_click(magic_api * api, int which, int mode, blocks_chalk_drip_drag(api, which, canvas, last, x, y, x, y, update_rect); } else /* MODE_FULLSCREEN */ { for (y = 0; y < canvas->h; y += EFFECT_REZ) { + if (y % 10 == 0) { + api->update_progress_bar(); + } + for (x = 0; x < canvas->w; x += EFFECT_REZ) { blocks_chalk_drip_linecb(api, which, canvas, last, x, y); } @@ -333,6 +337,8 @@ void blocks_chalk_drip_click(magic_api * api, int which, int mode, update_rect->y = 0; update_rect->w = canvas->w; update_rect->h = canvas->h; + + api->playsound(snd_effect[which], (x * 255) / canvas->w, 255); } } From 83558f8343da65fd36b2f21777db7ace5bec8729 Mon Sep 17 00:00:00 2001 From: Bill Kendrick Date: Mon, 8 Nov 2021 20:37:19 -0800 Subject: [PATCH 2/4] Cartoon fullscreen: play sound, show progress bar --- magic/src/cartoon.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/magic/src/cartoon.c b/magic/src/cartoon.c index 25fb823f2..6eec4c0ce 100644 --- a/magic/src/cartoon.c +++ b/magic/src/cartoon.c @@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA (See COPYING.txt) - Last updated: November 4, 2021 + Last updated: November 8, 2021 $Id$ */ @@ -227,6 +227,10 @@ void cartoon_click(magic_api * api, int which, int mode, { for (y = 0; y < canvas->h; y++) { + if (y % 10 == 0) { + api->update_progress_bar(); + } + for (x = 0; x < canvas->w; x++) { cartoon_apply_colors(api, last, x, y); @@ -234,6 +238,10 @@ void cartoon_click(magic_api * api, int which, int mode, } for (y = 0; y < canvas->h; y++) { + if (y % 10 == 0) { + api->update_progress_bar(); + } + for (x = 0; x < canvas->w; x++) { cartoon_apply_outline(api, x, y); @@ -246,6 +254,8 @@ void cartoon_click(magic_api * api, int which, int mode, } else { + api->playsound(cartoon_snd, 128, 255); + SDL_BlitSurface(result_surf, NULL, canvas, NULL); update_rect->x = 0; update_rect->y = 0; From 03b3ada5671cfdf7907b5f86847712e9bcc49817 Mon Sep 17 00:00:00 2001 From: Bill Kendrick Date: Mon, 8 Nov 2021 20:46:24 -0800 Subject: [PATCH 3/4] More tools' fullscreen: update progress bar Progress animation shown during Emboss, Sharpen/Edge/Silhouette, Blur, Also, play Glass Tile sound in fullscreen mode. --- docs/CHANGES.txt | 6 +++++- magic/src/blur.c | 12 +++++++----- magic/src/emboss.c | 6 +++++- magic/src/glasstile.c | 4 ++-- magic/src/sharpen.c | 14 ++++++++------ 5 files changed, 27 insertions(+), 15 deletions(-) diff --git a/docs/CHANGES.txt b/docs/CHANGES.txt index bc7903bb5..feed8c26b 100644 --- a/docs/CHANGES.txt +++ b/docs/CHANGES.txt @@ -8,7 +8,7 @@ http://www.tuxpaint.org/ $Id$ -2021.November.4 (0.9.27) +2021.November.8 (0.9.27) * New Magic Tools: ---------------- * "Lightning" - Draws a bolt of lightning striking between @@ -44,6 +44,10 @@ $Id$ * "Blocks", "Cartoon", "Chalk", "Emboss", and "Halftone" can all now affect the entire image at once. + * More tools update progress bar while doing lots of work + (mostly full-screen mode). More tools play their sound effects + when applying effects in full-screen mode. + * Improvements to "Paint" and "Lines" tools: ------------------------------------------ * Rotational brushes now supported. Unlike "directional" diff --git a/magic/src/blur.c b/magic/src/blur.c index e3608683c..430e0d5ab 100644 --- a/magic/src/blur.c +++ b/magic/src/blur.c @@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA (See COPYING.txt) - Last updated: September 20, 2021 + Last updated: November 8, 2021 $Id$ */ @@ -185,16 +185,18 @@ static void do_blur_pixel(void *ptr, int which ATTRIBUTE_UNUSED, SDL_Surface * c // Do the effect for the full image static void do_blur_full(void *ptr, SDL_Surface * canvas, SDL_Surface * last, int which) { - - //magic_api * api = (magic_api *) ptr; - + magic_api * api = (magic_api *) ptr; int x, y; for (y = 0; y < last->h; y++) { + if (y % 10 == 0) { + api->update_progress_bar(); + } + for (x = 0; x < last->w; x++) { - do_blur_pixel(ptr, which, canvas, last, x, y); + do_blur_pixel(api, which, canvas, last, x, y); } } } diff --git a/magic/src/emboss.c b/magic/src/emboss.c index 0ec2d0172..935d0f528 100644 --- a/magic/src/emboss.c +++ b/magic/src/emboss.c @@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA (See COPYING.txt) - Last updated: September 20, 2021 + Last updated: November 8, 2021 $Id$ */ @@ -204,6 +204,10 @@ void emboss_click(magic_api * api, int which, int mode, emboss_drag(api, which, canvas, last, x, y, x, y, update_rect); } else { for (y = 0; y < canvas->h; y++) { + if (y % 10 == 0) { + api->update_progress_bar(); + } + for (x = 0; x < canvas->w; x++) { emboss_pixel(api, last, x, y, canvas); } diff --git a/magic/src/glasstile.c b/magic/src/glasstile.c index b19d75cbc..24bb9c16f 100644 --- a/magic/src/glasstile.c +++ b/magic/src/glasstile.c @@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA (See COPYING.txt) - Last updated: September 21, 2021 + Last updated: November 8, 2021 $Id$ */ @@ -272,7 +272,7 @@ void glasstile_click(magic_api * api, int which, int mode, update_rect->w = canvas->w; update_rect->h = canvas->h; - /* FIXME: Play sfx */ + api->playsound(glasstile_snd, 128, 255); } } diff --git a/magic/src/sharpen.c b/magic/src/sharpen.c index 49b0e2b2b..82e98a18b 100644 --- a/magic/src/sharpen.c +++ b/magic/src/sharpen.c @@ -6,7 +6,7 @@ Credits: Andrew Corcoran - Copyright (c) 2002-2009 by Bill Kendrick and others; see AUTHORS.txt + Copyright (c) 2002-2021 by Bill Kendrick and others; see AUTHORS.txt bill@newbreedsoftware.com http://www.tuxpaint.org/ @@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA (See COPYING.txt) - Last updated: May 6, 2009 + Last updated: May 6, 2021 $Id$ */ @@ -177,7 +177,6 @@ static int sharpen_grey(Uint8 r1, Uint8 g1, Uint8 b1) // Do the effect: static void do_sharpen_pixel(void *ptr, int which, SDL_Surface * canvas, SDL_Surface * last, int x, int y) { - magic_api *api = (magic_api *) ptr; Uint8 r1, g1, b1; @@ -239,16 +238,19 @@ static void do_sharpen_pixel(void *ptr, int which, SDL_Surface * canvas, SDL_Sur // Do the effect for the full image static void do_sharpen_full(void *ptr, SDL_Surface * canvas, SDL_Surface * last, int which) { - - // magic_api * api = (magic_api *) ptr; + magic_api * api = (magic_api *) ptr; int x, y; for (y = 0; y < last->h; y++) { + if (y % 10 == 0) { + api->update_progress_bar(); + } + for (x = 0; x < last->w; x++) { - do_sharpen_pixel(ptr, which, canvas, last, x, y); + do_sharpen_pixel(api, which, canvas, last, x, y); } } } From c31e0cd504ae9653cad560179a26d26fcf7d0328 Mon Sep 17 00:00:00 2001 From: dolphin6k Date: Tue, 9 Nov 2021 23:01:19 +0900 Subject: [PATCH 4/4] Updated Japanese translations. --- src/po/ja.po | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/po/ja.po b/src/po/ja.po index ca6298d50..72cadea57 100644 --- a/src/po/ja.po +++ b/src/po/ja.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: tuxpaint 0.9.23\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-11-07 20:32-0800\n" -"PO-Revision-Date: 2021-10-30 18:22+0900\n" +"PO-Revision-Date: 2021-11-09 23:01+0900\n" "Last-Translator: Shin-ichi TOYAMA \n" "Language-Team: japanese \n" "Language: ja\n" @@ -1207,10 +1207,8 @@ msgid "Lightning" msgstr "いなずま" #: ../../magic/src/lightning.c:88 -#, fuzzy -#| msgid "Click, drag, and release to a lightning bolt between two points." msgid "Click, drag, and release to draw a lightning bolt between two points." -msgstr "クリックしたあとドラッグして いなずまを かこう。" +msgstr "クリックしたまま マウスをうごかして いなずまを えがこう。" #: ../../magic/src/metalpaint.c:99 msgid "Metal Paint" @@ -1435,14 +1433,12 @@ msgstr "" #: ../../magic/src/reflection.c:110 msgid "Reflection" -msgstr "" +msgstr "はんしゃ" #: ../../magic/src/reflection.c:120 -#, fuzzy -#| msgid "" -#| "Click and drag the mouse to add a mosaic effect to parts of your picture." msgid "Click and drag the mouse around to add a reflection to your picture." -msgstr "クリックしたまま マウスをうごかして モザイクえのようにしよう。" +msgstr "" +"クリックしたまま マウスをうごかして かがみにうつったような えに しよう。" #: ../../magic/src/ripples.c:103 msgid "Ripples"