diff options
author | Johannes Schickel | 2010-01-30 18:15:17 +0000 |
---|---|---|
committer | Johannes Schickel | 2010-01-30 18:15:17 +0000 |
commit | f79b474ea756774d4b4de443fbee47b182869935 (patch) | |
tree | d026818c3ada0671c53eaf80e7b250f0f012803a /engines/scumm | |
parent | 5539f0d3589ed5a30a31c71f3b8f1f9e899c5369 (diff) | |
download | scummvm-rg350-f79b474ea756774d4b4de443fbee47b182869935.tar.gz scummvm-rg350-f79b474ea756774d4b4de443fbee47b182869935.tar.bz2 scummvm-rg350-f79b474ea756774d4b4de443fbee47b182869935.zip |
Use SubLoopingAudioStream instead of makeLoopingAudioStream in SCUMM. (Incorrect replacement introduced with r47715, thanks to Max for spotting this).
svn-id: r47722
Diffstat (limited to 'engines/scumm')
-rw-r--r-- | engines/scumm/player_mod.cpp | 6 | ||||
-rw-r--r-- | engines/scumm/sound.cpp | 4 |
2 files changed, 7 insertions, 3 deletions
diff --git a/engines/scumm/player_mod.cpp b/engines/scumm/player_mod.cpp index c98120a2c0..28ee5059e6 100644 --- a/engines/scumm/player_mod.cpp +++ b/engines/scumm/player_mod.cpp @@ -97,7 +97,11 @@ void Player_MOD::startChannel(int id, void *data, int size, int rate, uint8 vol, _channels[i].ctr = 0; Audio::SeekableAudioStream *stream = Audio::makeRawStream((const byte *)data, size, rate, 0); - _channels[i].input = Audio::makeLoopingAudioStream(stream, Audio::Timestamp(0, loopStart, rate), Audio::Timestamp(0, loopEnd, rate), loopStart == loopEnd ? 1 : 0); + if (loopStart != loopEnd) { + _channels[i].input = new Audio::SubLoopingAudioStream(stream, 0, Audio::Timestamp(0, loopStart, rate), Audio::Timestamp(0, loopEnd, rate)); + } else { + _channels[i].input = stream; + } // read the first sample _channels[i].input->readBuffer(&_channels[i].pos, 1); diff --git a/engines/scumm/sound.cpp b/engines/scumm/sound.cpp index 69b298d30d..aed412039a 100644 --- a/engines/scumm/sound.cpp +++ b/engines/scumm/sound.cpp @@ -350,7 +350,7 @@ void Sound::playSound(int soundID) { size -= waveSize; Audio::SeekableAudioStream *s = Audio::makeRawStream(sound, waveSize, rate, Audio::FLAG_UNSIGNED); - stream = Audio::makeLoopingAudioStream(s, Audio::Timestamp(0, loopStart, rate), Audio::Timestamp(0, loopEnd, rate), 0); + stream = new Audio::SubLoopingAudioStream(s, 0, Audio::Timestamp(0, loopStart, rate), Audio::Timestamp(0, loopEnd, rate)); _mixer->playInputStream(Audio::Mixer::kSFXSoundType, NULL, stream, soundID, 255, 0); } break; @@ -441,7 +441,7 @@ void Sound::playSound(int soundID) { // TODO: Currently we will only ever play till "loopEnd", even when we only have // a finite repetition count. - stream = Audio::makeLoopingAudioStream(plainStream, Audio::Timestamp(0, loopStart, rate), Audio::Timestamp(0, loopEnd, rate), loopcount == 255 ? 0 : loopcount); + stream = new Audio::SubLoopingAudioStream(plainStream, loopcount == 255 ? 0 : loopcount, Audio::Timestamp(0, loopStart, rate), Audio::Timestamp(0, loopEnd, rate)); } else { stream = plainStream; } |