diff options
-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); |