From f7693d397185f7eb1257a4191c6fb7faf01663e1 Mon Sep 17 00:00:00 2001 From: whiterandrek Date: Sun, 3 Jun 2018 20:38:39 +0300 Subject: [PATCH] PINK: add proper implementation of Actor init function --- engines/pink/objects/actors/actor.cpp | 7 ++++--- engines/pink/objects/actors/actor.h | 2 +- engines/pink/objects/handlers/handler_timer.cpp | 2 +- engines/pink/objects/walk/walk_mgr.cpp | 6 +++--- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/engines/pink/objects/actors/actor.cpp b/engines/pink/objects/actors/actor.cpp index 3fb2c4a7860..fe44728df0a 100644 --- a/engines/pink/objects/actors/actor.cpp +++ b/engines/pink/objects/actors/actor.cpp @@ -58,7 +58,7 @@ void Actor::saveState(Archive &archive) { archive.writeString(actionName); } -void Actor::init(bool unk) { +void Actor::init(bool paused) { if (!_action) _action = findAction(kIdleAction); @@ -66,7 +66,8 @@ void Actor::init(bool unk) { _isActionEnded = 1; } else { _isActionEnded = 0; - _action->start(unk); + _action->start(); + _action->pause(paused); } } @@ -168,7 +169,7 @@ void Actor::setAction(Action *newAction) { _action = newAction; if (newAction) { _isActionEnded = 0; - _action->start(0); + _action->start(); } } diff --git a/engines/pink/objects/actors/actor.h b/engines/pink/objects/actors/actor.h index 037b42e8b97..6a4d19c1176 100644 --- a/engines/pink/objects/actors/actor.h +++ b/engines/pink/objects/actors/actor.h @@ -47,7 +47,7 @@ public: void loadState(Archive &archive); void saveState(Archive &archive); - virtual void init(bool unk); + virtual void init(bool paused); bool initPallete(Director *director); void toConsole() override ; diff --git a/engines/pink/objects/handlers/handler_timer.cpp b/engines/pink/objects/handlers/handler_timer.cpp index 8f6e3a222a8..57d217913e2 100644 --- a/engines/pink/objects/handlers/handler_timer.cpp +++ b/engines/pink/objects/handlers/handler_timer.cpp @@ -65,7 +65,7 @@ void HandlerTimerActions::handle(Actor *actor) { uint index = rnd.getRandomNumber(_actions.size() - 1); Action *action = actor->findAction(_actions[index]); assert(action); - actor->setAction(action, 0); + actor->setAction(action); } } diff --git a/engines/pink/objects/walk/walk_mgr.cpp b/engines/pink/objects/walk/walk_mgr.cpp index 0df4a544fca..e1c787d66cb 100644 --- a/engines/pink/objects/walk/walk_mgr.cpp +++ b/engines/pink/objects/walk/walk_mgr.cpp @@ -71,7 +71,7 @@ void WalkMgr::start(WalkLocation *destination) { WalkShortestPath path(this); WalkLocation *nextLocation = path.next(currentLocation, _destination); initNextWayPoint(nextLocation); - _leadActor->setAction(getWalkAction(), 0); + _leadActor->setAction(getWalkAction()); } } @@ -106,7 +106,7 @@ WalkMgr::Coordinates WalkMgr::getLocationCoordinates(const Common::String &locat Coordinates coords; ActionCEL *action = static_cast(_leadActor->findAction(locationName)); - action->start(0); + action->start(); CelDecoder *decoder = action->getDecoder(); coords.x = decoder->getX() + decoder->getWidth() / 2; @@ -132,7 +132,7 @@ void WalkMgr::update() { WalkLocation *next = path.next(findLocation(_current.name), _destination); if (next) { initNextWayPoint(next); - _leadActor->setAction(getWalkAction(), 0); + _leadActor->setAction(getWalkAction()); } else end();