From 4c2962ca82485f51bf8261a1b17b0cc8b8969758 Mon Sep 17 00:00:00 2001 From: Albert Cahalan Date: Thu, 30 Dec 2004 17:14:27 +0000 Subject: [PATCH] no sound or redraw when nothing done --- src/tuxpaint.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/tuxpaint.c b/src/tuxpaint.c index 103078917..119be59a9 100644 --- a/src/tuxpaint.c +++ b/src/tuxpaint.c @@ -2459,7 +2459,7 @@ static void mainloop(void) !disable_stamp_controls) { /* Text controls! */ - int text_sound; + int text_sound = -1; if (event.button.y >= (48 * ((max / 2) + TOOLOFFSET / 2)) + 40 && event.button.y < (48 * ((max / 2) + TOOLOFFSET / 2)) + 40 + 48) { @@ -2518,9 +2518,12 @@ static void mainloop(void) } } } - playsound(0, text_sound, 0); - draw_fonts(); - SDL_UpdateRect(screen, WINDOW_WIDTH - 96, 0, 96, (48 * 7) + 40 + HEIGHTOFFSET); + if (text_sound != -1) + { + playsound(0, text_sound, 0); + draw_fonts(); + SDL_UpdateRect(screen, WINDOW_WIDTH - 96, 0, 96, (48 * 7) + 40 + HEIGHTOFFSET); + } }