aboutsummaryrefslogtreecommitdiff
path: root/engines/sword2/sound.cpp
diff options
context:
space:
mode:
authorJohannes Schickel2010-01-07 17:04:01 +0000
committerJohannes Schickel2010-01-07 17:04:01 +0000
commita597e5fef93523436e60eca18997fb5ca5196345 (patch)
tree673cc525c81033c28ccbc4e5a7163f00e941f59b /engines/sword2/sound.cpp
parent771867fd1bd96470d788644072f4f6ad8beca640 (diff)
downloadscummvm-rg350-a597e5fef93523436e60eca18997fb5ca5196345.tar.gz
scummvm-rg350-a597e5fef93523436e60eca18997fb5ca5196345.tar.bz2
scummvm-rg350-a597e5fef93523436e60eca18997fb5ca5196345.zip
Make VagStream a RewindableAudioStream.
svn-id: r47132
Diffstat (limited to 'engines/sword2/sound.cpp')
-rw-r--r--engines/sword2/sound.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/engines/sword2/sound.cpp b/engines/sword2/sound.cpp
index 3128bfed20..3d468ebba3 100644
--- a/engines/sword2/sound.cpp
+++ b/engines/sword2/sound.cpp
@@ -331,17 +331,19 @@ int32 Sound::playFx(Audio::SoundHandle *handle, byte *data, uint32 len, uint8 vo
return RDERR_FXALREADYOPEN;
Common::MemoryReadStream *stream = new Common::MemoryReadStream(data, len);
- Audio::AudioStream *input = 0;
+ Audio::RewindableAudioStream *input = 0;
- if (Sword2Engine::isPsx()) {
- input = new Audio::VagStream(stream, loop);
- } else {
- input = Audio::makeLoopingAudioStream(Audio::makeWAVStream(stream, true), loop ? 0 : 1);
- }
+ if (Sword2Engine::isPsx())
+ input = new Audio::VagStream(stream);
+ else
+ input = Audio::makeWAVStream(stream, true);
assert(input);
- _vm->_mixer->playInputStream(soundType, handle, input, -1, vol, pan, true, false, isReverseStereo());
+ if (loop)
+ _vm->_mixer->playInputStreamLooping(soundType, handle, input, 0, -1, vol, pan, true, false, isReverseStereo());
+ else
+ _vm->_mixer->playInputStream(soundType, handle, input, -1, vol, pan, true, false, isReverseStereo());
return RD_OK;
}