aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/sound/audio.cpp
diff options
context:
space:
mode:
authorColin Snover2017-01-08 22:59:30 -0600
committerColin Snover2017-03-30 19:46:27 -0500
commit0826501ef63c5b8e6b40299d25142a3562c6fde9 (patch)
tree4cf7542e623c452b6d80062ef8d0ccadea094ba3 /engines/sci/sound/audio.cpp
parent4c942758c073ac007f8eefc819bcf7e2ac58557c (diff)
downloadscummvm-rg350-0826501ef63c5b8e6b40299d25142a3562c6fde9.tar.gz
scummvm-rg350-0826501ef63c5b8e6b40299d25142a3562c6fde9.tar.bz2
scummvm-rg350-0826501ef63c5b8e6b40299d25142a3562c6fde9.zip
SCI32: Fix audio, wave, VMD, Duck, CLUT, TGA, ZZZ, Etc patches
Specifically, audio patches are used in at least PQ:SWAT (40103.AUD), Lighthouse (9103.AUD), and the GK2 demo (300.AUD).
Diffstat (limited to 'engines/sci/sound/audio.cpp')
-rw-r--r--engines/sci/sound/audio.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/engines/sci/sound/audio.cpp b/engines/sci/sound/audio.cpp
index e470b315cc..273c4c1a0d 100644
--- a/engines/sci/sound/audio.cpp
+++ b/engines/sci/sound/audio.cpp
@@ -397,12 +397,13 @@ Audio::RewindableAudioStream *AudioPlayer::getAudioStream(uint32 number, uint32
#endif
} else {
// Original source file
- if (audioRes->_headerSize > 0) {
+ if ((audioRes->getUint8At(0) & 0x7f) == kResourceTypeAudio && audioRes->getUint32BEAt(2) == MKTAG('S','O','L',0)) {
// SCI1.1
- Common::MemoryReadStream headerStream(audioRes->_header, audioRes->_headerSize, DisposeAfterUse::NO);
+ const uint8 headerSize = audioRes->getUint8At(1);
+ Common::MemoryReadStream headerStream = audioRes->subspan(kResourceHeaderSize, headerSize).toStream();
- if (readSOLHeader(&headerStream, audioRes->_headerSize, size, _audioRate, audioFlags, audioRes->size())) {
- Common::MemoryReadStream dataStream(audioRes->toStream());
+ if (readSOLHeader(&headerStream, headerSize, size, _audioRate, audioFlags, audioRes->size())) {
+ Common::MemoryReadStream dataStream(audioRes->subspan(kResourceHeaderSize + headerSize).toStream());
data = readSOLAudio(&dataStream, size, audioFlags, flags);
}
} else if (audioRes->size() > 4 && audioRes->getUint32BEAt(0) == MKTAG('R','I','F','F')) {