aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/sci/sfx/midiparser.cpp11
-rw-r--r--sound/midiparser.cpp24
-rw-r--r--sound/midiparser.h2
3 files changed, 16 insertions, 21 deletions
diff --git a/engines/sci/sfx/midiparser.cpp b/engines/sci/sfx/midiparser.cpp
index 87cbfb48d6..5ddccf5a01 100644
--- a/engines/sci/sfx/midiparser.cpp
+++ b/engines/sci/sfx/midiparser.cpp
@@ -146,16 +146,9 @@ void MidiParser_SCI::parseNextEvent(EventInfo &info) {
case kMidiHold:
// Check if the hold ID marker is the same as the hold ID
// marker set for that song by cmdSetSoundHold.
- // If it is, loop back
-
- // FIXME: this is currently broken, as seen in the
- // scene in LSL5 where Larry first arrives at the airport
- // in the limo. The engine sound is stopped instead of
- // continuing. As a possible direction to look at for a fix,
- // removing the allNotesOff() call in jumpToTick() lets the
- // engine sound continue.
+ // If it is, loop back, but don't stop notes when jumping.
if (info.basic.param2 == _pSnd->hold)
- jumpToTick(_loopTick);
+ jumpToTick(_loopTick, false, false);
break;
case kUpdateCue:
switch (_soundVersion) {
diff --git a/sound/midiparser.cpp b/sound/midiparser.cpp
index 5aa458a792..99319461e9 100644
--- a/sound/midiparser.cpp
+++ b/sound/midiparser.cpp
@@ -353,7 +353,7 @@ void MidiParser::hangAllActiveNotes() {
}
}
-bool MidiParser::jumpToTick(uint32 tick, bool fireEvents) {
+bool MidiParser::jumpToTick(uint32 tick, bool fireEvents, bool stopNotes) {
if (_active_track >= _num_tracks)
return false;
@@ -402,18 +402,20 @@ bool MidiParser::jumpToTick(uint32 tick, bool fireEvents) {
}
}
- if (!_smartJump || !currentPos._play_pos) {
- allNotesOff();
- } else {
- EventInfo targetEvent(_next_event);
- Tracker targetPosition(_position);
+ if (stopNotes) {
+ if (!_smartJump || !currentPos._play_pos) {
+ allNotesOff();
+ } else {
+ EventInfo targetEvent(_next_event);
+ Tracker targetPosition(_position);
- _position = currentPos;
- _next_event = currentEvent;
- hangAllActiveNotes();
+ _position = currentPos;
+ _next_event = currentEvent;
+ hangAllActiveNotes();
- _next_event = targetEvent;
- _position = targetPosition;
+ _next_event = targetEvent;
+ _position = targetPosition;
+ }
}
_abort_parse = true;
diff --git a/sound/midiparser.h b/sound/midiparser.h
index 2e0824c943..0ba12ce2b1 100644
--- a/sound/midiparser.h
+++ b/sound/midiparser.h
@@ -379,7 +379,7 @@ public:
void stopPlaying();
bool setTrack(int track);
- bool jumpToTick(uint32 tick, bool fireEvents = false);
+ bool jumpToTick(uint32 tick, bool fireEvents = false, bool stopNotes = true);
uint32 getPPQN() { return _ppqn; }
virtual uint32 getTick() { return _position._play_tick; }