aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorathrxx2011-12-05 22:55:50 +0100
committerathrxx2011-12-05 22:59:33 +0100
commit8d1b07f0543372ee6923b87ba562f975681cc760 (patch)
treec5fb3224f6755b0b8e96e40502f12aac25d59e34
parent832952d118b823d393a9dac78e21e7d37e4fab99 (diff)
downloadscummvm-rg350-8d1b07f0543372ee6923b87ba562f975681cc760.tar.gz
scummvm-rg350-8d1b07f0543372ee6923b87ba562f975681cc760.tar.bz2
scummvm-rg350-8d1b07f0543372ee6923b87ba562f975681cc760.zip
SCUMM: fix minor bug in FM-TOWNS sound code
(multi channel pcm sounds did not get restored correctly after loading a save file)
-rw-r--r--engines/scumm/player_towns.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/engines/scumm/player_towns.cpp b/engines/scumm/player_towns.cpp
index f6f493a1e1..2588026e59 100644
--- a/engines/scumm/player_towns.cpp
+++ b/engines/scumm/player_towns.cpp
@@ -75,10 +75,19 @@ void Player_Towns::saveLoadWithSerializer(Serializer *ser) {
}
void Player_Towns::restoreAfterLoad() {
+ Common::Array<uint16> restoredSounds;
+
for (int i = 1; i < 9; i++) {
if (!_pcmCurrentSound[i].index || _pcmCurrentSound[i].index == 0xffff)
continue;
+ // Don't restart multichannel sounds more than once
+ if (Common::find(restoredSounds.begin(), restoredSounds.end(), _pcmCurrentSound[i].index) != restoredSounds.end())
+ continue;
+
+ if (!_v2)
+ restoredSounds.push_back(_pcmCurrentSound[i].index);
+
uint8 *ptr = _vm->getResourceAddress(rtSound, _pcmCurrentSound[i].index);
if (!ptr)
continue;