aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJamieson Christian2002-10-21 08:17:18 +0000
committerJamieson Christian2002-10-21 08:17:18 +0000
commit5862695bfd5cc08ec6e47dd8cfe082a0a86b7f6b (patch)
tree921c398345ed558e348394e9be68d5cd1f4d939d
parent8a0d3438fc9edc5c8ce912a0da0db1944efe79d1 (diff)
downloadscummvm-rg350-5862695bfd5cc08ec6e47dd8cfe082a0a86b7f6b.tar.gz
scummvm-rg350-5862695bfd5cc08ec6e47dd8cfe082a0a86b7f6b.tar.bz2
scummvm-rg350-5862695bfd5cc08ec6e47dd8cfe082a0a86b7f6b.zip
Patch #607175 correction to fix regression Bug #622606
svn-id: r5207
-rw-r--r--scumm/imuse.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/scumm/imuse.cpp b/scumm/imuse.cpp
index e1ae7eea10..74af0cb5f9 100644
--- a/scumm/imuse.cpp
+++ b/scumm/imuse.cpp
@@ -895,14 +895,17 @@ bool IMuseInternal::start_sound(int sound)
}
}
- // Make sure the requested sound is not already playing.
- // FIXME: This should NEVER happen, but until we get all of the
- // Sam & Max iMuse issues resolved, it does happen occasionally.
- // This hack is just to make playtesting tolerable.
+ // If the requested sound is already playing, start it over
+ // from scratch. This was originally a hack to prevent Sam & Max
+ // iMuse messiness while upgrading the iMuse engine, but it
+ // is apparently necessary to deal with fade-and-restart
+ // race conditions that were observed in MI2. Reference
+ // Bug #590511 and Patch #607175 (which was reversed to fix
+ // an FOA regression: Bug #622606).
int i;
for (i = ARRAYSIZE(_players), player = _players; i != 0; i--, player++) {
if (player->_active && player->_id == sound)
- return true; // break;
+ break;
}
if (!i)
@@ -1220,17 +1223,14 @@ int IMuseInternal::get_sound_status(int sound)
{
int i;
Player *player;
-
for (i = ARRAYSIZE(_players), player = _players; i != 0; i--, player++) {
if (player->_active && player->_id == (uint16)sound) {
// Assume that anyone asking for the sound status is
// really asking "is it ok if I start playing this
// sound now?" So if the sound is about to fade out,
- // shut it down and pretend it wasn't playing.
- if (player->is_fading_out()) {
- player->clear();
+ // pretend it's not playing.
+ if (player->is_fading_out())
continue;
- }
return 1;
}
}