Fixed two off-by-one errors. One would cause the same frame of the Kyra 3 to be

displayed twice in a row. The other, more serious one, would cause ScummVM to
crash when reaching the end of the music. Now the music loops properly. (It
does fade down before looping, but that's how it is in the original as well.
It's just the way the music is recorded.)

svn-id: r22503
This commit is contained in:
Torbjörn Andersson 2006-05-17 20:54:51 +00:00
parent 0099932d0d
commit 6bf1e10768
2 changed files with 4 additions and 2 deletions

View File

@ -90,7 +90,7 @@ int KyraEngine_v3::go() {
delayUntil(nextRun);
}
for (int i = 64; i >= 29; --i) {
for (int i = 64; i > 29; --i) {
uint32 nextRun = _system->getMillis() + 3 * _tickLength;
logo->displayFrame(i);
_screen->updateScreen();

View File

@ -133,7 +133,9 @@ int AUDStream::readChunk(int16 *buffer, const int maxSamples) {
// if no bytes of the old chunk are left, read the next one
if (_bytesLeft <= 0) {
if (_processedSize > _totalSize) {
if (_processedSize >= _totalSize) {
// TODO: Eventually, we're probably going to need the
// ability to loop the sound. Add this here?
_endOfData = true;
return 0;
}