aboutsummaryrefslogtreecommitdiff
path: root/engines/agi/sound.cpp
diff options
context:
space:
mode:
authorKari Salminen2007-08-15 16:31:15 +0000
committerKari Salminen2007-08-15 16:31:15 +0000
commitd4998087aa625d50e65d0ab2e6b96b52d9926590 (patch)
tree6d9a2384f2579a84d0114d5e8618c9210b406d92 /engines/agi/sound.cpp
parent4d83eef351cd4b3bfeb766bace3d7cb5b07a2e07 (diff)
downloadscummvm-rg350-d4998087aa625d50e65d0ab2e6b96b52d9926590.tar.gz
scummvm-rg350-d4998087aa625d50e65d0ab2e6b96b52d9926590.tar.bz2
scummvm-rg350-d4998087aa625d50e65d0ab2e6b96b52d9926590.zip
Changed use of USE_CHORUS (#define) to g_useChorus (static boolean).
svn-id: r28625
Diffstat (limited to 'engines/agi/sound.cpp')
-rw-r--r--engines/agi/sound.cpp45
1 files changed, 23 insertions, 22 deletions
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)
}