[Scummvm-cvs-logs] SF.net SVN: scummvm: [26445] scummvm/trunk/engines/gob/inter_v2.cpp

drmccoy at users.sourceforge.net drmccoy at users.sourceforge.net
Mon Apr 9 22:17:11 CEST 2007


Revision: 26445
          http://scummvm.svn.sourceforge.net/scummvm/?rev=26445&view=rev
Author:   drmccoy
Date:     2007-04-09 13:17:10 -0700 (Mon, 09 Apr 2007)

Log Message:
-----------
Fixed the wrong sound issue (laughing instead of a "whooosh" sound) in Gob3's second screen

Modified Paths:
--------------
    scummvm/trunk/engines/gob/inter_v2.cpp

Modified: scummvm/trunk/engines/gob/inter_v2.cpp
===================================================================
--- scummvm/trunk/engines/gob/inter_v2.cpp	2007-04-09 19:49:03 UTC (rev 26444)
+++ scummvm/trunk/engines/gob/inter_v2.cpp	2007-04-09 20:17:10 UTC (rev 26445)
@@ -2016,11 +2016,14 @@
 	byte *dataPtr;
 	int16 id;
 	int16 slot;
+	uint16 slotIdMask;
 	uint32 dataSize;
 	SoundType type;
 	SoundSource source;
 
 	type = SOUND_SND;
+	slotIdMask = 0;
+
 	if (!search) {
 		slot = _vm->_parse->parseValExpr();
 		if (slot < 0) {
@@ -2031,19 +2034,23 @@
 	} else {
 		id = load16();
 
-		for (slot = 0; slot < 60; slot++) {
-			if (_vm->_game->_soundSamples[slot].isId(id))
-				return slot | 0x8000;
-		}
-
-		for (slot = 59; slot >= 0; slot--) {
-			if (_vm->_game->_soundSamples[slot].empty())
+		for (slot = 0; slot < 60; slot++)
+			if (_vm->_game->_soundSamples[slot].isId(id)) {
+				slotIdMask = 0x8000;
 				break;
-		}
+			}
 
-		if (slot == -1) {
-			warning("Inter_v2::loadSound(): No free slot to load sound (id = %d)", id);
-			return 0;
+		if (slot == 60) {
+			for (slot = 59; slot >= 0; slot--) {
+				if (_vm->_game->_soundSamples[slot].empty())
+					break;
+			}
+
+			if (slot == -1) {
+				warning("Inter_v2::loadSound(): No free slot to load sound "
+						"(id = %d)", id);
+				return 0;
+			}
 		}
 	}
 	
@@ -2083,7 +2090,7 @@
 		_vm->_game->_soundSamples[slot]._id = id;
 	}
 
-	return slot;
+	return slot | slotIdMask;
 }
 
 void Inter_v2::animPalette() {


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