aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorSven Hesse2007-04-09 20:17:10 +0000
committerSven Hesse2007-04-09 20:17:10 +0000
commit4bbb951c8e9f22a33575ea2e169343dabdd8e55d (patch)
tree351d781629f52437c35119060aea5085f1421b57 /engines
parentc51e87fdac4f7d78138d9343cfbfcceedc160a0f (diff)
downloadscummvm-rg350-4bbb951c8e9f22a33575ea2e169343dabdd8e55d.tar.gz
scummvm-rg350-4bbb951c8e9f22a33575ea2e169343dabdd8e55d.tar.bz2
scummvm-rg350-4bbb951c8e9f22a33575ea2e169343dabdd8e55d.zip
Fixed the wrong sound issue (laughing instead of a "whooosh" sound) in Gob3's second screen
svn-id: r26445
Diffstat (limited to 'engines')
-rw-r--r--engines/gob/inter_v2.cpp31
1 files changed, 19 insertions, 12 deletions
diff --git a/engines/gob/inter_v2.cpp b/engines/gob/inter_v2.cpp
index 222ce8ee2b..3f76be5498 100644
--- a/engines/gob/inter_v2.cpp
+++ b/engines/gob/inter_v2.cpp
@@ -2016,11 +2016,14 @@ int16 Inter_v2::loadSound(int16 search) {
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 @@ int16 Inter_v2::loadSound(int16 search) {
} 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 == 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;
+ if (slot == -1) {
+ warning("Inter_v2::loadSound(): No free slot to load sound "
+ "(id = %d)", id);
+ return 0;
+ }
}
}
@@ -2083,7 +2090,7 @@ int16 Inter_v2::loadSound(int16 search) {
_vm->_game->_soundSamples[slot]._id = id;
}
- return slot;
+ return slot | slotIdMask;
}
void Inter_v2::animPalette() {