diff options
author | Travis Howell | 2006-06-04 00:03:30 +0000 |
---|---|---|
committer | Travis Howell | 2006-06-04 00:03:30 +0000 |
commit | 8792ab873bad1924007f0bc5153d75909be83121 (patch) | |
tree | 6a5e9f61933478c0ab3aee5ed285920a048541d5 /engines | |
parent | 3e72e5c9e0dcd8d848887fcc1b4a1ba325acd8d1 (diff) | |
download | scummvm-rg350-8792ab873bad1924007f0bc5153d75909be83121.tar.gz scummvm-rg350-8792ab873bad1924007f0bc5153d75909be83121.tar.bz2 scummvm-rg350-8792ab873bad1924007f0bc5153d75909be83121.zip |
Looping and tempo details in GMF header are used by MIDI sound effects too
svn-id: r22907
Diffstat (limited to 'engines')
-rw-r--r-- | engines/simon/midi.cpp | 39 |
1 files changed, 19 insertions, 20 deletions
diff --git a/engines/simon/midi.cpp b/engines/simon/midi.cpp index 4d0327ea43..e0d466caa6 100644 --- a/engines/simon/midi.cpp +++ b/engines/simon/midi.cpp @@ -409,26 +409,25 @@ void MidiPlayer::loadSMF(Common::File *in, int song, bool sfx) { // 1 BYTE : Minor version // 1 BYTE : Ticks (Ranges from 2 - 8, always 2 for SFX) // 1 BYTE : Loop control. 0 = no loop, 1 = loop - 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); - } + + // 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(); |