SCI: don't let TimerSongIterator loop forever, and don't immediately

signal completion when starting it. This fixes a sync issue with
the departing spaceship at the start of SQ4CD (after the intro).

svn-id: r42385
This commit is contained in:
Willem Jan Palenstijn 2009-07-11 15:00:40 +00:00
parent 1c02b93b70
commit 8dd3492194
2 changed files with 3 additions and 2 deletions

View File

@ -823,7 +823,6 @@ reg_t kDoSound_SCI1(EngineState *s, int funct_nr, int argc, reg_t *argv) {
sampleLen = s->_sound.startAudio(65535, number);
// Also create iterator, that will fire SI_FINISHED event, when the sound is done playing
s->_sound.sfx_add_song(build_timeriterator(s, sampleLen), 0, handle, number);
PUT_SEL32V(obj, signal, sampleLen);
} else {
if (!s->resmgr->testResource(ResourceId(kResourceTypeSound, number))) {
warning("Could not open song number %d", number);

View File

@ -1173,7 +1173,9 @@ TimerSongIterator::TimerSongIterator(int delta)
int TimerSongIterator::nextCommand(byte *buf, int *result) {
if (_delta) {
return _delta;
int d = _delta;
_delta = 0;
return d;
}
return SI_FINISHED;
}