diff options
author | Florian Kagerer | 2010-10-09 16:39:56 +0000 |
---|---|---|
committer | Florian Kagerer | 2010-10-09 16:39:56 +0000 |
commit | 89fd5b31c1eb9d79648841fc02c0f4cdad8bf433 (patch) | |
tree | 99dc7b03fa7a8c0bfa6a8a803cbb794565a44e36 | |
parent | 5ce63fb78f16dde136019f33c942fb19ffcf3c5b (diff) | |
download | scummvm-rg350-89fd5b31c1eb9d79648841fc02c0f4cdad8bf433.tar.gz scummvm-rg350-89fd5b31c1eb9d79648841fc02c0f4cdad8bf433.tar.bz2 scummvm-rg350-89fd5b31c1eb9d79648841fc02c0f4cdad8bf433.zip |
SCUMM/FM-TOWNS: minor fix for sfx code
svn-id: r53103
-rw-r--r-- | engines/scumm/player_towns.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/engines/scumm/player_towns.cpp b/engines/scumm/player_towns.cpp index 24eb92edc7..4b9bbecefa 100644 --- a/engines/scumm/player_towns.cpp +++ b/engines/scumm/player_towns.cpp @@ -102,10 +102,9 @@ void Player_Towns::playPcmTrack(int sound, const uint8 *data, int velo, int pan, if (!_intf) return; - const uint8 *ptr = data; - const uint8 *sfxData = ptr + 16; + const uint8 *sfxData = data + 16; - int numChan = _v2 ? 1 : ptr[14]; + int numChan = _v2 ? 1 : data[14]; for (int i = 0; i < numChan; i++) { int chan = allocatePcmChannel(sound, i, priority); if (!chan) @@ -145,8 +144,8 @@ int Player_Towns::allocatePcmChannel(int sound, int sfxChanRelIndex, uint32 prio if (_v2 && priority > 255) { chan = 8; - if (_intf->callback(40, 0x47) && _pcmCurrentSound[chan].index != 0xffff) - _vm->_sound->stopSound(_pcmCurrentSound[chan].index); + if (_intf->callback(40, 0x47)) + _intf->callback(39, 0x47); } else { for (int i = 8; i; i--) { if (!_pcmCurrentSound[i].index) { @@ -158,7 +157,9 @@ int Player_Towns::allocatePcmChannel(int sound, int sfxChanRelIndex, uint32 prio continue; chan = i; - if (_pcmCurrentSound[chan].index != 0xffff) + if (_pcmCurrentSound[chan].index == 0xffff) + _intf->callback(39, chan + 0x3f); + else _vm->_sound->stopSound(_pcmCurrentSound[chan].index); } @@ -166,8 +167,10 @@ int Player_Towns::allocatePcmChannel(int sound, int sfxChanRelIndex, uint32 prio for (int i = 1; i < 9; i++) { if (priority >= _pcmCurrentSound[i].priority) chan = i; - } - if (chan && _pcmCurrentSound[chan].index != 0xffff) + } + if (_pcmCurrentSound[chan].index == 0xffff) + _intf->callback(39, chan + 0x3f); + else _vm->_sound->stopSound(_pcmCurrentSound[chan].index); } } |