diff options
author | athrxx | 2019-02-19 18:30:53 +0100 |
---|---|---|
committer | athrxx | 2019-03-06 20:48:23 +0100 |
commit | 30ed036f6e42d9f4caa9d0eafe343e72cc318c66 (patch) | |
tree | b7a2c5a2f9e4ba9e94b83ad85b4dd048b634968d /engines/kyra | |
parent | e907965d81456c1612777499d52b253cbd7c059d (diff) | |
download | scummvm-rg350-30ed036f6e42d9f4caa9d0eafe343e72cc318c66.tar.gz scummvm-rg350-30ed036f6e42d9f4caa9d0eafe343e72cc318c66.tar.bz2 scummvm-rg350-30ed036f6e42d9f4caa9d0eafe343e72cc318c66.zip |
KYRA: (EOB1/Amiga) - fix environmental sfx
Diffstat (limited to 'engines/kyra')
-rw-r--r-- | engines/kyra/engine/kyra_rpg.cpp | 10 | ||||
-rw-r--r-- | 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; } } |