diff options
author | Kirben | 2015-07-24 20:34:52 +1000 |
---|---|---|
committer | Kirben | 2015-07-24 20:34:52 +1000 |
commit | 11c7d38e09f2c71bacd6ea5517b03561e13b370b (patch) | |
tree | 7996c122e7dd3ca551ccdcd9615b039d9533152f /engines/agos | |
parent | 08bef960733bbb71eaa90121d6e2d80da5914c29 (diff) | |
download | scummvm-rg350-11c7d38e09f2c71bacd6ea5517b03561e13b370b.tar.gz scummvm-rg350-11c7d38e09f2c71bacd6ea5517b03561e13b370b.tar.bz2 scummvm-rg350-11c7d38e09f2c71bacd6ea5517b03561e13b370b.zip |
AGOS: Fix music looping in disk version of Simon1, a regression from svn 22907.
Diffstat (limited to 'engines/agos')
-rw-r--r-- | engines/agos/midi.cpp | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/engines/agos/midi.cpp b/engines/agos/midi.cpp index f636c1348a..d11ff201ea 100644 --- a/engines/agos/midi.cpp +++ b/engines/agos/midi.cpp @@ -623,26 +623,27 @@ void MidiPlayer::loadSMF(Common::File *in, int song, bool sfx) { // 1 BYTE : Major version // 1 BYTE : Minor version // 1 BYTE : Ticks (Ranges from 2 - 8, always 2 for SFX) - // 1 BYTE : Loop control. 0 = no loop, 1 = loop - - // In the original, the ticks value indicated how many - // times the music timer was called before it actually - // did something. The larger the value the slower the - // music. - // - // We, on the other hand, have a timer rate which is - // used to control by how much the music advances on - // each onTimer() call. The larger the value, the - // faster the music. - // - // It seems that 4 corresponds to our base tempo, so - // this should be the right way to calculate it. - timerRate = (4 * _driver->getBaseTempo()) / p->data[5]; - - // According to bug #1004919 calling setLoop() from - // within a lock causes a lockup, though I have no - // idea when this actually happens. - _loopTrack = (p->data[6] != 0); + // 1 BYTE : Loop control. 0 = no loop, 1 = loop (Music only) + if (!sfx) { + // In the original, the ticks value indicated how many + // times the music timer was called before it actually + // did something. The larger the value the slower the + // music. + // + // We, on the other hand, have a timer rate which is + // used to control by how much the music advances on + // each onTimer() call. The larger the value, the + // faster the music. + // + // It seems that 4 corresponds to our base tempo, so + // this should be the right way to calculate it. + timerRate = (4 * _driver->getBaseTempo()) / p->data[5]; + + // According to bug #1004919 calling setLoop() from + // within a lock causes a lockup, though I have no + // idea when this actually happens. + _loopTrack = (p->data[6] != 0); + } } MidiParser *parser = MidiParser::createParser_SMF(); |