aboutsummaryrefslogtreecommitdiff
path: root/scumm/sound.cpp
diff options
context:
space:
mode:
authorTravis Howell2004-08-26 06:08:41 +0000
committerTravis Howell2004-08-26 06:08:41 +0000
commit8e2e48e40c4e52ae190a380f6e372119c565743c (patch)
treea7eaab6a4600cf361fa9f2a6da19eb74e8c1ef10 /scumm/sound.cpp
parent68d35856c03900f2777933072a38f4665451ccc0 (diff)
downloadscummvm-rg350-8e2e48e40c4e52ae190a380f6e372119c565743c.tar.gz
scummvm-rg350-8e2e48e40c4e52ae190a380f6e372119c565743c.tar.bz2
scummvm-rg350-8e2e48e40c4e52ae190a380f6e372119c565743c.zip
Add some stubs for HE 7.2
Fix warning Add music support for later HE 7.2 games svn-id: r14761
Diffstat (limited to 'scumm/sound.cpp')
-rw-r--r--scumm/sound.cpp31
1 files changed, 24 insertions, 7 deletions
diff --git a/scumm/sound.cpp b/scumm/sound.cpp
index 14a13e8e18..09aef4d84e 100644
--- a/scumm/sound.cpp
+++ b/scumm/sound.cpp
@@ -166,8 +166,10 @@ void Sound::playSound(int soundID, int offset) {
debugC(DEBUG_SOUND, "playSound #%d", soundID);
int music_offs, total_size;
+ uint skip;
char buf[32];
File musicFile;
+
sprintf(buf, "%s.he4", _vm->getGameName());
if (musicFile.open(buf) == false) {
warning("playSound: Music file is not open");
@@ -176,15 +178,30 @@ void Sound::playSound(int soundID, int offset) {
musicFile.seek(4, SEEK_SET);
total_size = musicFile.readUint32BE();
- // Skip header junk
- musicFile.seek(+20, SEEK_CUR);
+ musicFile.seek(+40, SEEK_CUR);
+ if (musicFile.readUint32LE() == MKID('SGEN')) {
+ // Skip to correct music header
+ skip = (soundID - 4001) * 21;
+ musicFile.seek(+skip, SEEK_CUR);
+
+ // Skip to offsets
+ musicFile.seek(+8, SEEK_CUR);
+
+ } else {
+ // Rewind
+ musicFile.seek(-44, SEEK_CUR);
- // Skip to correct music header
- uint skip = (soundID - 4001) * 25;
- musicFile.seek(+skip, SEEK_CUR);
+ // Skip header junk
+ musicFile.seek(+20, SEEK_CUR);
+
+ // Skip to correct music header
+ skip = (soundID - 4001) * 25;
+ musicFile.seek(+skip, SEEK_CUR);
+
+ // Skip to offsets
+ musicFile.seek(+21, SEEK_CUR);
+ }
- // Skip to offsets
- musicFile.seek(+21, SEEK_CUR);
music_offs = musicFile.readUint32LE();
size = musicFile.readUint32LE();