From 30ed036f6e42d9f4caa9d0eafe343e72cc318c66 Mon Sep 17 00:00:00 2001 From: athrxx Date: Tue, 19 Feb 2019 18:30:53 +0100 Subject: KYRA: (EOB1/Amiga) - fix environmental sfx --- engines/kyra/engine/kyra_rpg.cpp | 10 ++++++++-- engines/kyra/sound/sound_amiga_eob.cpp | 19 ++++++++++++++++--- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/engines/kyra/engine/kyra_rpg.cpp b/engines/kyra/engine/kyra_rpg.cpp index 46fef3fcff..616402445d 100644 --- a/engines/kyra/engine/kyra_rpg.cpp +++ b/engines/kyra/engine/kyra_rpg.cpp @@ -204,7 +204,7 @@ Common::Error KyraRpgEngine::init() { initStaticResource(); - _envSfxDistThreshold = (_flags.gameID == GI_EOB2 || _sound->getSfxType() == Sound::kAdLib || _sound->getSfxType() == Sound::kPCSpkr) ? 15 : 3; + _envSfxDistThreshold = ((_flags.gameID == GI_EOB2 && _sound->getSfxType() == Sound::kTowns) || _sound->getSfxType() == Sound::kAdLib || _sound->getSfxType() == Sound::kPCSpkr) ? 15 : (_sound->getSfxType() == Sound::kAmiga ? 4 : 3); _dialogueButtonLabelColor1 = guiSettings()->buttons.labelColor1; _dialogueButtonLabelColor2 = guiSettings()->buttons.labelColor2; @@ -367,7 +367,13 @@ bool KyraRpgEngine::snd_processEnvironmentalSoundEffect(int soundId, int block) } _environmentSfx = soundId; - _environmentSfxVol = (_flags.gameID == GI_EOB2 && _flags.platform == Common::kPlatformFMTowns) ? (dist ? (16 - dist) * 8 - 1 : 127) : ((15 - ((block || (_flags.gameID == GI_LOL && dist < 2)) ? dist : 0)) << 4); + + if (_flags.gameID == GI_EOB2 && _flags.platform == Common::kPlatformFMTowns) + _environmentSfxVol = dist ? (16 - dist) * 8 - 1 : 127; + else if (_flags.platform == Common::kPlatformAmiga) + _environmentSfxVol = dist ? (soundId != 13 ? dist : (dist >= 4) ? 4 : dist) : 1; + else + _environmentSfxVol = (15 - ((block || (_flags.gameID == GI_LOL && dist < 2)) ? dist : 0)) << 4; return true; } diff --git a/engines/kyra/sound/sound_amiga_eob.cpp b/engines/kyra/sound/sound_amiga_eob.cpp index de8bf220a1..800772408f 100644 --- a/engines/kyra/sound/sound_amiga_eob.cpp +++ b/engines/kyra/sound/sound_amiga_eob.cpp @@ -139,9 +139,9 @@ void SoundAmiga_EoB::playTrack(uint8 track) { if (_vm->game() == GI_EOB1) { if (_currentResourceSet == kMusicIntro) { if (track == 1) - newSound = "newintro1.smus"; + newSound = "NEWINTRO1.SMUS"; else if (track == 20) - newSound = "chargen1.smus"; + newSound = "CHARGEN1.SMUS"; } } else if (_vm->game() == GI_EOB2) { @@ -168,7 +168,20 @@ void SoundAmiga_EoB::playSoundEffect(uint8 track, uint8 volume) { Common::String newSound = _resInfo[_currentResourceSet]->soundList[track]; if (!newSound.empty()) { - _driver->startSound(newSound); + if (volume == 255) { + if (_driver->startSound(newSound + "1.SAM")) { + _lastSound = newSound + "1.SAM"; + return; + } else { + volume = 1; + } + } + + if (volume > 0 && volume < 5) { + newSound = Common::String::format("%s%d", newSound.c_str(), volume); + _driver->startSound(newSound); + } + _lastSound = newSound; } } -- cgit v1.2.3