From f977b5712328133b638c33992d4e111624d1881d Mon Sep 17 00:00:00 2001 From: Bastien Bouclet Date: Mon, 20 Feb 2017 18:02:57 +0100 Subject: MOHAWK: Rewrite the Riven movie manager --- engines/mohawk/riven_sound.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'engines/mohawk/riven_sound.cpp') diff --git a/engines/mohawk/riven_sound.cpp b/engines/mohawk/riven_sound.cpp index 354ba2dcce..36dbab67bb 100644 --- a/engines/mohawk/riven_sound.cpp +++ b/engines/mohawk/riven_sound.cpp @@ -26,11 +26,13 @@ #include "audio/audiostream.h" #include "mohawk/riven_sound.h" +#include "mohawk/riven.h" +#include "mohawk/riven_card.h" #include "mohawk/sound.h" namespace Mohawk { -RivenSoundManager::RivenSoundManager(MohawkEngine *vm) : +RivenSoundManager::RivenSoundManager(MohawkEngine_Riven *vm) : _vm(vm), _effect(nullptr), _mainAmbientSoundId(-1), @@ -68,8 +70,9 @@ void RivenSoundManager::playSound(uint16 id, uint16 volume, bool playOnDraw) { } } -void RivenSoundManager::playSound(const Common::String &name, uint16 volume, bool playOnDraw) { - uint16 id =_vm->findResourceID(ID_TWAV, name); +void RivenSoundManager::playCardSound(const Common::String &name, uint16 volume, bool playOnDraw) { + Common::String fullName = Common::String::format("%d_%s_1", _vm->getCard()->getId(), name.c_str()); + uint16 id =_vm->findResourceID(ID_TWAV, fullName); playSound(id, volume, playOnDraw); } @@ -307,7 +310,7 @@ bool RivenSoundManager::isEffectPlaying() const { return _effect != nullptr && _effect->isPlaying(); } -RivenSound::RivenSound(MohawkEngine *vm, Audio::RewindableAudioStream *rewindStream) : +RivenSound::RivenSound(MohawkEngine_Riven *vm, Audio::RewindableAudioStream *rewindStream) : _vm(vm), _volume(Audio::Mixer::kMaxChannelVolume), _balance(0), -- cgit v1.2.3