diff options
author | whiterandrek | 2018-06-10 13:07:44 +0300 |
---|---|---|
committer | Eugene Sandulenko | 2018-06-28 23:51:32 +0200 |
commit | 3ca2c13893583bf2578e359faa6ad3bb6892f49b (patch) | |
tree | a1c0c62271dc47973809c83f8692ac252de125a9 | |
parent | 58e7d560eefa6e7cd86109f1d4b8227856cc01c8 (diff) | |
download | scummvm-rg350-3ca2c13893583bf2578e359faa6ad3bb6892f49b.tar.gz scummvm-rg350-3ca2c13893583bf2578e359faa6ad3bb6892f49b.tar.bz2 scummvm-rg350-3ca2c13893583bf2578e359faa6ad3bb6892f49b.zip |
PINK: remove observing of looped sounds
-rw-r--r-- | engines/pink/objects/actions/action_sound.cpp | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/engines/pink/objects/actions/action_sound.cpp b/engines/pink/objects/actions/action_sound.cpp index cb5ce0b240..9f12297adb 100644 --- a/engines/pink/objects/actions/action_sound.cpp +++ b/engines/pink/objects/actions/action_sound.cpp @@ -52,23 +52,26 @@ void ActionSound::toConsole() { void ActionSound::start() { Audio::Mixer::SoundType soundType = _isBackground ? Audio::Mixer::kMusicSoundType : Audio::Mixer::kSFXSoundType; - Director *director = _actor->getPage()->getGame()->getDirector(); - director->addSound(this); - - _sound.play(_actor->getPage()->getResourceStream(_fileName), soundType, _volume, 0, _isLoop); - if (_isLoop) + Page *page = _actor->getPage(); + if (!_isLoop) { + Director *director = page->getGame()->getDirector(); + director->addSound(this); + } else _actor->endAction(); + _sound.play(page->getResourceStream(_fileName), soundType, _volume, 0, _isLoop); + debug("Actor %s has now ActionSound %s", _actor->getName().c_str(), _name.c_str()); } void ActionSound::end() { _sound.stop(); - debug("ActionSound %s of Actor %s is ended", _name.c_str(), _actor->getName().c_str()); - - Director *director = _actor->getPage()->getGame()->getDirector(); - director->removeSound(this); + if (!_isLoop) { + Director *director = _actor->getPage()->getGame()->getDirector(); + director->removeSound(this); + } + debug("ActionSound %s of Actor %s is ended", _name.c_str(), _actor->getName().c_str()); } void ActionSound::update() { |