diff --git a/docs/AUTHORS.txt b/docs/AUTHORS.txt index 559940667..71a9b8492 100644 --- a/docs/AUTHORS.txt +++ b/docs/AUTHORS.txt @@ -6,7 +6,7 @@ Copyright (c) 2002-2023 Various contributors (see below, and CHANGES.txt) https://tuxpaint.org/ -June 17, 2002 - January 30, 2023 +June 17, 2002 - February 7, 2023 * Design and Coding: @@ -131,6 +131,12 @@ June 17, 2002 - January 30, 2023 (https://freesound.org/people/Kawgrim/sounds/584865/) Creative Commons 0 by Kawgrim + Bloom magic tool + by Bill Kendrick + Googly Eyes sound effect: "Torch Crackle.wav" + (https://freesound.org/people/kentnelson64/sounds/647221/) + Creative Commons 0 license by "kentnelson64" + Mouse accessibility code and keyboard access Ankit Choudary , as part of GSOC 2010, with integration and fixes by Pere Pujal i Carabantes diff --git a/docs/CHANGES.txt b/docs/CHANGES.txt index 083f0697b..efaef7abe 100644 --- a/docs/CHANGES.txt +++ b/docs/CHANGES.txt @@ -7,7 +7,7 @@ Various contributors (see below, and AUTHORS.txt) https://tuxpaint.org/ -2023.February.6 (0.9.29) +2023.February.7 (0.9.29) * Improvements to "Stamp" tool: ----------------------------- * Stamps may now be rotated. @@ -44,9 +44,8 @@ https://tuxpaint.org/ * "Bloom" - Apply a glowing light bloom effect to the image. Bill Kendrick - - [WIP] - Bloom icon needed - [WIP] - Bloom sound effect needed + (Sound effected licensed as Creative Commons 0 (CC0 1.0) + by https://freesound.org/people/kentnelson64/) * [WIP] "Rivulet"; apply rivulets of water to the canvas - needs better icon diff --git a/magic/sounds/bloom.ogg b/magic/sounds/bloom.ogg new file mode 100644 index 000000000..df839e1f4 Binary files /dev/null and b/magic/sounds/bloom.ogg differ diff --git a/magic/src/bloom.c b/magic/src/bloom.c index 930bd5c94..3fc0fe983 100644 --- a/magic/src/bloom.c +++ b/magic/src/bloom.c @@ -64,6 +64,9 @@ void bloom_line_callback_drag(void *ptr, int which, SDL_Surface * canvas, void bloom_release(magic_api * api, int which, SDL_Surface * canvas, SDL_Surface * snapshot, int x, int y, SDL_Rect * update_rect); +void bloom_apply_effect(magic_api * api, + SDL_Surface * canvas, + SDL_Surface * snapshot); void bloom_switchin(magic_api * api, int which, int mode, SDL_Surface * canvas); void bloom_switchout(magic_api * api, int which, int mode, @@ -83,7 +86,7 @@ int bloom_init(magic_api * api) snprintf(fname, sizeof(fname), "%ssounds/magic/bloom.ogg", api->data_directory); - snd_effects = NULL; /* FIXME Mix_LoadWAV(fname); */ + snd_effects = Mix_LoadWAV(fname); bloom_scale = sqrt(2 * (BLOOM_PAINT_RADIUS * BLOOM_PAINT_RADIUS)); @@ -172,8 +175,7 @@ bloom_click(magic_api * api, int which, int mode, } memset(bloom_mask, 128, (canvas->w * canvas->h)); - bloom_release(api, which, canvas, snapshot, x, y, - update_rect); + bloom_apply_effect(api, canvas, snapshot); update_rect->x = 0; update_rect->y = 0; @@ -202,22 +204,33 @@ bloom_drag(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, SDL_Sur void bloom_release(magic_api * api, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, - SDL_Surface * snapshot ATTRIBUTE_UNUSED, + SDL_Surface * canvas, + SDL_Surface * snapshot, int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, - SDL_Rect * update_rect ATTRIBUTE_UNUSED) { - int sample, offset, offset_flip, xx, yy; - Uint8 r, g, b; - float rf, gf, bf, mask_weight, lum; - float sums[3]; - Uint32 color; - + SDL_Rect * update_rect) { if (bloom_mask == NULL) return; if (snd_effects != NULL) api->stopsound(); + bloom_apply_effect(api, canvas, snapshot); + + update_rect->x = 0; + update_rect->y = 0; + update_rect->w = canvas->w; + update_rect->h = canvas->h; +} + +void bloom_apply_effect(magic_api * api, + SDL_Surface * canvas, + SDL_Surface * snapshot) { + int sample, offset, offset_flip, x, y, xx, yy; + Uint8 r, g, b; + float rf, gf, bf, mask_weight, lum; + float sums[3]; + Uint32 color; + SDL_BlitSurface(snapshot, NULL, canvas, NULL); for (y = 0; y < canvas->h; y++) { @@ -296,11 +309,6 @@ void bloom_release(magic_api * api, int which ATTRIBUTE_UNUSED, } } } - - update_rect->x = 0; - update_rect->y = 0; - update_rect->w = canvas->w; - update_rect->h = canvas->h; }