diff options
author | Andrei Prykhodko | 2018-08-16 06:32:56 +0300 |
---|---|---|
committer | Andrei Prykhodko | 2018-08-16 06:33:53 +0300 |
commit | d6f2a8948810ed8c7f6d241b7ef194f2ef095d09 (patch) | |
tree | 812e669c2588b7d3b7f16cb4a17dc82e83f83738 /engines/pink/objects/actions | |
parent | 486a63d14f4e93759ded3e1c1506a575224601bf (diff) | |
download | scummvm-rg350-d6f2a8948810ed8c7f6d241b7ef194f2ef095d09.tar.gz scummvm-rg350-d6f2a8948810ed8c7f6d241b7ef194f2ef095d09.tar.bz2 scummvm-rg350-d6f2a8948810ed8c7f6d241b7ef194f2ef095d09.zip |
PINK: fixed original bug when ActionSfx continues to play when it should stop
Diffstat (limited to 'engines/pink/objects/actions')
-rw-r--r-- | engines/pink/objects/actions/action_play_with_sfx.cpp | 12 | ||||
-rw-r--r-- | engines/pink/objects/actions/action_play_with_sfx.h | 3 |
2 files changed, 15 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 0c8aa94c2c..3064215fd3 100644 --- a/engines/pink/objects/actions/action_play_with_sfx.cpp +++ b/engines/pink/objects/actions/action_play_with_sfx.cpp @@ -29,6 +29,8 @@ namespace Pink { +bool g_skipping = false; // FIXME: non-const global var + ActionPlayWithSfx::~ActionPlayWithSfx() { ActionPlay::end(); for (uint i = 0; i < _sfxArray.size(); ++i) { @@ -74,6 +76,12 @@ void ActionPlayWithSfx::onStart() { void ActionPlayWithSfx::end() { ActionCEL::end(); debugC(6, kPinkDebugActions, "ActionPlayWithSfx %s of Actor %s is ended", _name.c_str(), _actor->getName().c_str()); + // original bug fix + if (g_skipping) { + for (uint i = 0; i < _sfxArray.size(); ++i) { + _sfxArray[i]->end(); + } + } } void ActionSfx::deserialize(Pink::Archive &archive) { @@ -97,4 +105,8 @@ void ActionSfx::play() { } } +void ActionSfx::end() { + _sound.stop(); +} + } // End of namespace Pink diff --git a/engines/pink/objects/actions/action_play_with_sfx.h b/engines/pink/objects/actions/action_play_with_sfx.h index 2797604671..16d1855584 100644 --- a/engines/pink/objects/actions/action_play_with_sfx.h +++ b/engines/pink/objects/actions/action_play_with_sfx.h @@ -28,6 +28,8 @@ namespace Pink { +extern bool g_skipping; + class ActionSfx; class ActionPlayWithSfx : public ActionPlay { @@ -61,6 +63,7 @@ public: void toConsole() override; void play(); + void end(); int32 getFrame() { return _frame; } |