diff --git a/docs/AUTHORS.txt b/docs/AUTHORS.txt
index e7a9cc52f..656bc2722 100644
--- a/docs/AUTHORS.txt
+++ b/docs/AUTHORS.txt
@@ -6,7 +6,7 @@ Copyright (c) 2002-2024
Various contributors (see below, and CHANGES.txt)
https://tuxpaint.org/
-June 17, 2002 - January 13, 2024
+June 17, 2002 - March 19, 2024
* Design and Coding:
@@ -141,6 +141,13 @@ June 17, 2002 - January 13, 2024
(https://freesound.org/people/Kawgrim/sounds/584865/)
Creative Commons 0 by Kawgrim
+ Dither & Dither (Keep Color) magic tools and artwork
+ by Bill Kendrick
+
+ Dither & Dither (Keep Color) sound effects based on "Orion FIll.wav"
+ (https://freesound.org/people/KatHakaku/sounds/54112/)
+ Creative Commons 0 by KatHakaku
+
Bloom magic tool
by Bill Kendrick
Googly Eyes sound effect: "Torch Crackle.wav"
diff --git a/docs/CHANGES.txt b/docs/CHANGES.txt
index 73474f825..5f37a7a31 100644
--- a/docs/CHANGES.txt
+++ b/docs/CHANGES.txt
@@ -17,12 +17,13 @@ https://tuxpaint.org/
+ WIP Needs icon
+ WIP Needs sound effect
- * WIP Dither & Dither (Keep Color): Replaces all or part of a drawing
+ * Dither & Dither (Keep Color): Replaces all or part of a drawing
with dithered X-and-white pixels. With "Dither", X is always black,
or the currently-selected color; with "Dither (Keep Color)", X is
a muted version of the original color.
Bill Kendrick
- + WIP Needs sound effect
+ - Sound effects based on "Orion FIll.wav", Creative Commons 0
+ by KatHakaku
* Improvements to Eraser tool:
----------------------------
diff --git a/magic/sounds/dither.ogg b/magic/sounds/dither.ogg
new file mode 100644
index 000000000..6fc06da1b
Binary files /dev/null and b/magic/sounds/dither.ogg differ
diff --git a/magic/sounds/dither_keep_color.ogg b/magic/sounds/dither_keep_color.ogg
new file mode 100644
index 000000000..fd221caff
Binary files /dev/null and b/magic/sounds/dither_keep_color.ogg differ
diff --git a/magic/src/dither.c b/magic/src/dither.c
index 971ab32b3..1f1929347 100644
--- a/magic/src/dither.c
+++ b/magic/src/dither.c
@@ -50,8 +50,8 @@ char * dither_icon_filenames[NUM_TOOLS] = {
};
char * dither_snd_filenames[NUM_TOOLS] = {
- "reflection.ogg", // FIXME
- "reflection.ogg", // FIXME
+ "dither.ogg",
+ "dither_keep_color.ogg",
};
Mix_Chunk *snd_effects[NUM_TOOLS];
@@ -65,6 +65,8 @@ Uint8 dither_sizes[NUM_TOOLS];
Uint32 dither_white, dither_black, dither_color;
Uint8 * dither_touched;
float * dither_vals;
+int dither_click_mode;
+
void dither_drag(magic_api * api, int which, SDL_Surface * canvas,
SDL_Surface * snapshot, int old_x, int old_y, int x, int y,
@@ -137,7 +139,7 @@ char *dither_get_description(magic_api * api, int which, int mode)
{
if (mode == MODE_PAINT) {
return strdup(gettext(dither_descr[which][0]));
- } else if (mode == MODE_FULLSCREEN) {
+ } else /* if (mode == MODE_FULLSCREEN) */ {
return strdup(gettext(dither_descr[which][1]));
}
}
@@ -193,7 +195,6 @@ void dither_shutdown(magic_api * api)
}
}
-
void
dither_click(magic_api * api, int which, int mode,
SDL_Surface * canvas, SDL_Surface * snapshot, int x, int y,
@@ -202,6 +203,8 @@ dither_click(magic_api * api, int which, int mode,
int xx, yy;
Uint8 r, g, b;
+ dither_click_mode = mode;
+
for (yy = 0; yy < canvas->h; yy++)
{
for (xx = 0; xx < canvas->w; xx++)
@@ -231,6 +234,7 @@ dither_click(magic_api * api, int which, int mode,
}
else
{
+ api->playsound(snd_effects[which], 128, 255);
dither_release(api, which, canvas, snapshot, x, y, update_rect);
}
}
@@ -351,6 +355,10 @@ dither_release(magic_api * api, int which,
update_rect->y = 0;
update_rect->w = canvas->w;
update_rect->h = canvas->h;
+
+ if (dither_click_mode == MODE_PAINT) {
+ api->stopsound();
+ }
}
void dither_set_color(magic_api * api, int which, SDL_Surface * canvas, SDL_Surface * snapshot, Uint8 r, Uint8 g, Uint8 b, SDL_Rect * update_rect)