diff options
author | Torbjörn Andersson | 2005-10-13 15:33:56 +0000 |
---|---|---|
committer | Torbjörn Andersson | 2005-10-13 15:33:56 +0000 |
commit | 2ba1926be6b73778c68c75e25eb20ea44d0e2857 (patch) | |
tree | ba260f8879f858edce8c039b17e12adacbd43de9 | |
parent | 9895a020326c91971373b7d3c649bc6e245e8559 (diff) | |
download | scummvm-rg350-2ba1926be6b73778c68c75e25eb20ea44d0e2857.tar.gz scummvm-rg350-2ba1926be6b73778c68c75e25eb20ea44d0e2857.tar.bz2 scummvm-rg350-2ba1926be6b73778c68c75e25eb20ea44d0e2857.zip |
It should not be a fatal error if allocate_part() fails. As far as I
understand, it just means that the currently active parts are too important
(i.e. have too high priority) to throw out for this new one.
This makes bugs #1325060 and #1325487 less severe.
svn-id: r19062
-rw-r--r-- | scumm/imuse_player.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/scumm/imuse_player.cpp b/scumm/imuse_player.cpp index 9ebf9c485b..abc09984c2 100644 --- a/scumm/imuse_player.cpp +++ b/scumm/imuse_player.cpp @@ -775,7 +775,7 @@ Part *Player::getPart(uint8 chan) { part = _se->allocate_part(_priority, _midi); if (!part) { - error("no parts available"); + debug(1, "No parts available"); return NULL; } @@ -869,10 +869,12 @@ void Player::play_active_notes() { for (i = 0; i < 16; ++i) { part = getPart(i); - mask = 1 << i; - for (j = 0; j < 128; ++j) { - if (_active_notes[j] & mask) - part->noteOn(j, 80); + if (part) { + mask = 1 << i; + for (j = 0; j < 128; ++j) { + if (_active_notes[j] & mask) + part->noteOn(j, 80); + } } } } |