aboutsummaryrefslogtreecommitdiff
path: root/engines/pink
diff options
context:
space:
mode:
authorwhiterandrek2018-06-03 20:38:39 +0300
committerEugene Sandulenko2018-06-28 23:51:32 +0200
commitf7693d397185f7eb1257a4191c6fb7faf01663e1 (patch)
tree7c97b5bfb435c819b32129c4ac29f67f63812fac /engines/pink
parent44efa90377afaf7131fab50ede322f95c7626e9f (diff)
downloadscummvm-rg350-f7693d397185f7eb1257a4191c6fb7faf01663e1.tar.gz
scummvm-rg350-f7693d397185f7eb1257a4191c6fb7faf01663e1.tar.bz2
scummvm-rg350-f7693d397185f7eb1257a4191c6fb7faf01663e1.zip
PINK: add proper implementation of Actor init function
Diffstat (limited to 'engines/pink')
-rw-r--r--engines/pink/objects/actors/actor.cpp7
-rw-r--r--engines/pink/objects/actors/actor.h2
-rw-r--r--engines/pink/objects/handlers/handler_timer.cpp2
-rw-r--r--engines/pink/objects/walk/walk_mgr.cpp6
4 files changed, 9 insertions, 8 deletions
diff --git a/engines/pink/objects/actors/actor.cpp b/engines/pink/objects/actors/actor.cpp
index 3fb2c4a786..fe44728df0 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 037b42e8b9..6a4d19c117 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 8f6e3a222a..57d217913e 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 0df4a544fc..e1c787d66c 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<ActionCEL*>(_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();