Use SubLoopingAudioStream instead of makeLoopingAudioStream in SCUMM. (Incorrect replacement introduced with r47715, thanks to Max for spotting this).

svn-id: r47722
This commit is contained in:
Johannes Schickel 2010-01-30 18:15:17 +00:00
parent 5539f0d358
commit f79b474ea7
2 changed files with 7 additions and 3 deletions

View File

@ -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);

View File

@ -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;
}