diff options
author | Thanasis Antoniou | 2019-03-27 12:39:24 +0200 |
---|---|---|
committer | Thanasis Antoniou | 2019-03-27 12:39:24 +0200 |
commit | bb719ba87c5d370c3a62a660118b6cb58576b61b (patch) | |
tree | 4260f6cf0dec8a8888bae7b25db1f39362ae2471 | |
parent | 5795e25d73dee1ba1363546b6f351031baa6f4d3 (diff) | |
download | scummvm-rg350-bb719ba87c5d370c3a62a660118b6cb58576b61b.tar.gz scummvm-rg350-bb719ba87c5d370c3a62a660118b6cb58576b61b.tar.bz2 scummvm-rg350-bb719ba87c5d370c3a62a660118b6cb58576b61b.zip |
BLADERUNNER: Fix missing sound effects in some occassions
LABBUZZ sound for the maze and Animoid sounds
Moved lab buzz in next scene's (PS10) init, and increased size of track buffer to compensate for frequently dropping sounds in places with mayne sound effects (eg Animoid Row, Izo's door and trapdoor)
-rw-r--r-- | engines/bladerunner/audio_mixer.cpp | 3 | ||||
-rw-r--r-- | engines/bladerunner/audio_mixer.h | 6 | ||||
-rw-r--r-- | engines/bladerunner/audio_player.cpp | 10 | ||||
-rw-r--r-- | engines/bladerunner/audio_player.h | 2 | ||||
-rw-r--r-- | engines/bladerunner/script/scene/ps10.cpp | 5 | ||||
-rw-r--r-- | engines/bladerunner/script/scene/ps15.cpp | 7 |
6 files changed, 26 insertions, 7 deletions
diff --git a/engines/bladerunner/audio_mixer.cpp b/engines/bladerunner/audio_mixer.cpp index b1562f33f8..df3a36154e 100644 --- a/engines/bladerunner/audio_mixer.cpp +++ b/engines/bladerunner/audio_mixer.cpp @@ -28,6 +28,7 @@ #include "audio/mixer.h" #include "common/timer.h" +//#include "common/debug.h" namespace BladeRunner { @@ -64,8 +65,10 @@ int AudioMixer::play(Audio::Mixer::SoundType type, Audio::RewindableAudioStream } if (channel == -1) { if (priority < lowestPriority) { + //debug("No available audio channel found - giving up"); return -1; } + //debug("Stopping lowest priority channel %d with lower prio %d!", lowestPriorityChannel, lowestPriority); stop(lowestPriorityChannel, 0); channel = lowestPriorityChannel; } diff --git a/engines/bladerunner/audio_mixer.h b/engines/bladerunner/audio_mixer.h index ca4b4807d5..ce7040bad6 100644 --- a/engines/bladerunner/audio_mixer.h +++ b/engines/bladerunner/audio_mixer.h @@ -33,9 +33,9 @@ namespace BladeRunner { class BladeRunnerEngine; class AudioMixer { - static const int kChannels = 9; - static const int kUsableChannels = 8; - static const int kMusicChannel = 8; + static const int kChannels = 15; // original was 9; + static const int kUsableChannels = 14; // original was 8; + static const int kMusicChannel = 14; // original was 8; static const int kUpdatesPerSecond = 40; struct Channel { diff --git a/engines/bladerunner/audio_player.cpp b/engines/bladerunner/audio_player.cpp index 4507506888..8673fab2f6 100644 --- a/engines/bladerunner/audio_player.cpp +++ b/engines/bladerunner/audio_player.cpp @@ -41,7 +41,7 @@ namespace BladeRunner { AudioPlayer::AudioPlayer(BladeRunnerEngine *vm) { _vm = vm; - for (int i = 0; i != 6; ++i) { + for (int i = 0; i != kTracks; ++i) { _tracks[i].priority = 0; _tracks[i].isActive = false; _tracks[i].channel = -1; @@ -138,8 +138,9 @@ int AudioPlayer::playAud(const Common::String &name, int volume, int panFrom, in int lowestPriority = 1000000; int lowestPriorityTrack = -1; - for (int i = 0; i != 6; ++i) { + for (int i = 0; i != kTracks; ++i) { if (!isActive(i)) { + //debug ("Assigned track %i to %s", i, name.c_str()); track = i; break; } @@ -154,12 +155,14 @@ int AudioPlayer::playAud(const Common::String &name, int volume, int panFrom, in * the new priority */ if (track == -1 && lowestPriority < priority) { + //debug ("Stop lowest priority track (with lower prio: %d %d), for %s %d!", lowestPriorityTrack, lowestPriority, name.c_str(), priority); stop(lowestPriorityTrack, true); track = lowestPriorityTrack; } /* If there's still no available track, give up */ if (track == -1) { + //debug ("No available track for %s %d - giving up", name.c_str(), priority); return -1; } @@ -168,6 +171,7 @@ int AudioPlayer::playAud(const Common::String &name, int volume, int panFrom, in if (!_vm->_audioCache->findByHash(hash)) { Common::SeekableReadStream *r = _vm->getResourceStream(name); if (!r) { + //debug ("Could not get stream for %s %d - giving up", name.c_str(), priority); return -1; } @@ -175,6 +179,7 @@ int AudioPlayer::playAud(const Common::String &name, int volume, int panFrom, in while (!_vm->_audioCache->canAllocate(size)) { if (!_vm->_audioCache->dropOldest()) { delete r; + //debug ("No available mem in cache for %s %d - giving up", name.c_str(), priority); return -1; } } @@ -201,6 +206,7 @@ int AudioPlayer::playAud(const Common::String &name, int volume, int panFrom, in if (channel == -1) { delete audioStream; + //debug ("No available channel for %s %d - giving up", name.c_str(), priority); return -1; } diff --git a/engines/bladerunner/audio_player.h b/engines/bladerunner/audio_player.h index 580bdbcb79..8fb3c48794 100644 --- a/engines/bladerunner/audio_player.h +++ b/engines/bladerunner/audio_player.h @@ -41,7 +41,7 @@ enum AudioPlayerFlags { }; class AudioPlayer { - static const int kTracks = 6; + static const int kTracks = 12; // original was 6 struct Track { bool isActive; diff --git a/engines/bladerunner/script/scene/ps10.cpp b/engines/bladerunner/script/scene/ps10.cpp index eadcea523c..e2cbb5eb7c 100644 --- a/engines/bladerunner/script/scene/ps10.cpp +++ b/engines/bladerunner/script/scene/ps10.cpp @@ -416,6 +416,11 @@ void SceneScriptPS10::InitializeScene() { Ambient_Sounds_Add_Sound(306, 5, 100, 17, 27, -100, 100, -101, -101, 0, 0); Ambient_Sounds_Add_Sound(307, 5, 100, 17, 27, -100, 100, -101, -101, 0, 0); Ambient_Sounds_Add_Sound(308, 5, 100, 17, 27, -100, 100, -101, -101, 0, 0); +#if BLADERUNNER_ORIGINAL_BUGS +#else + // Moved here from PS15 + Sound_Play(155, 90, 0, 0, 50); // LABBUZZ1.AUD +#endif // BLADERUNNER_ORIGINAL_BUGS } void SceneScriptPS10::SceneLoaded() { diff --git a/engines/bladerunner/script/scene/ps15.cpp b/engines/bladerunner/script/scene/ps15.cpp index def00bfcbb..c8405e0e75 100644 --- a/engines/bladerunner/script/scene/ps15.cpp +++ b/engines/bladerunner/script/scene/ps15.cpp @@ -123,7 +123,12 @@ bool SceneScriptPS15::ClickedOnExit(int exitId) { if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -183.58f, -113.43f, 91.7f, 0, true, false, 0)) { Actor_Says(kActorMcCoy, 4440, 18); Actor_Says(kActorSergeantWalls, 150, 17); - Sound_Play(155, 90, 0, 0, 50); +#if BLADERUNNER_ORIGINAL_BUGS + // Sometimes the scene transition code (or the Ambient_Sounds_Remove_All_Non_Looping_Sounds) + // would stop this from playing (rare occasions) + // Solution: moved into PS10 code + Sound_Play(155, 90, 0, 0, 50); // LABBUZZ1.AUD +#endif // BLADERUNNER_ORIGINAL_BUGS Ambient_Sounds_Remove_All_Non_Looping_Sounds(true); Ambient_Sounds_Remove_All_Looping_Sounds(1); Set_Enter(kSetPS10_PS11_PS12_PS13, kScenePS10); |