diff options
author | Bastien Bouclet | 2017-07-01 13:52:50 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2017-07-03 08:50:10 +0200 |
commit | dd4c0bcbeb65c62fe07ee28388f98834f1786e0c (patch) | |
tree | c37541f89f1aa33bb8680fd3301c618302962999 | |
parent | f29197e32c023a3c7969409b2bec2f94edd4c53a (diff) | |
download | scummvm-rg350-dd4c0bcbeb65c62fe07ee28388f98834f1786e0c.tar.gz scummvm-rg350-dd4c0bcbeb65c62fe07ee28388f98834f1786e0c.tar.bz2 scummvm-rg350-dd4c0bcbeb65c62fe07ee28388f98834f1786e0c.zip |
MOHAWK: Set the proper mixer sound types for Riven
-rw-r--r-- | engines/mohawk/riven_sound.cpp | 11 | ||||
-rw-r--r-- | engines/mohawk/riven_sound.h | 5 |
2 files changed, 9 insertions, 7 deletions
diff --git a/engines/mohawk/riven_sound.cpp b/engines/mohawk/riven_sound.cpp index 20ba353863..efbcdfb33c 100644 --- a/engines/mohawk/riven_sound.cpp +++ b/engines/mohawk/riven_sound.cpp @@ -61,7 +61,7 @@ void RivenSoundManager::playSound(uint16 id, uint16 volume, bool playOnDraw) { return; } - _effect = new RivenSound(_vm, rewindStream); + _effect = new RivenSound(_vm, rewindStream, Audio::Mixer::kSFXSoundType); _effect->setVolume(volume); _effectPlayOnDraw = playOnDraw; @@ -138,7 +138,7 @@ void RivenSoundManager::addAmbientSounds(const SLSTRecord &record) { for (uint i = oldSize; i < _ambientSounds.sounds.size(); i++) { Audio::RewindableAudioStream *stream = makeAudioStream(record.soundIds[i]); - RivenSound *sound = new RivenSound(_vm, stream); + RivenSound *sound = new RivenSound(_vm, stream, Audio::Mixer::kMusicSoundType); sound->setVolume(record.volumes[i]); sound->setBalance(record.balances[i]); @@ -310,12 +310,13 @@ bool RivenSoundManager::isEffectPlaying() const { return _effect != nullptr && _effect->isPlaying(); } -RivenSound::RivenSound(MohawkEngine_Riven *vm, Audio::RewindableAudioStream *rewindStream) : +RivenSound::RivenSound(MohawkEngine_Riven *vm, Audio::RewindableAudioStream *rewindStream, Audio::Mixer::SoundType mixerType) : _vm(vm), _volume(Audio::Mixer::kMaxChannelVolume), _balance(0), _looping(false), - _stream(rewindStream) { + _stream(rewindStream), + _mixerType(mixerType) { } @@ -371,7 +372,7 @@ void RivenSound::play() { int8 mixerBalance = convertBalance(_balance); byte mixerVolume = convertVolume(_volume); - _vm->_mixer->playStream(Audio::Mixer::kPlainSoundType, &_handle, playStream, -1, mixerVolume, mixerBalance); + _vm->_mixer->playStream(_mixerType, &_handle, playStream, -1, mixerVolume, mixerBalance); _stream = nullptr; } diff --git a/engines/mohawk/riven_sound.h b/engines/mohawk/riven_sound.h index a929c43087..ce2ddbcbe8 100644 --- a/engines/mohawk/riven_sound.h +++ b/engines/mohawk/riven_sound.h @@ -154,7 +154,7 @@ private: */ class RivenSound { public: - RivenSound(MohawkEngine_Riven *vm, Audio::RewindableAudioStream *rewindStream); + RivenSound(MohawkEngine_Riven *vm, Audio::RewindableAudioStream *rewindStream, Audio::Mixer::SoundType mixerType); ~RivenSound(); /** Start playing the sound stream passed to the constructor */ @@ -178,7 +178,7 @@ public: /** Change the balance */ void setBalance(int16 balance); - /** Set the sound to indefinitely loop. Must be called before startting the playback */ + /** Set the sound to indefinitely loop. Must be called before starting the playback */ void setLooping(bool loop); private: @@ -188,6 +188,7 @@ private: MohawkEngine_Riven *_vm; Audio::SoundHandle _handle; + Audio::Mixer::SoundType _mixerType; Audio::RewindableAudioStream *_stream; uint16 _volume; |