aboutsummaryrefslogtreecommitdiff
path: root/engines/sherlock/music.cpp
diff options
context:
space:
mode:
authorMartin Kiewitz2015-05-30 17:42:36 +0200
committerMartin Kiewitz2015-05-30 17:42:36 +0200
commit0cc5313689d980fc9855eba6bbdc973c7a9d9e96 (patch)
tree553bfef3f4b60dda8bb2dbeae73c43aeb62d975e /engines/sherlock/music.cpp
parent4e404416146c43d8a3aa2175b33e95f84a348eff (diff)
downloadscummvm-rg350-0cc5313689d980fc9855eba6bbdc973c7a9d9e96.tar.gz
scummvm-rg350-0cc5313689d980fc9855eba6bbdc973c7a9d9e96.tar.bz2
scummvm-rg350-0cc5313689d980fc9855eba6bbdc973c7a9d9e96.zip
SHERLOCK: midi parser delta reading changed
Diffstat (limited to 'engines/sherlock/music.cpp')
-rw-r--r--engines/sherlock/music.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/engines/sherlock/music.cpp b/engines/sherlock/music.cpp
index 3e31bcc83d..884fbd6221 100644
--- a/engines/sherlock/music.cpp
+++ b/engines/sherlock/music.cpp
@@ -86,9 +86,15 @@ void MidiParser_SH::parseNextEvent(EventInfo &info) {
115, 112, 55, 124, 123, 0, 14, 117 /* 120-127 */
};
+ // there is no delta right at the start of the music data
+ // this order is essential, otherwise notes will get delayed or even go missing
+ if (_position._playPos != _tracks[0]) {
+ info.delta = *(_position._playPos++);
+ } else {
+ info.delta = 0;
+ }
info.start = _position._playPos;
- info.delta = 0;
info.event = *_position._playPos++;
//warning("Event %x", info.event);
@@ -157,8 +163,6 @@ void MidiParser_SH::parseNextEvent(EventInfo &info) {
warning("MidiParser_SH::parseNextEvent: Unsupported event code %x", info.event);
break;
}// switch (info.command())
-
- info.delta = *(_position._playPos++);
}
bool MidiParser_SH::loadMusic(byte *data, uint32 size) {