From 83175f406ca4acc6dbfc7a94f05148ca03d498d0 Mon Sep 17 00:00:00 2001 From: William Kendrick Date: Tue, 4 Dec 2007 17:36:23 +0000 Subject: [PATCH] Fixed problem building w/o sound support. --- docs/CHANGES.txt | 3 +++ src/tuxpaint.c | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/docs/CHANGES.txt b/docs/CHANGES.txt index ba4907e0a..4a8d6525a 100644 --- a/docs/CHANGES.txt +++ b/docs/CHANGES.txt @@ -24,6 +24,9 @@ $Id$ * Corrected bug where Shift and Kaleidoscope magic tools would crash when sound was disabled. + * Corrected issues that prevented building Tux Paint without sound + support (extraneous SDL_mixer library calls). + 2007.November.17 (0.9.18) * Interface Improvements: diff --git a/src/tuxpaint.c b/src/tuxpaint.c index dd49f724d..7265bbb06 100644 --- a/src/tuxpaint.c +++ b/src/tuxpaint.c @@ -1938,6 +1938,7 @@ static void mainloop(void) } else if (key == SDLK_s && (mod & KMOD_ALT)) { +#ifndef NOSOUND if (use_sound) { mute = !mute; @@ -1954,6 +1955,7 @@ static void mainloop(void) draw_tux_text(TUX_BORED, gettext("Sound unmuted."), 0); } } +#endif } else if (key == SDLK_ESCAPE && (mod & KMOD_SHIFT) && (mod & KMOD_CTRL)) @@ -3312,6 +3314,7 @@ static void mainloop(void) { /* A sound player button on the lower left has been pressed! */ +#ifndef NOSOUND if (cur_tool == TOOL_STAMP && use_sound && !mute) { which = GRIDHIT_GD(r_sfx, gd_sfx); @@ -3331,6 +3334,7 @@ static void mainloop(void) Mix_PlayChannel(2, stamp_data[stamp_group][cur_thing]->sdesc, 0); } } +#endif } } else if (event.type == SDL_MOUSEBUTTONDOWN && @@ -3492,6 +3496,7 @@ static void mainloop(void) debug("Playing description sound..."); +#ifndef NOSOUND Mix_ChannelFinished(NULL); // Kill the callback, so we don't get stuck in a loop! if (event.user.data1 != NULL) @@ -3503,6 +3508,7 @@ static void mainloop(void) 0); } } +#endif } } else if (event.type == SDL_MOUSEBUTTONUP)