diff options
author | athrxx | 2020-01-03 00:04:39 +0100 |
---|---|---|
committer | athrxx | 2020-01-03 01:05:16 +0100 |
commit | 346dd3ec637dd21d5c52dac56d65f229f3087454 (patch) | |
tree | fb29676909ca008e6b8ae08e1c61487ea4fcfb15 /engines | |
parent | d9f6a0cf4d6a5765b73814738ca7662e1adea2cd (diff) | |
download | scummvm-rg350-346dd3ec637dd21d5c52dac56d65f229f3087454.tar.gz scummvm-rg350-346dd3ec637dd21d5c52dac56d65f229f3087454.tar.bz2 scummvm-rg350-346dd3ec637dd21d5c52dac56d65f229f3087454.zip |
KYRA: (HOF) - fix speech/sfx priority (bug #11301)
It doesn't come as a big surprise that the original handles this more or less in the same manner as LOL.
The Kyra games usually don't play many sfx at once. That's probably the reason why this never came up before.
Diffstat (limited to 'engines')
-rw-r--r-- | engines/kyra/engine/kyra_hof.cpp | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/engines/kyra/engine/kyra_hof.cpp b/engines/kyra/engine/kyra_hof.cpp index 1d60c04035..bc09be038c 100644 --- a/engines/kyra/engine/kyra_hof.cpp +++ b/engines/kyra/engine/kyra_hof.cpp @@ -1457,9 +1457,15 @@ void KyraEngine_HoF::snd_playSoundEffect(int track, int volume) { _lastSfxTrack = track; } - int16 vocIndex = (int16)READ_LE_UINT16(&_ingameSoundIndex[track * 2]); - if (vocIndex != -1) { - _sound->voicePlay(_ingameSoundList[vocIndex], 0, 255, 255, true); + if (track == -1) + return; + + int16 prio = (int16)READ_LE_UINT16(&_ingameSoundIndex[track * 2 + 1]); + int16 file = (int16)READ_LE_UINT16(&_ingameSoundIndex[track * 2]); + prio = prio <= 0 ? -prio : (prio * volume) >> 8; + + if (file != -1 && _sound->useDigitalSfx()) { + _sound->voicePlay(_ingameSoundList[file], 0, volume, prio, true); } else if (_flags.platform == Common::kPlatformDOS) { if (_sound->getSfxType() == Sound::kMidiMT32) track = track < _mt32SfxMapSize ? _mt32SfxMap[track] - 1 : -1; @@ -1470,12 +1476,8 @@ void KyraEngine_HoF::snd_playSoundEffect(int track, int volume) { if (track != -1) KyraEngine_v1::snd_playSoundEffect(track); - - // TODO ?? Maybe there is a way to let users select whether they want - // voc, midi or adl sfx (even though it makes no sense to choose anything but voc). - // The PC-98 version has support for non-pcm sound effects, but only for tracks - // which also have voc files. The syntax would be: - // KyraEngine_v1::snd_playSoundEffect(vocIndex); + } else if (file != -1) { + KyraEngine_v1::snd_playSoundEffect(file); } } |