aboutsummaryrefslogtreecommitdiff
path: root/engines/touche
diff options
context:
space:
mode:
authorJohannes Schickel2011-11-24 23:10:51 +0100
committerJohannes Schickel2011-11-24 23:10:51 +0100
commit56690162250f577f448c4edc2cc455c99234513a (patch)
tree169639b4f35f0b86d37a7307b2d127665081cdf2 /engines/touche
parentdd42278373484b536e61a93fec578b1a2cadd11d (diff)
downloadscummvm-rg350-56690162250f577f448c4edc2cc455c99234513a.tar.gz
scummvm-rg350-56690162250f577f448c4edc2cc455c99234513a.tar.bz2
scummvm-rg350-56690162250f577f448c4edc2cc455c99234513a.zip
TOUCHE: Fix playback of simultaneous sfx.
Since we stream the VOC files from disk now, we can not use the global resource file handle for playback but instead need to open a new handle for every SFX started. Fixes odd noises at the beginning of the Touche demo.
Diffstat (limited to 'engines/touche')
-rw-r--r--engines/touche/resource.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/engines/touche/resource.cpp b/engines/touche/resource.cpp
index 6df6fc0e5f..0790d726b7 100644
--- a/engines/touche/resource.cpp
+++ b/engines/touche/resource.cpp
@@ -590,8 +590,14 @@ void ToucheEngine::res_loadSound(int priority, int num) {
if (priority >= 0) {
uint32 size;
const uint32 offs = res_getDataOffset(kResourceTypeSound, num, &size);
- _fData.seek(offs);
- Audio::AudioStream *stream = Audio::makeVOCStream(&_fData, Audio::FLAG_UNSIGNED);
+ Common::SeekableReadStream *datastream = SearchMan.createReadStreamForMember("TOUCHE.DAT");
+ if (!datastream) {
+ warning("res_loadSound: Could not open TOUCHE.DAT");
+ return;
+ }
+
+ datastream->seek(offs);
+ Audio::AudioStream *stream = Audio::makeVOCStream(datastream, Audio::FLAG_UNSIGNED, DisposeAfterUse::YES);
if (stream) {
_mixer->playStream(Audio::Mixer::kSFXSoundType, &_sfxHandle, stream);
}