From 0a5d1795ce8fe46e20627f8a7b4ba348f2ec400e Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Mon, 8 Sep 2008 17:53:36 +0000 Subject: Fix disabled PC speaker sounds. Subversion-branch: /branches/raven-branch Subversion-revision: 1215 --- src/i_pcsound.c | 36 ++++++++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/src/i_pcsound.c b/src/i_pcsound.c index 500deb99..7ea545c4 100644 --- a/src/i_pcsound.c +++ b/src/i_pcsound.c @@ -142,6 +142,33 @@ static boolean CachePCSLump(sfxinfo_t *sfxinfo) return true; } +// These Doom PC speaker sounds are not played - this can be seen in the +// Heretic source code, where there are remnants of this left over +// from Doom. + +static boolean IsDisabledSound(sfxinfo_t *sfxinfo) +{ + int i; + const char *disabled_sounds[] = { + "posact", + "bgact", + "dmact", + "dmpain", + "popain", + "sawidl", + }; + + for (i=0; iname, disabled_sounds[i])) + { + return true; + } + } + + return false; +} + static int I_PCS_StartSound(sfxinfo_t *sfxinfo, int channel, int vol, @@ -154,17 +181,10 @@ static int I_PCS_StartSound(sfxinfo_t *sfxinfo, return -1; } -/* TODO - // These PC speaker sounds are not played - this can be seen in the - // Heretic source code, where there are remnants of this left over - // from Doom. - - if (id == sfx_posact || id == sfx_bgact || id == sfx_dmact - || id == sfx_dmpain || id == sfx_popain || id == sfx_sawidl) + if (IsDisabledSound(sfxinfo)) { return -1; } - */ if (SDL_LockMutex(sound_lock) < 0) { -- cgit v1.2.3