aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorwhiterandrek2018-05-25 17:47:27 +0300
committerEugene Sandulenko2018-06-28 23:51:32 +0200
commit578b93af203272e9913adcc4ff793d25ac337e1a (patch)
treeabe1fdedd96744a74dbd083f9514600a6fc19be0 /engines
parent9b5dac452df50deb9b01b8c49b911c7c91a41643 (diff)
downloadscummvm-rg350-578b93af203272e9913adcc4ff793d25ac337e1a.tar.gz
scummvm-rg350-578b93af203272e9913adcc4ff793d25ac337e1a.tar.bz2
scummvm-rg350-578b93af203272e9913adcc4ff793d25ac337e1a.zip
PINK: add state saving/loading of LeadActor
Diffstat (limited to 'engines')
-rw-r--r--engines/pink/objects/actors/lead_actor.cpp29
-rw-r--r--engines/pink/objects/actors/lead_actor.h4
2 files changed, 33 insertions, 0 deletions
diff --git a/engines/pink/objects/actors/lead_actor.cpp b/engines/pink/objects/actors/lead_actor.cpp
index 484871a6e9..9279871f30 100644
--- a/engines/pink/objects/actors/lead_actor.cpp
+++ b/engines/pink/objects/actors/lead_actor.cpp
@@ -312,6 +312,35 @@ bool LeadActor::isInteractingWith(SupportingActor *actor) {
return actor->isUseClickHandlers(_page->getModule()->getInventoryMgr()->getCurrentItem());
}
+void LeadActor::loadState(Archive &archive) {
+ _state = (State) archive.readByte();
+ _nextState = (State) archive.readByte();
+ _stateCopy = (State) archive.readByte();
+ _isHaveItem = archive.readByte();
+ Common::String recepient = archive.readString();
+ if (!recepient.empty())
+ _recipient = (SupportingActor*) _page->findActor(recepient);
+ else
+ _recipient = nullptr;
+ _sequencer->loadState(archive);
+ _walkMgr->loadState(archive);
+
+ // load audioInfoMgr, PDAMgr
+}
+
+void LeadActor::saveState(Archive &archive) {
+ archive.writeByte(_state);
+ archive.writeByte(_nextState);
+ archive.writeByte(_stateCopy);
+ archive.writeByte(_isHaveItem);
+ if (_recipient)
+ archive.writeString(_recipient->getName());
+ else
+ archive.writeString(Common::String());
+ _sequencer->saveState(archive);
+ _walkMgr->saveState(archive);
+}
+
void ParlSqPink::toConsole() {
debug("ParlSqPink: _name = %s", _name.c_str());
for (uint 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 7dff2e86df..d058ec65d4 100644
--- a/engines/pink/objects/actors/lead_actor.h
+++ b/engines/pink/objects/actors/lead_actor.h
@@ -77,6 +77,10 @@ public:
bool isInteractingWith(SupportingActor *actor);
+ virtual void loadState(Archive &archive);
+
+ virtual void saveState(Archive &archive);
+
protected:
virtual void updateCursor(Common::Point point);
void forceUpdateCursor();