From 8e2e48e40c4e52ae190a380f6e372119c565743c Mon Sep 17 00:00:00 2001 From: Travis Howell Date: Thu, 26 Aug 2004 06:08:41 +0000 Subject: Add some stubs for HE 7.2 Fix warning Add music support for later HE 7.2 games svn-id: r14761 --- scumm/sound.cpp | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) (limited to 'scumm/sound.cpp') 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(); -- cgit v1.2.3