From 4d8bd5958f186a2b7ff3881b5cfbb4c77e0cf103 Mon Sep 17 00:00:00 2001 From: whitertandrek Date: Mon, 19 Mar 2018 21:39:20 +0200 Subject: PINK: added setIdleAction to actor --- engines/pink/actors/actor.cpp | 19 +++++++++++++++++++ engines/pink/actors/actor.h | 9 +++++++-- 2 files changed, 26 insertions(+), 2 deletions(-) (limited to 'engines/pink') diff --git a/engines/pink/actors/actor.cpp b/engines/pink/actors/actor.cpp index c4c9b78a23..d9363b6ea6 100644 --- a/engines/pink/actors/actor.cpp +++ b/engines/pink/actors/actor.cpp @@ -51,4 +51,23 @@ GamePage *Actor::getPage() const { return _page; } +void Actor::setIdleAction(bool unk) { + assert(_action == nullptr); + + uint i; + for (i = 0; i < _actions.size(); ++i) { + if (_action[i].getName() == "Idle") { + _action = _actions[i]; + break; + } + } + if (!_action) { + _isActionEnd = 1; + } + else { + _isActionEnd = 0; + //call action virt method + } +} + } // End of namespace Pink diff --git a/engines/pink/actors/actor.h b/engines/pink/actors/actor.h index 1db59cf287..fd9c25b813 100644 --- a/engines/pink/actors/actor.h +++ b/engines/pink/actors/actor.h @@ -34,7 +34,10 @@ class Sequencer; class Actor : public NamedObject { public: - Actor() {}; + Actor() + : _page(nullptr), _action(nullptr), + _isActionEnd(1) + {}; virtual void deserialize(Archive &archive); Action *findAction(Common::String &name); @@ -42,11 +45,13 @@ public: Sequencer *getSequencer(); GamePage *getPage() const; + void setIdleAction(bool unk); + protected: GamePage *_page; - //int possibly_isActionNotExist; Action *_action; Common::Array _actions; + bool _isActionEnd; }; } // End of namespace Pink -- cgit v1.2.3