SCI/new sound code: update sound cues when kGetEvent() is called, instead of kAnimate(), fixes music fading in LSL3

svn-id: r46973
This commit is contained in:
Filippos Karapetis 2010-01-04 16:16:58 +00:00
parent f245917d6f
commit 5560f93c2a
2 changed files with 11 additions and 9 deletions

View File

@ -141,6 +141,17 @@ reg_t kGetEvent(EngineState *s, int argc, reg_t *argv) {
con->onFrame();
}
#ifndef USE_OLD_MUSIC_FUNCTIONS
if (s->detectDoSoundType() <= SCI_VERSION_0_LATE) {
// If we're running a SCI0 game, update the sound cues, to compensate
// for the fact that SCI0 does not poll to update the sound cues itself,
// like SCI01 and later do with cmdUpdateSoundCues. kAnimate is called
// quite often, so emulate the SCI01 behavior of cmdUpdateSoundCues with
// this call
s->_soundCmd->updateSci0Cues();
}
#endif
return s->r_acc;
}

View File

@ -962,15 +962,6 @@ reg_t kAnimate(EngineState *s, int argc, reg_t *argv) {
#ifdef USE_OLD_MUSIC_FUNCTIONS
// Take care of incoming events (kAnimate is called semi-regularly)
process_sound_events(s);
#else
if (s->detectDoSoundType() <= SCI_VERSION_0_LATE) {
// If we're running a SCI0 game, update the sound cues, to compensate
// for the fact that SCI0 does not poll to update the sound cues itself,
// like SCI01 and later do with cmdUpdateSoundCues. kAnimate is called
// quite often, so emulate the SCI01 behavior of cmdUpdateSoundCues with
// this call
s->_soundCmd->updateSci0Cues();
}
#endif
s->_gui->animate(castListReference, cycle, argc, argv);