[Scummvm-cvs-logs] SF.net SVN: scummvm:[43337] scummvm/branches/gsoc2009-mods

nolange at users.sourceforge.net nolange at users.sourceforge.net
Thu Aug 13 02:07:37 CEST 2009


Revision: 43337
          http://scummvm.svn.sourceforge.net/scummvm/?rev=43337&view=rev
Author:   nolange
Date:     2009-08-13 00:07:37 +0000 (Thu, 13 Aug 2009)

Log Message:
-----------
sound_amiga: honor _musicEnabled and _sfxEnabled flags
maxtrax: initialise lastvolume

Modified Paths:
--------------
    scummvm/branches/gsoc2009-mods/engines/kyra/sound_amiga.cpp
    scummvm/branches/gsoc2009-mods/sound/mods/maxtrax.cpp

Modified: scummvm/branches/gsoc2009-mods/engines/kyra/sound_amiga.cpp
===================================================================
--- scummvm/branches/gsoc2009-mods/engines/kyra/sound_amiga.cpp	2009-08-12 23:25:58 UTC (rev 43336)
+++ scummvm/branches/gsoc2009-mods/engines/kyra/sound_amiga.cpp	2009-08-13 00:07:37 UTC (rev 43337)
@@ -170,7 +170,7 @@
 	}
 
 	if (score >= 0) {
-		if (_driver->playSong(score, loop)) {
+		if (_musicEnabled && _driver->playSong(score, loop)) {
 			_driver->setVolume(volume);
 			_driver->setTempo(tempo << 4);
 			if (!_mixer->isSoundHandleActive(_musicHandle))
@@ -215,25 +215,20 @@
 		break;
 
 	case kFileGame:
-		// 0x61 <= track && track <= 0x63 && variable(0x1BFE2) which might indicate song playing in game and finale
 		if (0x61 <= track && track <= 0x63)
 			playTrack(track - 0x4F);
 
-		// We only allow playing of sound effects, which are included in the table.
-		if (track < 120) {
-			// variable(0x1BFE4) && tableEffectsGame[track].note, which gets set for ingame and unset for finale
-			// (and some function reverses its state)
-			if (sfxTableGetNote(&_tableSfxGame[track * 8])) { 
-				tableEntry = &_tableSfxGame[track * 8];
-				pan = (sfxTableGetPan(tableEntry) != 0) && (sfxTableGetPan(tableEntry) != 2);
-			}
+		assert(track < 120);
+		if (sfxTableGetNote(&_tableSfxGame[track * 8])) { 
+			tableEntry = &_tableSfxGame[track * 8];
+			pan = (sfxTableGetPan(tableEntry) != 0) && (sfxTableGetPan(tableEntry) != 2);
 		}
 		break;
 	default:
 		;
 	}
 
-	if (tableEntry) {
+	if (_sfxEnabled && tableEntry) {
 		const bool success = _driver->playNote(sfxTableGetNote(tableEntry), sfxTableGetPatch(tableEntry), sfxTableGetDuration(tableEntry), sfxTableGetVolume(tableEntry), pan);
 		if (success && !_mixer->isSoundHandleActive(_musicHandle))
 			_mixer->playInputStream(Audio::Mixer::kPlainSoundType, &_musicHandle, _driver, -1, Audio::Mixer::kMaxChannelVolume, 0, false);

Modified: scummvm/branches/gsoc2009-mods/sound/mods/maxtrax.cpp
===================================================================
--- scummvm/branches/gsoc2009-mods/sound/mods/maxtrax.cpp	2009-08-12 23:25:58 UTC (rev 43336)
+++ scummvm/branches/gsoc2009-mods/sound/mods/maxtrax.cpp	2009-08-13 00:07:37 UTC (rev 43337)
@@ -541,6 +541,7 @@
 	voice.priority = 0;
 	voice.stopEventTime = -1;
 	voice.dmaOff = 0;
+	voice.lastVolume = 0;
 	//voice.uinqueId = 0;
 
 	// "stop" voice, set period to 1, vol to 0


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