aboutsummaryrefslogtreecommitdiff
path: root/engines/mohawk/riven_sound.cpp
diff options
context:
space:
mode:
authorBastien Bouclet2017-02-20 18:02:57 +0100
committerEugene Sandulenko2017-07-03 08:50:10 +0200
commitf977b5712328133b638c33992d4e111624d1881d (patch)
treec8480f6b0f9f3f2471f44fa09c894015fdc49ba1 /engines/mohawk/riven_sound.cpp
parent9153393219b398ce5a7a8122d9af38e32e128059 (diff)
downloadscummvm-rg350-f977b5712328133b638c33992d4e111624d1881d.tar.gz
scummvm-rg350-f977b5712328133b638c33992d4e111624d1881d.tar.bz2
scummvm-rg350-f977b5712328133b638c33992d4e111624d1881d.zip
MOHAWK: Rewrite the Riven movie manager
Diffstat (limited to 'engines/mohawk/riven_sound.cpp')
-rw-r--r--engines/mohawk/riven_sound.cpp11
1 files changed, 7 insertions, 4 deletions
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),