diff options
Diffstat (limited to 'engines/pink/objects')
26 files changed, 237 insertions, 34 deletions
diff --git a/engines/pink/objects/actions/action.h b/engines/pink/objects/actions/action.h index f981b523d6..72e9b8f989 100644 --- a/engines/pink/objects/actions/action.h +++ b/engines/pink/objects/actions/action.h @@ -40,6 +40,8 @@ public: virtual bool initPalette(Director *director) { return 0;} + Actor *getActor() { return _actor;} + protected: Actor *_actor; }; diff --git a/engines/pink/objects/actions/action_cel.cpp b/engines/pink/objects/actions/action_cel.cpp index 7436c859fe..938d117015 100644 --- a/engines/pink/objects/actions/action_cel.cpp +++ b/engines/pink/objects/actions/action_cel.cpp @@ -23,6 +23,7 @@ #include <common/debug.h> #include "action_cel.h" #include <pink/objects/actors/actor.h> +#include <graphics/surface.h> #include "engines/pink/archive.h" #include "engines/pink/objects/pages/game_page.h" #include "pink/pink.h" @@ -44,6 +45,7 @@ void ActionCEL::start(bool unk) { if (!_decoder) _decoder = _actor->getPage()->loadCel(_fileName); _actor->getPage()->getGame()->getDirector()->addSprite(this); + this->onStart(); } diff --git a/engines/pink/objects/actions/action_loop.cpp b/engines/pink/objects/actions/action_loop.cpp index 81760c5125..c821fb1530 100644 --- a/engines/pink/objects/actions/action_loop.cpp +++ b/engines/pink/objects/actions/action_loop.cpp @@ -55,7 +55,7 @@ void ActionLoop::update() { // for now it supports only forward loop animation if (_style == kForward) { if (_decoder->endOfVideo()){ - debug("ACTION LOOP : NEXT ITERATION"); + //debug("ACTION LOOP : NEXT ITERATION"); _decoder->rewind(); } } diff --git a/engines/pink/objects/actions/action_play_with_sfx.cpp b/engines/pink/objects/actions/action_play_with_sfx.cpp index 8c8cf6fa9d..fc4d48c40a 100644 --- a/engines/pink/objects/actions/action_play_with_sfx.cpp +++ b/engines/pink/objects/actions/action_play_with_sfx.cpp @@ -93,7 +93,8 @@ void ActionSfx::play(GamePage *page) { if (!_sound) _sound = page->loadSound(_sfxName); - _sound->play(Audio::Mixer::SoundType::kSFXSoundType, _volume, 0); + if (!_sound->isPlaying()) + _sound->play(Audio::Mixer::SoundType::kSFXSoundType, _volume, 0); } ActionSfx::~ActionSfx() { diff --git a/engines/pink/objects/actions/action_play_with_sfx.h b/engines/pink/objects/actions/action_play_with_sfx.h index 020b380a58..c7aab59866 100644 --- a/engines/pink/objects/actions/action_play_with_sfx.h +++ b/engines/pink/objects/actions/action_play_with_sfx.h @@ -31,12 +31,11 @@ namespace Pink { class ActionSfx; class ActionPlayWithSfx : public ActionPlay { +public: virtual ~ActionPlayWithSfx(); virtual void deserialize(Archive &archive); virtual void toConsole(); virtual void update(); - -public: virtual void end(); protected: diff --git a/engines/pink/objects/actors/actor.cpp b/engines/pink/objects/actors/actor.cpp index c6ea1dcb1c..2bd6af4f82 100644 --- a/engines/pink/objects/actors/actor.cpp +++ b/engines/pink/objects/actors/actor.cpp @@ -20,10 +20,12 @@ * */ +#include <engines/pink/constants.h> #include "actor.h" #include "engines/pink/objects/pages/game_page.h" #include "lead_actor.h" #include "engines/pink/objects/actions/action.h" +#include "pink/cursor_mgr.h" namespace Pink { @@ -122,4 +124,14 @@ bool Actor::initPallete(Director *director) { return false; } +void Actor::onMouseOver(Common::Point point, CursorMgr *mgr) { + mgr->setCursor(kDefaultCursor, point); +} + +Actor::~Actor() { + for (int i = 0; i < _actions.size(); ++i) { + delete _actions[i]; + } +} + } // End of namespace Pink diff --git a/engines/pink/objects/actors/actor.h b/engines/pink/objects/actors/actor.h index 1d6fdf4bd4..270ac99914 100644 --- a/engines/pink/objects/actors/actor.h +++ b/engines/pink/objects/actors/actor.h @@ -24,6 +24,7 @@ #define PINK_ACTOR_H #include <common/array.h> +#include <common/rect.h> #include "engines/pink/objects/object.h" namespace Pink { @@ -32,6 +33,7 @@ class GamePage; class Action; class Sequencer; class Director; +class CursorMgr; class Actor : public NamedObject { public: @@ -39,6 +41,7 @@ public: : _page(nullptr), _action(nullptr), _isActionEnded(1) {}; + ~Actor(); virtual void deserialize(Archive &archive); virtual void toConsole(); @@ -61,6 +64,9 @@ public: virtual void update() {}; + virtual void onMouseOver(Common::Point point, CursorMgr *mgr); + + virtual bool isClickable() { return 0;} protected: GamePage *_page; Action *_action; diff --git a/engines/pink/objects/actors/lead_actor.cpp b/engines/pink/objects/actors/lead_actor.cpp index be7dfbe879..e26b50a42c 100644 --- a/engines/pink/objects/actors/lead_actor.cpp +++ b/engines/pink/objects/actors/lead_actor.cpp @@ -29,13 +29,13 @@ #include "engines/pink/archive.h" #include "engines/pink/objects/pages/game_page.h" #include "engines/pink/pink.h" +#include "supporting_actor.h" namespace Pink { void LeadActor::deserialize(Archive &archive) { _state = kReady; Actor::deserialize(archive); - _state = kReady; _cursorMgr = static_cast<CursorMgr*>(archive.readObject()); _walkMgr = static_cast<WalkMgr*>(archive.readObject()); _sequencer = static_cast<Sequencer*>(archive.readObject()); @@ -70,18 +70,36 @@ LeadActor::State LeadActor::getState() const { void LeadActor::update() { switch (_state) { + case kReady: + + _sequencer->update(); + //fall-through intended + case kMoving: + + _cursorMgr->update(); + break; + case kInDialog1: + case kInDialog2: + _sequencer->update(); + break; + + case kInventory: + case kPDA: + break; + case kPlayingVideo: _sequencer->update(); if (!_sequencer->_context){ _state = kUnk_Loading; _page->getGame()->changeScene(_page); } - default: + break; + case kUnk_Loading: break; } } -void LeadActor::OnKeyboardButtonClick(Common::KeyCode code) { +void LeadActor::onKeyboardButtonClick(Common::KeyCode code) { switch(_state) { case kMoving: switch (code){ @@ -116,6 +134,73 @@ void LeadActor::OnKeyboardButtonClick(Common::KeyCode code) { } } +void LeadActor::start(bool isHandler) { + if (isHandler && _state != kPlayingVideo){ + _state = kReady; + } + updateCursor({0,0}); +} + +void LeadActor::onMouseMove(Common::Point point) { + if (_state != kPDA) + updateCursor(point); + else error("pda is not supported"); +} + +void LeadActor::updateCursor(Common::Point point) { + switch (_state) { + case kReady: + case kMoving: { + Director *director = _page->getGame()->getDirector(); + Actor *actor = director->getActorByPoint(point); + if (actor) + actor->onMouseOver(point, _cursorMgr); + else _cursorMgr->setCursor(kDefaultCursor, point); + break; + } + case kInDialog1: + case kInDialog2: + case kPlayingVideo: + _cursorMgr->setCursor(kNotClickableCursor, point); + break; + case kPDA: + case kInventory: + _cursorMgr->setCursor(kDefaultCursor, point); + break; + default: + break; + } +} + +void LeadActor::onLeftButtonClick(Common::Point point) { + switch (_state) { + case kReady: + case kMoving: { + Actor *actor = _page->getGame()->getDirector()->getActorByPoint(point); + if (this == actor){ + // inventory is not implemented + return; + } + + if (actor->isClickable() && + ((SupportingActor*) actor)->isLeftClickHandlers()) + + + + + break; + } + case kPDA: + + break; + case kInventory: + + break; + default: + break; + } +} + void ParlSqPink::toConsole() { debug("ParlSqPink: _name = %s", _name.c_str()); for (int i = 0; i < _actions.size(); ++i) { diff --git a/engines/pink/objects/actors/lead_actor.h b/engines/pink/objects/actors/lead_actor.h index 4e17bf285a..3a64893991 100644 --- a/engines/pink/objects/actors/lead_actor.h +++ b/engines/pink/objects/actors/lead_actor.h @@ -24,6 +24,7 @@ #define PINK_LEAD_ACTOR_H #include <common/keyboard.h> +#include <common/rect.h> #include "actor.h" namespace Pink { @@ -58,8 +59,14 @@ public: void start(bool isHandler); void update(); - void OnKeyboardButtonClick(Common::KeyCode code); + void onKeyboardButtonClick(Common::KeyCode code); + void onLeftButtonClick(Common::Point point); + void onMouseMove(Common::Point point); + private: + void updateCursor(Common::Point point); + + State _state; CursorMgr *_cursorMgr; WalkMgr *_walkMgr; diff --git a/engines/pink/objects/actors/supporting_actor.cpp b/engines/pink/objects/actors/supporting_actor.cpp index 2cffbf16ce..a7e1b79954 100644 --- a/engines/pink/objects/actors/supporting_actor.cpp +++ b/engines/pink/objects/actors/supporting_actor.cpp @@ -23,7 +23,8 @@ #include "supporting_actor.h" #include <engines/pink/archive.h> #include <engines/pink/objects/actions/action.h> -#include <common/debug.h> +#include <engines/pink/constants.h> +#include "pink/cursor_mgr.h" namespace Pink { @@ -42,4 +43,18 @@ void SupportingActor::toConsole() { _handlerMgr.toConsole(); } +void SupportingActor::onMouseOver(Common::Point point, CursorMgr *mgr) { + if (isLeftClickHandlers()){ + if (!_cursor.empty()){ + mgr->setCursor(_cursor, point); + } + else mgr->setCursor(kClickableFirstFrameCursor, point); + } + else Actor::onMouseOver(point, mgr); +} + +bool SupportingActor::isLeftClickHandlers() { + return _handlerMgr.isLeftClickHandler(this); +} + } // End of namespace Pink
\ No newline at end of file diff --git a/engines/pink/objects/actors/supporting_actor.h b/engines/pink/objects/actors/supporting_actor.h index a9dd69a495..bfee083dbd 100644 --- a/engines/pink/objects/actors/supporting_actor.h +++ b/engines/pink/objects/actors/supporting_actor.h @@ -33,6 +33,11 @@ public: virtual void deserialize(Archive &archive); virtual void toConsole(); + virtual void onMouseOver(Common::Point point, CursorMgr *mgr); + + virtual bool isClickable() { return 1; } + bool isLeftClickHandlers(); + private: HandlerMgr _handlerMgr; Common::String _location; diff --git a/engines/pink/objects/condition.cpp b/engines/pink/objects/condition.cpp index 71a68d4f3a..b0e093817e 100644 --- a/engines/pink/objects/condition.cpp +++ b/engines/pink/objects/condition.cpp @@ -32,7 +32,7 @@ void Pink::ConditionVariable::deserialize(Archive &archive) { archive >> _name >> _value; } -bool Pink::ConditionGameVariable::evaluate(LeadActor *leadActor) { +bool Pink::ConditionGameVariable::evaluate(Actor *leadActor) { return leadActor->getPage()->getModule()->getGame()->checkValueOfVariable(_name, _value); } @@ -40,7 +40,7 @@ void ConditionGameVariable::toConsole() { debug("\t\tConditionGameVariable: _name=%s, _value=%s", _name.c_str(), _value.c_str()); } -bool Pink::ConditionModuleVariable::evaluate(LeadActor *leadActor) { +bool Pink::ConditionModuleVariable::evaluate(Actor *leadActor) { return leadActor->getPage()->getModule()->checkValueOfVariable(_name, _value); } @@ -48,7 +48,7 @@ void ConditionModuleVariable::toConsole() { debug("\t\tConditionModuleVariable: _name=%s, _value=%s", _name.c_str(), _value.c_str()); } -bool Pink::ConditionNotModuleVariable::evaluate(LeadActor *leadActor) { +bool Pink::ConditionNotModuleVariable::evaluate(Actor *leadActor) { return !ConditionModuleVariable::evaluate(leadActor); } @@ -56,7 +56,7 @@ void ConditionNotModuleVariable::toConsole() { debug("\t\tConditionNotModuleVariable: _name=%s, _value=%s", _name.c_str(), _value.c_str()); } -bool ConditionPageVariable::evaluate(LeadActor *leadActor) { +bool ConditionPageVariable::evaluate(Actor *leadActor) { return leadActor->getPage()->checkValueOfVariable(_name, _value); } @@ -64,7 +64,7 @@ void ConditionPageVariable::toConsole() { debug("\t\tConditionPageVariable: _name=%s, _value=%s", _name.c_str(), _value.c_str()); } -bool ConditionNotPageVariable::evaluate(LeadActor *leadActor) { +bool ConditionNotPageVariable::evaluate(Actor *leadActor) { return !ConditionPageVariable::evaluate(leadActor); } @@ -76,7 +76,7 @@ void ConditionInventoryItemOwner::deserialize(Archive &archive) { archive >> _item >> _owner; } -bool ConditionInventoryItemOwner::evaluate(LeadActor *leadActor) { +bool ConditionInventoryItemOwner::evaluate(Actor *leadActor) { InventoryMgr *mgr = leadActor->getPage()->getModule()->getInventoryMgr(); InventoryItem *item = mgr->findInventoryItem(_item); return item->getCurrentOwner() == _owner; @@ -86,7 +86,7 @@ void ConditionInventoryItemOwner::toConsole() { debug("\t\tConditionInventoryItemOwner: _item=%s, _owner=%s", _item.c_str(), _owner.c_str()); } -bool ConditionNotInventoryItemOwner::evaluate(LeadActor *leadActor) { +bool ConditionNotInventoryItemOwner::evaluate(Actor *leadActor) { return !ConditionInventoryItemOwner::evaluate(leadActor); } diff --git a/engines/pink/objects/condition.h b/engines/pink/objects/condition.h index 6df1920046..3ab1ff0b50 100644 --- a/engines/pink/objects/condition.h +++ b/engines/pink/objects/condition.h @@ -32,14 +32,14 @@ class LeadActor; class Condition : public Object { public: virtual void deserialize(Archive &archive) = 0; - virtual bool evaluate(LeadActor *leadActor) = 0; + virtual bool evaluate(Actor *leadActor) = 0; }; class ConditionVariable : public Condition { public: virtual void deserialize(Archive &archive); - virtual bool evaluate(LeadActor *leadActor) = 0; + virtual bool evaluate(Actor *actor) = 0; protected: Common::String _name; @@ -49,7 +49,7 @@ protected: class ConditionGameVariable : public ConditionVariable { public: virtual void toConsole(); - virtual bool evaluate(LeadActor *leadActor); + virtual bool evaluate(Actor *actor); }; /* @@ -62,32 +62,32 @@ class ConditionNotGameVariable : public ConditionGameVariable { class ConditionModuleVariable : public ConditionVariable { public: virtual void toConsole(); - virtual bool evaluate(LeadActor *leadActor); + virtual bool evaluate(Actor *actor); }; class ConditionNotModuleVariable : public ConditionModuleVariable { public: virtual void toConsole(); - virtual bool evaluate(LeadActor *leadActor); + virtual bool evaluate(Actor *actor); }; class ConditionPageVariable : public ConditionVariable { public: virtual void toConsole(); - virtual bool evaluate(LeadActor *leadActor); + virtual bool evaluate(Actor *actor); }; class ConditionNotPageVariable : public ConditionPageVariable { public: virtual void toConsole(); - virtual bool evaluate(LeadActor *leadActor); + virtual bool evaluate(Actor *actor); }; class ConditionInventoryItemOwner : public Condition { public: virtual void toConsole(); virtual void deserialize(Archive &archive); - virtual bool evaluate(LeadActor *leadActor); + virtual bool evaluate(Actor *actor); protected: Common::String _item; @@ -97,7 +97,7 @@ protected: class ConditionNotInventoryItemOwner : public ConditionInventoryItemOwner { public: virtual void toConsole(); - virtual bool evaluate(LeadActor *leadActor); + virtual bool evaluate(Actor *actor); }; } // End of namespace Pink diff --git a/engines/pink/objects/handlers/handler.cpp b/engines/pink/objects/handlers/handler.cpp index a848cfd98e..8916bc0b3b 100644 --- a/engines/pink/objects/handlers/handler.cpp +++ b/engines/pink/objects/handlers/handler.cpp @@ -37,7 +37,7 @@ void Handler::deserialize(Archive &archive) { archive >> _sideEffects; } -bool Handler::isSuitable(LeadActor *actor) { +bool Handler::isSuitable(Actor *actor) { for (int i = 0; i < _conditions.size(); ++i) { if (!_conditions[i]->evaluate(actor)){ return false; @@ -56,6 +56,15 @@ void Handler::onMessage(LeadActor *actor) { executeSideEffects(actor); } +Handler::~Handler() { + for (int i = 0; i < _sideEffects.size(); ++i) { + delete _sideEffects[i]; + } + for (int i = 0; i < _conditions.size(); ++i) { + delete _conditions[i]; + } +} + void HandlerSequences::deserialize(Archive &archive) { Handler::deserialize(archive); archive >> _sequences; diff --git a/engines/pink/objects/handlers/handler.h b/engines/pink/objects/handlers/handler.h index b2e5fcf2d7..ed42ed7cde 100644 --- a/engines/pink/objects/handlers/handler.h +++ b/engines/pink/objects/handlers/handler.h @@ -33,12 +33,14 @@ namespace Pink { class Condition; class SideEffect; class LeadActor; +class Actor; class Handler : public Object { public: + ~Handler(); virtual void deserialize(Archive &archive); virtual void onMessage(LeadActor *actor); - bool isSuitable(LeadActor *actor); + bool isSuitable(Actor *actor); protected: void executeSideEffects(LeadActor *actor); diff --git a/engines/pink/objects/handlers/handler_mgr.cpp b/engines/pink/objects/handlers/handler_mgr.cpp index 6e7755a804..83236de6a1 100644 --- a/engines/pink/objects/handlers/handler_mgr.cpp +++ b/engines/pink/objects/handlers/handler_mgr.cpp @@ -27,4 +27,13 @@ void HandlerMgr::toConsole() { } } +bool HandlerMgr::isLeftClickHandler(Actor *actor) { + for (int i = 0; i < _leftClickHandlers.size(); ++i) { + if (_leftClickHandlers[i]->isSuitable(actor)) + return true; + } + + return false; +} + } diff --git a/engines/pink/objects/handlers/handler_mgr.h b/engines/pink/objects/handlers/handler_mgr.h index 0de44cf004..f939d592da 100644 --- a/engines/pink/objects/handlers/handler_mgr.h +++ b/engines/pink/objects/handlers/handler_mgr.h @@ -31,6 +31,7 @@ namespace Pink { class HandlerLeftClick; class HandlerUseClick; class HandlerTimer; +class Actor; class HandlerMgr : public Object { public: @@ -38,6 +39,8 @@ public: virtual void toConsole(); + bool isLeftClickHandler(Actor *actor); + private: Common::Array<HandlerLeftClick*> _leftClickHandlers; Common::Array<HandlerUseClick*> _useClickHandlers; diff --git a/engines/pink/objects/module.cpp b/engines/pink/objects/module.cpp index a8166dee43..f7b6adda87 100644 --- a/engines/pink/objects/module.cpp +++ b/engines/pink/objects/module.cpp @@ -93,6 +93,12 @@ InventoryMgr *Module::getInventoryMgr() { return &_invMgr; } +Module::~Module() { + for (int i = 0; i < _pages.size(); ++i) { + delete _pages[i]; + } +} + } // End of namespace Pink diff --git a/engines/pink/objects/module.h b/engines/pink/objects/module.h index 959f886a83..2824191dcd 100644 --- a/engines/pink/objects/module.h +++ b/engines/pink/objects/module.h @@ -43,6 +43,7 @@ class GamePage; class Module : public NamedObject { public: Module(PinkEngine *game, const Common::String &name); + ~Module(); void load(Archive &archive); void init(bool isLoadingSave, const Common::String &pageName); diff --git a/engines/pink/objects/pages/game_page.cpp b/engines/pink/objects/pages/game_page.cpp index 5ff7f0bdc3..6a90b4887b 100644 --- a/engines/pink/objects/pages/game_page.cpp +++ b/engines/pink/objects/pages/game_page.cpp @@ -77,7 +77,7 @@ void GamePage::init(bool isLoadingSave) { isHandler = initHandler(); } - //_leadActor->start(isHandler); + _leadActor->start(isHandler); } bool GamePage::initHandler() { @@ -92,7 +92,7 @@ bool GamePage::initHandler() { void GamePage::loadManagers() { perhapsIsLoaded = true; - _cursorMgr = new CursorMgr(this); + _cursorMgr = new CursorMgr(_module->getGame(), this); _walkMgr = new WalkMgr; _sequencer = new Sequencer(this); @@ -137,4 +137,19 @@ void GamePage::toConsole() { } } +GamePage::~GamePage() { + delete _cursorMgr; + delete _walkMgr; + delete _sequencer; + for (int i = 0; i < _handlers.size(); ++i) { + delete _handlers[i]; + } +} + +GamePage::GamePage() + : _cursorMgr(nullptr), _walkMgr(nullptr), _sequencer(nullptr) +{ + +} + } // End of namespace Pink
\ No newline at end of file diff --git a/engines/pink/objects/pages/game_page.h b/engines/pink/objects/pages/game_page.h index 94bff54200..705fb32e22 100644 --- a/engines/pink/objects/pages/game_page.h +++ b/engines/pink/objects/pages/game_page.h @@ -34,6 +34,8 @@ class HandlerStartPage; class GamePage : public Page { public: + GamePage(); + ~GamePage(); virtual void deserialize(Archive &archive); virtual void load(Archive &archive); diff --git a/engines/pink/objects/pages/page.cpp b/engines/pink/objects/pages/page.cpp index a57860e11d..a579d19d5f 100644 --- a/engines/pink/objects/pages/page.cpp +++ b/engines/pink/objects/pages/page.cpp @@ -65,4 +65,10 @@ void Page::init() { } } +Page::~Page() { + for (int i = 0; i < _actors.size(); ++i) { + delete _actors[i]; + } +} + } // End of namespace Pink diff --git a/engines/pink/objects/pages/page.h b/engines/pink/objects/pages/page.h index 282d061f1e..81a49db9f6 100644 --- a/engines/pink/objects/pages/page.h +++ b/engines/pink/objects/pages/page.h @@ -36,7 +36,7 @@ class LeadActor; class Page : public NamedObject { public: - + ~Page(); void load(Archive &archive); Actor *findActor(Common::String &name); Sound* loadSound(Common::String &fileName); diff --git a/engines/pink/objects/sequences/sequence.cpp b/engines/pink/objects/sequences/sequence.cpp index 2071683681..098330bf03 100644 --- a/engines/pink/objects/sequences/sequence.cpp +++ b/engines/pink/objects/sequences/sequence.cpp @@ -134,6 +134,11 @@ void Sequence::skipItemsTo(int index) { } } +void Sequence::skipSubSequence() { + if (_context->getNextItemIndex() < _context->getSequence()->getItems().size()) + _context->getSequence()->start(0); +} + void SequenceAudio::deserialize(Archive &archive) { Sequence::deserialize(archive); archive >> _soundName; @@ -182,4 +187,8 @@ void SequenceAudio::restart() { Sequence::restart(); } +void SequenceAudio::skipToLastSubSequence() { + end(); +} + } // End of namespace Pink
\ No newline at end of file diff --git a/engines/pink/objects/sequences/sequence.h b/engines/pink/objects/sequences/sequence.h index e4695f2088..5db00b4920 100644 --- a/engines/pink/objects/sequences/sequence.h +++ b/engines/pink/objects/sequences/sequence.h @@ -49,9 +49,11 @@ public: virtual void update(); virtual void restart(); - void skipToLastSubSequence(); + virtual void skipSubSequence(); + virtual void skipToLastSubSequence(); void skipItemsTo(int index); + public: SequenceContext *_context; Sequencer *_sequencer; @@ -69,9 +71,13 @@ public: virtual void init(int unk); virtual void start(int unk); virtual void end(); + virtual void update(); virtual void restart(); + virtual void skipSubSequence() {}; + virtual void skipToLastSubSequence(); + private: Common::String _soundName; Sound *_sound; diff --git a/engines/pink/objects/sequences/sequencer.cpp b/engines/pink/objects/sequences/sequencer.cpp index 057603a790..871a2e2621 100644 --- a/engines/pink/objects/sequences/sequencer.cpp +++ b/engines/pink/objects/sequences/sequencer.cpp @@ -73,7 +73,8 @@ void Sequencer::toConsole() { } void Sequencer::update() { - _context->_sequence->update(); + if (_context) + _context->_sequence->update(); } void Sequencer::removeContext(SequenceContext *context) { @@ -82,8 +83,8 @@ void Sequencer::removeContext(SequenceContext *context) { } void Sequencer::skipSubSequence() { - if (_context && _context->getNextItemIndex() < _context->getSequence()->getItems().size()) - _context->getSequence()->start(0); + if (_context) + _context->getSequence()->skipSubSequence(); } void Sequencer::restartSequence() { |