void SoundCommandParser::updateSci0Cues() { bool noOnePlaying = true; MusicEntry *pWaitingForPlay = NULL; const MusicList::iterator end = _music->getPlayListEnd(); for (MusicList::iterator i = _music->getPlayListStart(); i != end; ++i) { // Is the sound stopped, and the sound object updated too? If yes, skip // this sound, as SCI0 only allows one active song. if ((*i)->isQueued) { pWaitingForPlay = (*i); // FIXME(?): In iceman 2 songs are queued when playing the door // sound - if we use the first song for resuming then it's the wrong // one. Both songs have same priority. Maybe the new sound function // in sci0 is somehow responsible. continue; } if ((*i)->signal == 0 && (*i)->status != kSoundPlaying) continue; processUpdateCues((*i)->soundObj); noOnePlaying = false; } if (noOnePlaying && pWaitingForPlay) { // If there is a queued entry, play it now ffs: SciMusic::soundPlay() pWaitingForPlay->isQueued = false; _music->soundPlay(pWaitingForPlay); } }
reg_t SoundCommandParser::kDoSoundUpdateCues(EngineState *s, int argc, reg_t *argv) { processUpdateCues(argv[0]); return s->r_acc; }
reg_t SoundCommandParser::kDoSoundUpdateCues(int argc, reg_t *argv, reg_t acc) { processUpdateCues(argv[0]); return acc; }