diff options
author | Johannes Schickel | 2010-01-07 16:44:17 +0000 |
---|---|---|
committer | Johannes Schickel | 2010-01-07 16:44:17 +0000 |
commit | 4f52dcea66e412f2ccfb6527beb01777e5b2c850 (patch) | |
tree | 45930ba4a16016e85aec4f326561556bd7d2472a /engines/tucker/sequences.cpp | |
parent | d5fe29c3c949fda84a5a7a276160d57e646fc952 (diff) | |
download | scummvm-rg350-4f52dcea66e412f2ccfb6527beb01777e5b2c850.tar.gz scummvm-rg350-4f52dcea66e412f2ccfb6527beb01777e5b2c850.tar.bz2 scummvm-rg350-4f52dcea66e412f2ccfb6527beb01777e5b2c850.zip |
Adapt TUCKER to use RewindableAudioStream and Mixer::playInputStreamLooping. (Needs testing, please :-)
svn-id: r47130
Diffstat (limited to 'engines/tucker/sequences.cpp')
-rw-r--r-- | engines/tucker/sequences.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/engines/tucker/sequences.cpp b/engines/tucker/sequences.cpp index ed31778209..a7527166cc 100644 --- a/engines/tucker/sequences.cpp +++ b/engines/tucker/sequences.cpp @@ -574,11 +574,11 @@ void AnimationSequencePlayer::syncTime() { } while (_lastFrameTime <= end); } -Audio::AudioStream *AnimationSequencePlayer::loadSound(int index, AnimationSoundType type) { - Audio::AudioStream *stream = _compressedSound->load(kSoundTypeIntro, index, type == kAnimationSoundTypeLoopingWAV); - if (stream) { +Audio::RewindableAudioStream *AnimationSequencePlayer::loadSound(int index, AnimationSoundType type) { + Audio::RewindableAudioStream *stream = _compressedSound->load(kSoundTypeIntro, index); + if (stream) return stream; - } + char fileName[64]; snprintf(fileName, sizeof(fileName), "audio/%s", _audioFileNamesTable[index]); Common::File f; @@ -603,8 +603,7 @@ Audio::AudioStream *AnimationSequencePlayer::loadSound(int index, AnimationSound } break; case kAnimationSoundTypeWAV: - case kAnimationSoundTypeLoopingWAV: - stream = Audio::makeLoopingAudioStream(Audio::makeWAVStream(&f, true), type == kAnimationSoundTypeLoopingWAV ? 0 : 1); + stream = Audio::makeWAVStream(&f, true); break; } @@ -625,7 +624,7 @@ void AnimationSequencePlayer::loadSounds(int num) { } void AnimationSequencePlayer::updateSounds() { - Audio::AudioStream *s = 0; + Audio::RewindableAudioStream *s = 0; const SoundSequenceData *p = &_soundSeqData[_soundSeqDataIndex]; while (_soundSeqDataIndex < _soundSeqDataCount && p->timestamp <= _frameCounter) { switch (p->opcode) { @@ -635,8 +634,8 @@ void AnimationSequencePlayer::updateSounds() { } break; case 1: - if ((s = loadSound(p->num, kAnimationSoundTypeLoopingWAV)) != 0) { - _mixer->playInputStream(Audio::Mixer::kSFXSoundType, &_soundsHandle[p->index], s, -1, scaleMixerVolume(p->volume)); + if ((s = loadSound(p->num, kAnimationSoundTypeWAV)) != 0) { + _mixer->playInputStreamLooping(Audio::Mixer::kSFXSoundType, &_soundsHandle[p->index], s, 0, -1, scaleMixerVolume(p->volume)); } break; case 2: |