diff options
author | Travis Howell | 2006-01-05 11:38:45 +0000 |
---|---|---|
committer | Travis Howell | 2006-01-05 11:38:45 +0000 |
commit | 5e7ef4dea6f763b2ebfccfa23ff06f03b91fca49 (patch) | |
tree | 5ac160c6597211e0553e91ee2cc823a5129304e7 /scumm | |
parent | 8ae6c259ad78d3a2e1db981e5a665db5c14c319e (diff) | |
download | scummvm-rg350-5e7ef4dea6f763b2ebfccfa23ff06f03b91fca49.tar.gz scummvm-rg350-5e7ef4dea6f763b2ebfccfa23ff06f03b91fca49.tar.bz2 scummvm-rg350-5e7ef4dea6f763b2ebfccfa23ff06f03b91fca49.zip |
Fix sound resource loading in HE games.
The main resource header and size was been cut off in some cases.
svn-id: r19916
Diffstat (limited to 'scumm')
-rw-r--r-- | scumm/sound.cpp | 10 | ||||
-rw-r--r-- | scumm/sound_he.cpp | 19 |
2 files changed, 17 insertions, 12 deletions
diff --git a/scumm/sound.cpp b/scumm/sound.cpp index f0797f4712..ea0a248b36 100644 --- a/scumm/sound.cpp +++ b/scumm/sound.cpp @@ -1267,7 +1267,6 @@ int ScummEngine::readSoundResource(int type, int idx) { case MKID('Mac1'): case MKID('RIFF'): - case MKID('HSHD'): case MKID('TALK'): case MKID('DIGI'): case MKID('Crea'): @@ -1279,6 +1278,15 @@ int ScummEngine::readSoundResource(int type, int idx) { //dumpResource("sound-", idx, ptr); return 1; + case MKID('HSHD'): + // HE sound type without SOUN header + _fileHandle->seek(-16, SEEK_CUR); + total_size = max_total_size + 8; + ptr = res.createResource(type, idx, total_size); + _fileHandle->read(ptr, total_size - 8); + //dumpResource("sound-", idx, ptr); + return 1; + case MKID('FMUS'): { // Used in 3DO version of puttputt joins the parade and probably others // Specifies a separate file to be used for music from what I gather. diff --git a/scumm/sound_he.cpp b/scumm/sound_he.cpp index 342c9f581d..4edf5e874f 100644 --- a/scumm/sound_he.cpp +++ b/scumm/sound_he.cpp @@ -398,19 +398,13 @@ void Sound::playHESound(int soundID, int heOffset, int heChannel, int heFlags) { _vm->_mixer->playRaw(&_heSoundChannels[heChannel], sound, size, rate, flags, soundID); } // Support for sound in Humongous Entertainment games - else if (READ_UINT32(ptr) == MKID('DIGI') || READ_UINT32(ptr) == MKID('TALK') || READ_UINT32(ptr) == MKID('HSHD')) { + else if (READ_UINT32(ptr) == MKID('DIGI') || READ_UINT32(ptr) == MKID('TALK')) { byte *sndPtr = ptr; int priority; - if (READ_UINT32(ptr) == MKID('HSHD')) { - priority = READ_LE_UINT16(ptr + 10); - rate = READ_LE_UINT16(ptr + 14); - ptr += READ_BE_UINT32(ptr + 4); - } else { - priority = READ_LE_UINT16(ptr + 18); - rate = READ_LE_UINT16(ptr + 22); - ptr += 8 + READ_BE_UINT32(ptr + 12); - } + priority = READ_LE_UINT16(ptr + 18); + rate = READ_LE_UINT16(ptr + 22); + ptr += 8 + READ_BE_UINT32(ptr + 12); if (_vm->_mixer->isSoundHandleActive(_heSoundChannels[heChannel])) { int curSnd = _heChannel[heChannel].sound; @@ -498,8 +492,11 @@ void Sound::startHETalkSound(uint32 offset) { _sfxMode |= 2; _vm->res.nukeResource(rtSound, 1); + _sfxFile->seek(offset + 4, SEEK_SET); - size = _sfxFile->readUint32BE() - 8; + size = _sfxFile->readUint32BE(); + _sfxFile->seek(offset, SEEK_SET); + _vm->res.createResource(rtSound, 1, size); ptr = _vm->getResourceAddress(rtSound, 1); _sfxFile->read(ptr, size); |