[Scummvm-cvs-logs] SF.net SVN: scummvm: [28625] scummvm/trunk/engines/agi/sound.cpp

buddha_ at users.sourceforge.net buddha_ at users.sourceforge.net
Wed Aug 15 18:31:15 CEST 2007


Revision: 28625
          http://scummvm.svn.sourceforge.net/scummvm/?rev=28625&view=rev
Author:   buddha_
Date:     2007-08-15 09:31:15 -0700 (Wed, 15 Aug 2007)

Log Message:
-----------
Changed use of USE_CHORUS (#define) to g_useChorus (static boolean).

Modified Paths:
--------------
    scummvm/trunk/engines/agi/sound.cpp

Modified: scummvm/trunk/engines/agi/sound.cpp
===================================================================
--- scummvm/trunk/engines/agi/sound.cpp	2007-08-15 15:55:38 UTC (rev 28624)
+++ scummvm/trunk/engines/agi/sound.cpp	2007-08-15 16:31:15 UTC (rev 28625)
@@ -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::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 @@
 	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 @@
 				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)
 		}


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list