aboutsummaryrefslogtreecommitdiff
path: root/scumm
diff options
context:
space:
mode:
authorJamieson Christian2003-08-07 23:42:15 +0000
committerJamieson Christian2003-08-07 23:42:15 +0000
commit93c90f46744feb5bc843f8b3fb8f8cf8970fcecc (patch)
treeb59bcb7d75bfbb24a741571c272f05ff7796bd1b /scumm
parentf67b126f1dee9e14a28d555f10cd556f173b9e3a (diff)
downloadscummvm-rg350-93c90f46744feb5bc843f8b3fb8f8cf8970fcecc.tar.gz
scummvm-rg350-93c90f46744feb5bc843f8b3fb8f8cf8970fcecc.tar.bz2
scummvm-rg350-93c90f46744feb5bc843f8b3fb8f8cf8970fcecc.zip
Fix for Bug [780924] IMUSE: Pitchbend isn't reset when changing tracks
When scanning (not jumping) to a target location in a different track, the current track is first scanned to the end to update the player state before starting into the new track. Miscellaneous scan-related cleanup is included. svn-id: r9589
Diffstat (limited to 'scumm')
-rw-r--r--scumm/imuse_player.cpp25
1 files changed, 16 insertions, 9 deletions
diff --git a/scumm/imuse_player.cpp b/scumm/imuse_player.cpp
index 50cee4bae5..6e9146bd13 100644
--- a/scumm/imuse_player.cpp
+++ b/scumm/imuse_player.cpp
@@ -336,15 +336,17 @@ void Player::sysEx(byte *p, uint16 len) {
return;
#ifdef IMUSE_DEBUG
- for (a = 0; a < len + 1 && a < 19; ++a) {
- sprintf((char *)&buf[a*3], " %02X", p[a]);
- } // next for
- if (a < len + 1) {
- buf[a*3] = buf[a*3+1] = buf[a*3+2] = '.';
- ++a;
- } // end if
- buf[a*3] = '\0';
- debug(0, "[%02d] SysEx:%s", _id, buf);
+ if (!_scanning) {
+ for (a = 0; a < len + 1 && a < 19; ++a) {
+ sprintf((char *)&buf[a*3], " %02X", p[a]);
+ } // next for
+ if (a < len + 1) {
+ buf[a*3] = buf[a*3+1] = buf[a*3+2] = '.';
+ ++a;
+ } // end if
+ buf[a*3] = '\0';
+ debug(0, "[%02d] SysEx:%s", _id, buf);
+ }
#endif
switch (code = *p++) {
@@ -826,6 +828,11 @@ int Player::scan(uint totrack, uint tobeat, uint totick) {
clear_active_notes();
_scanning = true;
+ // If the scan involves a track switch, scan to the end of
+ // the current track so that our state when starting the
+ // new track is fully up to date.
+ if (totrack != _track_index)
+ _parser->jumpToTick (-1, true);
_parser->setTrack(totrack);
if (!_parser->jumpToTick((tobeat - 1) * TICKS_PER_BEAT + totick, true)) {
_scanning = false;