diff --git a/docs/AUTHORS.txt b/docs/AUTHORS.txt index f7c086777..46b618622 100644 --- a/docs/AUTHORS.txt +++ b/docs/AUTHORS.txt @@ -153,13 +153,19 @@ June 17, 2002 - May 28, 2024 Scanline polygon fill routine based on public-domain code by Darel Rex Finley, 2007 - Filled Polygon sound effects (place, move, finish) based on + Filled Polygon "place", "move", and "finish" sound effects based on "success_02.wav" (https://freesound.org/people/Kenneth_Cooney/sounds/463067/), "success.wav" (https://freesound.org/people/Kenneth_Cooney/sounds/457547/), & "Completed.wav" (https://freesound.org/people/Kenneth_Cooney/sounds/609336/) respectively. Creative Commons 0 by Kenneth Cooney + Filled Polygon "nearby" sound effect based on "JacobsLadderSingle2.flac" + . + Creative Commons Attribution 4.0 by Eliot Lash + + + Bloom magic tool by Bill Kendrick Googly Eyes sound effect: "Torch Crackle.wav" diff --git a/docs/CHANGES.txt b/docs/CHANGES.txt index 4a788e455..4acb67475 100644 --- a/docs/CHANGES.txt +++ b/docs/CHANGES.txt @@ -21,10 +21,15 @@ https://tuxpaint.org/ + Code & icon by Bill Kendrick + Scanline polygon fill routine based on public-domain code by Darel Rex Finley, 2007 - + + Sound effects based on + - "success.wav", "success_02.wav", and "Completed.wav", + Creative Commons 0 by Kenneth Cooney + + + - "JacobsLadderSingle2.flac", + Creative Commons Attribution 4.0 by Eliot Lash + + Closes https://sourceforge.net/p/tuxpaint/feature-requests/251/ * Magic Tool Improvements: diff --git a/magic/sounds/polyfill_nearby.ogg b/magic/sounds/polyfill_nearby.ogg new file mode 100644 index 000000000..fd18d7b2b Binary files /dev/null and b/magic/sounds/polyfill_nearby.ogg differ diff --git a/magic/src/polyfill.c b/magic/src/polyfill.c index ad78eb8f3..7413be8cb 100644 --- a/magic/src/polyfill.c +++ b/magic/src/polyfill.c @@ -41,6 +41,7 @@ char *polyfill_icon_filenames[NUM_TOOLS] = { enum { SND_PLACE, SND_MOVE, + SND_NEARBY, SND_FINISH, NUM_SOUNDS }; @@ -48,6 +49,7 @@ enum { char *polyfill_snd_filenames[NUM_SOUNDS] = { "polyfill_place.ogg", "polyfill_move.ogg", + "polyfill_nearby.ogg", "polyfill_finish.ogg", }; @@ -281,7 +283,29 @@ polyfill_drag(magic_api * api, int which ATTRIBUTE_UNUSED, polyfill_pt_y[polyfill_editing] = y; polyfill_draw_preview(api, canvas, 1); - api->playsound(snd_effects[SND_MOVE], (x * 255) / canvas->w, 255); + + if (polyfill_editing == polyfill_num_pts - 1 && + polyfill_num_pts >= 3 && + x >= polyfill_pt_x[0] - SNAP_SIZE && + x <= polyfill_pt_x[0] + SNAP_SIZE && + y >= polyfill_pt_y[0] - SNAP_SIZE && + y <= polyfill_pt_y[0] + SNAP_SIZE) { + /* If placing/moving the final (red) point, and it's + near the initial (green) point, play an electrostatic sound */ + api->playsound(snd_effects[SND_NEARBY], (x * 255) / canvas->w, 255); + } else if (polyfill_editing == 0 && + polyfill_num_pts >= 3 && + x >= polyfill_pt_x[polyfill_num_pts - 1] - SNAP_SIZE && + x <= polyfill_pt_x[polyfill_num_pts - 1] + SNAP_SIZE && + y >= polyfill_pt_y[polyfill_num_pts - 1] - SNAP_SIZE && + y <= polyfill_pt_y[polyfill_num_pts - 1] + SNAP_SIZE) { + /* If moving the initial (green) point, and it's + near the final (red) point, also play an electrostatic sound */ + api->playsound(snd_effects[SND_NEARBY], (x * 255) / canvas->w, 255); + } else { + /* Otherwise, play the normal "moving a point" sound */ + api->playsound(snd_effects[SND_MOVE], (x * 255) / canvas->w, 255); + } update_rect->x = 0; update_rect->y = 0;