From d4998087aa625d50e65d0ab2e6b96b52d9926590 Mon Sep 17 00:00:00 2001 From: Kari Salminen Date: Wed, 15 Aug 2007 16:31:15 +0000 Subject: Changed use of USE_CHORUS (#define) to g_useChorus (static boolean). svn-id: r28625 --- engines/agi/sound.cpp | 45 +++++++++++++++++++++++---------------------- 1 file changed, 23 insertions(+), 22 deletions(-) (limited to 'engines/agi/sound.cpp') diff --git a/engines/agi/sound.cpp b/engines/agi/sound.cpp index e6dff9fea2..2ce4f3fb06 100644 --- a/engines/agi/sound.cpp +++ b/engines/agi/sound.cpp @@ -37,7 +37,7 @@ namespace Agi { #define USE_INTERPOLATION -#define USE_CHORUS +static bool g_useChorus = true; /* TODO: add support for variable sampling rate in the output device */ @@ -499,13 +499,13 @@ void SoundMgr::deinitSound() { void SoundMgr::stopNote(int i) { chn[i].adsr = AGI_SOUND_ENV_RELEASE; -#ifdef USE_CHORUS - /* Stop chorus ;) */ - if (chn[i].type == AGI_SOUND_4CHN && - _vm->_soundemu == SOUND_EMU_NONE && i < 3) { - stopNote(i + 4); + if (g_useChorus) { + /* Stop chorus ;) */ + if (chn[i].type == AGI_SOUND_4CHN && + _vm->_soundemu == SOUND_EMU_NONE && i < 3) { + stopNote(i + 4); + } } -#endif } void SoundMgr::playNote(int i, int freq, int vol) { @@ -520,16 +520,16 @@ void SoundMgr::playNote(int i, int freq, int vol) { chn[i].env = 0x10000; chn[i].adsr = AGI_SOUND_ENV_ATTACK; -#ifdef USE_CHORUS - /* Add chorus ;) */ - if (chn[i].type == AGI_SOUND_4CHN && - _vm->_soundemu == SOUND_EMU_NONE && i < 3) { - int newfreq = freq * 1007 / 1000; - if (freq == newfreq) - newfreq++; - playNote(i + 4, newfreq, vol * 2 / 3); + if (g_useChorus) { + /* Add chorus ;) */ + if (chn[i].type == AGI_SOUND_4CHN && + _vm->_soundemu == SOUND_EMU_NONE && i < 3) { + int newfreq = freq * 1007 / 1000; + if (freq == newfreq) + newfreq++; + playNote(i + 4, newfreq, vol * 2 / 3); + } } -#endif } #ifdef USE_IIGS_SOUND @@ -627,13 +627,14 @@ void SoundMgr::playAgiSound() { chn[i].end = 1; chn[i].vol = 0; chn[i].env = 0; -#ifdef USE_CHORUS - /* chorus */ - if (chn[i].type == AGI_SOUND_4CHN && _vm->_soundemu == SOUND_EMU_NONE && i < 3) { - chn[i + 4].vol = 0; - chn[i + 4].env = 0; + + if (g_useChorus) { + /* chorus */ + if (chn[i].type == AGI_SOUND_4CHN && _vm->_soundemu == SOUND_EMU_NONE && i < 3) { + chn[i + 4].vol = 0; + chn[i + 4].env = 0; + } } -#endif } chn[i].ptr += 5; // Advance the pointer to the next note data (5 bytes per note) } -- cgit v1.2.3