aboutsummaryrefslogtreecommitdiff
path: root/engines/pink/objects/actions/action_play_with_sfx.cpp
diff options
context:
space:
mode:
authorwhiterandrek2018-04-07 11:36:09 +0300
committerEugene Sandulenko2018-06-28 23:51:32 +0200
commitdac8d2a72b427cdecedfe4a951aa6166ce7b3720 (patch)
tree04bcc501b922dffa5d76ac1ae6a3559eddcda950 /engines/pink/objects/actions/action_play_with_sfx.cpp
parent78c4ed85ab7a84b18c8c7fd2e93c6bf2798acab6 (diff)
downloadscummvm-rg350-dac8d2a72b427cdecedfe4a951aa6166ce7b3720.tar.gz
scummvm-rg350-dac8d2a72b427cdecedfe4a951aa6166ce7b3720.tar.bz2
scummvm-rg350-dac8d2a72b427cdecedfe4a951aa6166ce7b3720.zip
PINK: bugfixes and added basic inventory implementation
Diffstat (limited to 'engines/pink/objects/actions/action_play_with_sfx.cpp')
-rw-r--r--engines/pink/objects/actions/action_play_with_sfx.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/engines/pink/objects/actions/action_play_with_sfx.cpp b/engines/pink/objects/actions/action_play_with_sfx.cpp
index fc4d48c40a..9ead26bfc4 100644
--- a/engines/pink/objects/actions/action_play_with_sfx.cpp
+++ b/engines/pink/objects/actions/action_play_with_sfx.cpp
@@ -48,6 +48,7 @@ void ActionPlayWithSfx::update() {
_decoder->stop();
_actor->endAction();
}
+
updateSound();
}
@@ -60,6 +61,9 @@ void ActionPlayWithSfx::onStart() {
}
void ActionPlayWithSfx::updateSound() {
+ if (!_actor->isPlaying() && !_isLoop)
+ return;
+
for (int i = 0; i < _sfxArray.size(); ++i) {
if (_sfxArray[i]->getFrame() == _decoder->getCurFrame()) {
_sfxArray[i]->play(_actor->getPage());
@@ -68,6 +72,7 @@ void ActionPlayWithSfx::updateSound() {
}
ActionPlayWithSfx::~ActionPlayWithSfx() {
+ ActionPlay::end();
for (int i = 0; i < _sfxArray.size(); ++i) {
delete _sfxArray[i];
}