More tools' fullscreen: update progress bar

Progress animation shown during
Emboss, Sharpen/Edge/Silhouette, Blur,

Also, play Glass Tile sound in fullscreen mode.
This commit is contained in:
Bill Kendrick 2021-11-08 20:46:24 -08:00
parent 83558f8343
commit 03b3ada567
5 changed files with 27 additions and 15 deletions

View file

@ -8,7 +8,7 @@ http://www.tuxpaint.org/
$Id$ $Id$
2021.November.4 (0.9.27) 2021.November.8 (0.9.27)
* New Magic Tools: * New Magic Tools:
---------------- ----------------
* "Lightning" - Draws a bolt of lightning striking between * "Lightning" - Draws a bolt of lightning striking between
@ -44,6 +44,10 @@ $Id$
* "Blocks", "Cartoon", "Chalk", "Emboss", and "Halftone" can all now * "Blocks", "Cartoon", "Chalk", "Emboss", and "Halftone" can all now
affect the entire image at once. 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: * Improvements to "Paint" and "Lines" tools:
------------------------------------------ ------------------------------------------
* Rotational brushes now supported. Unlike "directional" * Rotational brushes now supported. Unlike "directional"

View file

@ -25,7 +25,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
(See COPYING.txt) (See COPYING.txt)
Last updated: September 20, 2021 Last updated: November 8, 2021
$Id$ $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 // Do the effect for the full image
static void do_blur_full(void *ptr, SDL_Surface * canvas, SDL_Surface * last, int which) 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; int x, y;
for (y = 0; y < last->h; y++) for (y = 0; y < last->h; y++)
{ {
if (y % 10 == 0) {
api->update_progress_bar();
}
for (x = 0; x < last->w; x++) 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);
} }
} }
} }

View file

@ -23,7 +23,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
(See COPYING.txt) (See COPYING.txt)
Last updated: September 20, 2021 Last updated: November 8, 2021
$Id$ $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); emboss_drag(api, which, canvas, last, x, y, x, y, update_rect);
} else { } else {
for (y = 0; y < canvas->h; y++) { for (y = 0; y < canvas->h; y++) {
if (y % 10 == 0) {
api->update_progress_bar();
}
for (x = 0; x < canvas->w; x++) { for (x = 0; x < canvas->w; x++) {
emboss_pixel(api, last, x, y, canvas); emboss_pixel(api, last, x, y, canvas);
} }

View file

@ -23,7 +23,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
(See COPYING.txt) (See COPYING.txt)
Last updated: September 21, 2021 Last updated: November 8, 2021
$Id$ $Id$
*/ */
@ -272,7 +272,7 @@ void glasstile_click(magic_api * api, int which, int mode,
update_rect->w = canvas->w; update_rect->w = canvas->w;
update_rect->h = canvas->h; update_rect->h = canvas->h;
/* FIXME: Play sfx */ api->playsound(glasstile_snd, 128, 255);
} }
} }

View file

@ -6,7 +6,7 @@
Credits: Andrew Corcoran <akanewbie@gmail.com> Credits: Andrew Corcoran <akanewbie@gmail.com>
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 bill@newbreedsoftware.com
http://www.tuxpaint.org/ http://www.tuxpaint.org/
@ -25,7 +25,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
(See COPYING.txt) (See COPYING.txt)
Last updated: May 6, 2009 Last updated: May 6, 2021
$Id$ $Id$
*/ */
@ -177,7 +177,6 @@ static int sharpen_grey(Uint8 r1, Uint8 g1, Uint8 b1)
// Do the effect: // Do the effect:
static void do_sharpen_pixel(void *ptr, int which, SDL_Surface * canvas, SDL_Surface * last, int x, int y) 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; magic_api *api = (magic_api *) ptr;
Uint8 r1, g1, b1; 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 // Do the effect for the full image
static void do_sharpen_full(void *ptr, SDL_Surface * canvas, SDL_Surface * last, int which) 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; int x, y;
for (y = 0; y < last->h; y++) for (y = 0; y < last->h; y++)
{ {
if (y % 10 == 0) {
api->update_progress_bar();
}
for (x = 0; x < last->w; x++) 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);
} }
} }
} }