Skip to content

Commit

Permalink
SCUMM: fix minor bug in FM-TOWNS sound code
Browse files Browse the repository at this point in the history
(multi channel pcm sounds did not get restored correctly after loading a save file)
  • Loading branch information
athrxx committed Dec 5, 2011
1 parent 832952d commit 8d1b07f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions engines/scumm/player_towns.cpp
Expand Up @@ -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;
Expand Down

0 comments on commit 8d1b07f

Please sign in to comment.