aboutsummaryrefslogtreecommitdiff
path: root/engines/pink/objects/sequences/sequence_item.cpp
diff options
context:
space:
mode:
authorwhiterandrek2018-06-20 11:15:30 +0300
committerEugene Sandulenko2018-06-28 23:51:32 +0200
commite2ac931ccba6f193fa20cd2febb5f919da1b20b2 (patch)
tree0881148f31fc1cec89c67a3ca5c082be3615c251 /engines/pink/objects/sequences/sequence_item.cpp
parentcfc5538f95f5b642c7037eb142999f67d72ca111 (diff)
downloadscummvm-rg350-e2ac931ccba6f193fa20cd2febb5f919da1b20b2.tar.gz
scummvm-rg350-e2ac931ccba6f193fa20cd2febb5f919da1b20b2.tar.bz2
scummvm-rg350-e2ac931ccba6f193fa20cd2febb5f919da1b20b2.zip
PINK: rework scripting system
Diffstat (limited to 'engines/pink/objects/sequences/sequence_item.cpp')
-rw-r--r--engines/pink/objects/sequences/sequence_item.cpp25
1 files changed, 13 insertions, 12 deletions
diff --git a/engines/pink/objects/sequences/sequence_item.cpp b/engines/pink/objects/sequences/sequence_item.cpp
index 72fb452432..ee4094765b 100644
--- a/engines/pink/objects/sequences/sequence_item.cpp
+++ b/engines/pink/objects/sequences/sequence_item.cpp
@@ -42,20 +42,20 @@ void SequenceItem::toConsole() {
debug("\t\t\t\tSequenceItem: _actor=%s, _action=%s", _actor.c_str(), _action.c_str());
}
-bool SequenceItem::execute(int index, Sequence *sequence, bool unk2) {
- Actor *actor;
+bool SequenceItem::execute(uint segment, Sequence *sequence, bool loadingSave) {
+ Actor *actor = sequence->getSequencer()->getPage()->findActor(_actor);
Action *action;
- if (!(actor = sequence->_sequencer->_page->findActor(_actor)) ||
- !(action = actor->findAction(_action)))
+ if (!actor || !(action = actor->findAction(_action)))
return false;
- actor->setAction(action, unk2);
+ actor->setAction(action, loadingSave);
- SequenceActorState *state = sequence->_sequencer->findMainSequenceActorState(_actor);
+ SequenceContext *context = sequence->getContext();
+ SequenceActorState *state = context->findState(_actor);
if (state)
- state->_index = index;
- sequence->_context->_actor = isLeader() ? actor : sequence->_context->_actor;
-
+ state->segment = segment;
+ if (isLeader())
+ context->setActor(actor);
return true;
}
@@ -81,9 +81,10 @@ void SequenceItemLeaderAudio::toConsole() {
debug("\t\t\t\tSequenceItemLeaderAudio: _actor=%s, _action=%s _sample=%d", _actor.c_str(), _action.c_str(), _sample);
}
-bool SequenceItemDefaultAction::execute(int index, Sequence *sequence, bool unk2) {
- SequenceActorState *state = sequence->_sequencer->findMainSequenceActorState(_actor);
- state->_actionName = _action;
+bool SequenceItemDefaultAction::execute(uint segment, Sequence *sequence, bool loadingSave) {
+ SequenceActorState *state = sequence->getContext()->findState(_actor);
+ if (state)
+ state->defaultAction = _action;
return true;
}