diff --git a/docs/AUTHORS.txt b/docs/AUTHORS.txt index b88c97e36..903f45581 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 7, 2023 +June 17, 2002 - January 26, 2023 * Design and Coding: @@ -26,7 +26,7 @@ June 17, 2002 - January 7, 2023 Albert Cahalan Bilinear interpolation code based on an example by Christian Graus - ( http://www.codeproject.com/cs/media/imageprocessing4.asp ). + (http://www.codeproject.com/cs/media/imageprocessing4.asp) Input Method (IM) Framework implemented by: Mark K. Kim @@ -109,6 +109,12 @@ June 17, 2002 - January 7, 2023 (https://freesound.org/people/MrFossy/sounds/590303/) Creative Commons 0 license by "MrFossy" + Maze magic tool and artwork + by Bill Kendrick + Maze sound effect: "01-35 Footsteps, Wood, Socks, Running 2.wav" + (https://freesound.org/people/SpliceSound/sounds/369834/) + Creative Commons 0 by Julian Evans + 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 1106cfe63..4dd2f90ca 100644 --- a/docs/CHANGES.txt +++ b/docs/CHANGES.txt @@ -26,9 +26,9 @@ https://tuxpaint.org/ - needs sound effect - effect needs improvement - * [WIP] "Maze"; draw a maze pattern over part or all of - your drawing. - - needs sound effect + * "Maze"; draw a maze pattern over part or all of your drawing. + (Sound effect licensed as Creative Commons 0 by + Julian Evans, https://www.julianevans.info/) * Improvements to Magic Tools: ---------------------------- diff --git a/magic/sounds/maze.ogg b/magic/sounds/maze.ogg new file mode 100644 index 000000000..88b94a0dd Binary files /dev/null and b/magic/sounds/maze.ogg differ diff --git a/magic/src/maze.c b/magic/src/maze.c index fc934591d..ff3932228 100644 --- a/magic/src/maze.c +++ b/magic/src/maze.c @@ -85,10 +85,9 @@ int maze_init(magic_api * api) { char fname[1024]; - /* FIXME */ -// snprintf(fname, sizeof(fname), "%ssounds/magic/maze.ogg", -// api->data_directory); -// snd_effect = Mix_LoadWAV(fname); + snprintf(fname, sizeof(fname), "%ssounds/magic/maze.ogg", + api->data_directory); + snd_effect = Mix_LoadWAV(fname); return (1); } @@ -179,10 +178,7 @@ maze_click(magic_api * api, int which, int mode, return; if (snd_effect != NULL) - { - api->stopsound(); - api->playsound(snd_effect, (x * 255) / canvas->w, 255); - } + api->stopsound(); maze_start_x = floor(x / MAZE_BLOCK_SIZE) * MAZE_BLOCK_SIZE + (MAZE_BLOCK_SIZE / 2); maze_start_y = floor(y / MAZE_BLOCK_SIZE) * MAZE_BLOCK_SIZE + (MAZE_BLOCK_SIZE / 2); @@ -201,6 +197,8 @@ maze_click(magic_api * api, int which, int mode, for (x = 0; x < canvas->w; x++) maze_color[y * canvas->w + x] = color; + api->playsound(snd_effect, 128, 255); + maze_render(api, canvas); num_maze_starts = 0; @@ -235,6 +233,9 @@ void maze_release(magic_api * api, int which ATTRIBUTE_UNUSED, SDL_Surface * canvas, SDL_Surface * snapshot ATTRIBUTE_UNUSED, int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect * update_rect) { + if (snd_effect != NULL) + api->stopsound(); + maze_collapse_contiguous(canvas); maze_add_start(); @@ -361,6 +362,9 @@ void maze_line_callback_drag(void *ptr, int which ATTRIBUTE_UNUSED, int xx, yy, idx; Uint32 color; + if (snd_effect != NULL) + api->playsound(snd_effect, (x * 255) / canvas->w, 255); + color = SDL_MapRGB(canvas->format, maze_r, maze_g, maze_b); x = floor(x / (MAZE_BLOCK_SIZE * 3)) * (MAZE_BLOCK_SIZE * 3);