From 2d992a44309cfbe033d6a02c32db4183bf7ac978 Mon Sep 17 00:00:00 2001 From: Thanasis Antoniou Date: Tue, 14 May 2019 13:34:01 +0300 Subject: BLADERUNNER: Fix sounds persist after load or end state Loading a game with music from a scene with music would cause none of the music to be removed. Also looping sounds would persist in the loading screen after a game-over state --- engines/bladerunner/bladerunner.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'engines/bladerunner') diff --git a/engines/bladerunner/bladerunner.cpp b/engines/bladerunner/bladerunner.cpp index 3d2a649dbc..44a59e1182 100644 --- a/engines/bladerunner/bladerunner.cpp +++ b/engines/bladerunner/bladerunner.cpp @@ -1863,6 +1863,14 @@ void BladeRunnerEngine::playerGainsControl() { void BladeRunnerEngine::playerDied() { playerLosesControl(); +#if BLADERUNNER_ORIGINAL_BUGS +#else + _ambientSounds->removeAllNonLoopingSounds(true); + _ambientSounds->removeAllLoopingSounds(4); + _music->stop(4); + _audioSpeech->stopSpeech(); +#endif // BLADERUNNER_ORIGINAL_BUGS + int timeWaitEnd = _time->current() + 5000; while (_time->current() < timeWaitEnd) { gameTick(); @@ -1946,8 +1954,15 @@ bool BladeRunnerEngine::loadGame(Common::SeekableReadStream &stream) { SaveFileReadStream s(stream); _ambientSounds->removeAllNonLoopingSounds(true); +#if BLADERUNNER_ORIGINAL_BUGS _ambientSounds->removeAllLoopingSounds(1); _music->stop(2); +#else + // loading into another game that also has music would + // two music tracks to overlap and none was stopped + _ambientSounds->removeAllLoopingSounds(0); + _music->stop(0); +#endif // BLADERUNNER_ORIGINAL_BUGS _audioSpeech->stopSpeech(); _actorDialogueQueue->flush(true, false); _screenEffects->_entries.clear(); -- cgit v1.2.3