[Scummvm-cvs-logs] SF.net SVN: scummvm:[42179] scummvm/trunk/engines/sci/engine/ksound.cpp

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Mon Jul 6 17:50:44 CEST 2009


Revision: 42179
          http://scummvm.svn.sourceforge.net/scummvm/?rev=42179&view=rev
Author:   thebluegr
Date:     2009-07-06 15:50:44 +0000 (Mon, 06 Jul 2009)

Log Message:
-----------
Swapped the music and audio resource check for SCI1.1 games. Digital sound effects are now preferred over the synthesized ones

Modified Paths:
--------------
    scummvm/trunk/engines/sci/engine/ksound.cpp

Modified: scummvm/trunk/engines/sci/engine/ksound.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/ksound.cpp	2009-07-06 15:30:07 UTC (rev 42178)
+++ scummvm/trunk/engines/sci/engine/ksound.cpp	2009-07-06 15:50:44 UTC (rev 42179)
@@ -807,20 +807,24 @@
 		}
 
 		if (!GET_SEL32V(obj, nodePtr) && obj.segment) {
-			if (!s->resmgr->testResource(ResourceId(kResourceTypeSound, number))) {
-				// Check if the resource exists as an audio resource - this can happen
-				// in SQ4CD and perhaps other games as well. If the resource exists, play
-				// it using map 65535 (sound effects map).
-				if (s->resmgr->testResource(ResourceId(kResourceTypeAudio, number))) {
-					// Found a relevant audio resource, play it
-					PUT_SEL32V(obj, signal, s->_sound.startAudio(65535, number));
-				} else {
+			// In SCI1.1 games, sound effects are started from here. If we can find
+			// a relevant audio resource, play it, otherwise switch to synthesized
+			// effects. If the resource exists, play it using map 65535 (sound
+			// effects map)
+			if (s->resmgr->testResource(ResourceId(kResourceTypeAudio, number)) &&
+				s->_version >= SCI_VERSION_1_1) {
+				// Found a relevant audio resource, play it
+				s->_sound.stopAudio();
+				PUT_SEL32V(obj, signal, s->_sound.startAudio(65535, number));
+				return s->r_acc;
+			} else {
+				if (!s->resmgr->testResource(ResourceId(kResourceTypeSound, number))) {
 					warning("Could not open song number %d", number);
 					// Send a "stop handle" event so that the engine won't wait forever here
 					s->_sound.sfx_song_set_status(handle, SOUND_STATUS_STOPPED);
 					PUT_SEL32V(obj, signal, -1);
+					return s->r_acc;
 				}
-				return s->r_acc;
 			}
 
 			debugC(2, kDebugLevelSound, "Initializing song number %d\n", number);


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