aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorTravis Howell2009-04-20 05:19:42 +0000
committerTravis Howell2009-04-20 05:19:42 +0000
commite15dd070f8bf38c9a2d209f3f554d4db689b9f91 (patch)
tree5b9837198d2fa9aedd42ead194b5887518c15444 /engines
parent56e50ed97880d8c342a03afd7b9c678601d0935f (diff)
downloadscummvm-rg350-e15dd070f8bf38c9a2d209f3f554d4db689b9f91.tar.gz
scummvm-rg350-e15dd070f8bf38c9a2d209f3f554d4db689b9f91.tar.bz2
scummvm-rg350-e15dd070f8bf38c9a2d209f3f554d4db689b9f91.zip
Fix sound effects regression in Waxworks.
svn-id: r40023
Diffstat (limited to 'engines')
-rw-r--r--engines/agos/event.cpp1
-rw-r--r--engines/agos/res_snd.cpp15
-rw-r--r--engines/agos/vga_e2.cpp2
3 files changed, 11 insertions, 7 deletions
diff --git a/engines/agos/event.cpp b/engines/agos/event.cpp
index bc07320563..4836ac8035 100644
--- a/engines/agos/event.cpp
+++ b/engines/agos/event.cpp
@@ -285,6 +285,7 @@ void AGOSEngine::animateEvent(const byte *codePtr, uint16 curZoneNum, uint16 cur
_curVgaFile1 = vpe->vgaFile1;
_curVgaFile2 = vpe->vgaFile2;
_curSfxFile = vpe->sfxFile;
+ _curSfxFileSize = vpe->sfxFileEnd - vpe->sfxFile;
_vcPtr = codePtr;
diff --git a/engines/agos/res_snd.cpp b/engines/agos/res_snd.cpp
index 891e183d4f..27c669b1e2 100644
--- a/engines/agos/res_snd.cpp
+++ b/engines/agos/res_snd.cpp
@@ -533,35 +533,36 @@ void AGOSEngine::loadSound(uint16 sound, uint16 freq, uint16 flags) {
dst = _curSfxFile;
if (getGameType() == GType_WW) {
- uint tmp = sound;
+ uint16 tmp = sound;
+
while (tmp--) {
- dst += READ_LE_UINT16(dst) + 4;
size += READ_LE_UINT16(dst) + 4;
+ dst += READ_LE_UINT16(dst) + 4;
if (size > _curSfxFileSize)
- error("loadSound: Reading beyond EOF");
+ error("loadSound: Reading beyond EOF (%d, %d)", size, _curSfxFileSize);
}
size = READ_LE_UINT16(dst);
offs = 4;
} else if (getGameType() == GType_ELVIRA2) {
while (READ_BE_UINT32(dst + 4) != sound) {
- dst += 12;
size += 12;
+ dst += 12;
if (size > _curSfxFileSize)
- error("loadSound: Reading beyond EOF");
+ error("loadSound: Reading beyond EOF (%d, %d)", size, _curSfxFileSize);
}
size = READ_BE_UINT32(dst);
offs = READ_BE_UINT32(dst + 8);
} else {
while (READ_BE_UINT16(dst + 6) != sound) {
- dst += 12;
size += 12;
+ dst += 12;
if (size > _curSfxFileSize)
- error("loadSound: Reading beyond EOF");
+ error("loadSound: Reading beyond EOF (%d, %d)", size, _curSfxFileSize);
}
diff --git a/engines/agos/vga_e2.cpp b/engines/agos/vga_e2.cpp
index 50f9ad7dee..58d3329296 100644
--- a/engines/agos/vga_e2.cpp
+++ b/engines/agos/vga_e2.cpp
@@ -195,6 +195,8 @@ void AGOSEngine::vc52_playSound() {
_sound->playEffects(sound);
} else if (getGameId() == GID_SIMON1DOS) {
playSting(sound);
+ } else if (getGameType() == GType_WW) {
+ // TODO: Sound effects in PC version only
} else {
loadSound(sound, 0, 0);
}