aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorathrxx2012-11-03 23:10:00 +0100
committerathrxx2012-11-11 19:14:27 +0100
commit8789087be9749f7a13fbfdd72a2c984c0bc9e158 (patch)
tree099b27d2c59e7abb68b6a2e566c24e23dc8ac01a
parent17ed912ed538eee539ab199c738ccfa3709f7e31 (diff)
downloadscummvm-rg350-8789087be9749f7a13fbfdd72a2c984c0bc9e158.tar.gz
scummvm-rg350-8789087be9749f7a13fbfdd72a2c984c0bc9e158.tar.bz2
scummvm-rg350-8789087be9749f7a13fbfdd72a2c984c0bc9e158.zip
KYRA: fix LOL sfx volume
-rw-r--r--engines/kyra/sound_lol.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/engines/kyra/sound_lol.cpp b/engines/kyra/sound_lol.cpp
index cb9be43b07..6c88312f1a 100644
--- a/engines/kyra/sound_lol.cpp
+++ b/engines/kyra/sound_lol.cpp
@@ -165,10 +165,19 @@ void LoLEngine::snd_playSoundEffect(int track, int volume) {
return;
volume &= 0xff;
- int16 volIndex = (int16)READ_LE_UINT16(&_ingameSoundIndex[track * 2 + 1]);
+ // Priority setting (used for acquiring one of the 4 pcm channels) currently not implemented.
+ // int16 vprIndex = (int16)READ_LE_UINT16(&_ingameSoundIndex[track * 2 + 1]);
+ // uint16 priority = (vprIndex > 0) ? (vprIndex * volume) >> 8 : -vprIndex;
- uint16 vocLevel = (volIndex > 0) ? (volIndex * volume) >> 8 : -volIndex;
- vocLevel = CLIP(volume >> 4, 2, 13) * 7 + 164;
+ static const uint8 volTable1[] = { 223, 159, 95, 47, 15, 0 };
+ static const uint8 volTable2[] = { 255, 191, 127, 63, 30, 0 };
+
+ for (int i = 0; i < 6; i++) {
+ if (volTable1[i] < volume) {
+ volume = volTable2[i];
+ break;
+ }
+ }
int16 vocIndex = (int16)READ_LE_UINT16(&_ingameSoundIndex[track * 2]);
@@ -180,7 +189,7 @@ void LoLEngine::snd_playSoundEffect(int track, int volume) {
if (hasVocFile) {
if (_sound->isVoicePresent(_ingameSoundList[vocIndex]))
- _sound->voicePlay(_ingameSoundList[vocIndex], 0, vocLevel & 0xff, true);
+ _sound->voicePlay(_ingameSoundList[vocIndex], 0, volume, true);
} else if (_flags.platform == Common::kPlatformPC) {
if (_sound->getSfxType() == Sound::kMidiMT32)
track = (track < _ingameMT32SoundIndexSize) ? (_ingameMT32SoundIndex[track] - 1) : -1;