diff options
author | whiterandrek | 2018-03-27 19:20:09 +0300 |
---|---|---|
committer | Eugene Sandulenko | 2018-06-28 23:51:32 +0200 |
commit | 7168242832e8bd71e0e2a2617f6e8e6e56e6cd8e (patch) | |
tree | 7f59df4980101eb6df92e4b431b0c9093f1e20cb /engines/pink/objects/actions | |
parent | dbc709a140fc2d01d35dcd3515c45ea9621fe18b (diff) | |
download | scummvm-rg350-7168242832e8bd71e0e2a2617f6e8e6e56e6cd8e.tar.gz scummvm-rg350-7168242832e8bd71e0e2a2617f6e8e6e56e6cd8e.tar.bz2 scummvm-rg350-7168242832e8bd71e0e2a2617f6e8e6e56e6cd8e.zip |
PINK: small fixes and implemented skipping of sequence by buttons
Diffstat (limited to 'engines/pink/objects/actions')
-rw-r--r-- | engines/pink/objects/actions/action_sound.cpp | 19 | ||||
-rw-r--r-- | engines/pink/objects/actions/action_sound.h | 2 |
2 files changed, 15 insertions, 6 deletions
diff --git a/engines/pink/objects/actions/action_sound.cpp b/engines/pink/objects/actions/action_sound.cpp index 42d279553b..44dfda45c7 100644 --- a/engines/pink/objects/actions/action_sound.cpp +++ b/engines/pink/objects/actions/action_sound.cpp @@ -35,6 +35,10 @@ ActionSound::ActionSound() : _sound(nullptr), _isStopped(1) {} +ActionSound::~ActionSound(){ + end(); +} + void ActionSound::deserialize(Archive &archive) { Action::deserialize(archive); archive >> _fileName; @@ -66,14 +70,17 @@ void ActionSound::start(bool unk) { } void ActionSound::end() { - debug("ActionSound %s of Actor %s is ended", _name.c_str(), _actor->getName().c_str()); + if (_sound) { + debug("ActionSound %s of Actor %s is ended", _name.c_str(), _actor->getName().c_str()); - Director *director = _actor->getPage()->getGame()->getDirector(); - director->removeSound(this); + Director *director = _actor->getPage()->getGame()->getDirector(); + director->removeSound(this); + + _sound->stop(); - _sound->stop(); - delete _sound; - _sound = nullptr; + delete _sound; + _sound = nullptr; + } } void ActionSound::update() { diff --git a/engines/pink/objects/actions/action_sound.h b/engines/pink/objects/actions/action_sound.h index e4bb2f1822..3c71da454e 100644 --- a/engines/pink/objects/actions/action_sound.h +++ b/engines/pink/objects/actions/action_sound.h @@ -32,6 +32,8 @@ class Sound; class ActionSound : public Action { public: ActionSound(); + ~ActionSound(); + virtual void deserialize(Archive &archive); virtual void toConsole(); |