aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/pink/archive.cpp9
-rw-r--r--engines/pink/handlers/handler.cpp4
-rw-r--r--engines/pink/handlers/handler.h7
-rw-r--r--engines/pink/handlers/handler_sequences.cpp33
-rw-r--r--engines/pink/handlers/handler_sequences.h40
-rw-r--r--engines/pink/handlers/handler_start_page.h3
-rw-r--r--engines/pink/page.cpp2
-rw-r--r--engines/pink/page.h4
-rw-r--r--engines/pink/side_effects/side_effect.cpp25
-rw-r--r--engines/pink/side_effects/side_effect.h38
-rw-r--r--engines/pink/side_effects/side_effect_exit.cpp32
-rw-r--r--engines/pink/side_effects/side_effect_exit.h41
-rw-r--r--engines/pink/side_effects/side_effect_module_variable.cpp22
-rw-r--r--engines/pink/side_effects/side_effect_module_variable.h35
-rw-r--r--engines/pink/side_effects/side_effect_variable.cpp32
-rw-r--r--engines/pink/side_effects/side_effect_variable.h41
16 files changed, 363 insertions, 5 deletions
diff --git a/engines/pink/archive.cpp b/engines/pink/archive.cpp
index 363fedacba..b03cf9148c 100644
--- a/engines/pink/archive.cpp
+++ b/engines/pink/archive.cpp
@@ -30,6 +30,9 @@
#include <engines/pink/sequences/sequence.h>
#include <engines/pink/items/sequence_item_default_action.h>
#include <engines/pink/items/sequence_item_leader.h>
+#include <engines/pink/handlers/handler_start_page.h>
+#include <engines/pink/side_effects/side_effect_exit.h>
+#include <engines/pink/side_effects/side_effect_module_variable.h>
#include "module.h"
#include "page.h"
#include "actors/lead_actor.h"
@@ -161,6 +164,8 @@ static Object* createObject(int objectId){
return new Actor;
case kGamePage:
return new GamePage;
+ case kHandlerStartPage:
+ return new HandlerStartPage;
case kInventoryItem:
return new InventoryItem;
case kLeadActor:
@@ -175,6 +180,10 @@ static Object* createObject(int objectId){
return new SequenceItemDefaultAction;
case kSequenceItemLeader:
return new SequenceItemLeader;
+ case kSideEffectExit:
+ return new SideEffectExit;
+ case kSideEffectModuleVariable:
+ return new SideEffectModuleVariable;
case kWalkLocation:
return new WalkLocation;
default:
diff --git a/engines/pink/handlers/handler.cpp b/engines/pink/handlers/handler.cpp
index e2d35394a7..300071beb7 100644
--- a/engines/pink/handlers/handler.cpp
+++ b/engines/pink/handlers/handler.cpp
@@ -21,11 +21,13 @@
*/
#include "handler.h"
+#include "../archive.h"
namespace Pink {
void Handler::deserialize(Archive &archive) {
-
+ assert(archive.readCount() == 0); // intro has zero conditions, so skip;
+ archive >> _sideEffects;
}
} // End of namespace Pink
diff --git a/engines/pink/handlers/handler.h b/engines/pink/handlers/handler.h
index 803c4f4a06..1acd9adff4 100644
--- a/engines/pink/handlers/handler.h
+++ b/engines/pink/handlers/handler.h
@@ -24,14 +24,19 @@
#define PINK_HANDLER_H
#include <engines/pink/object.h>
+#include <common/array.h>
namespace Pink {
+class SideEffect;
+
class Handler : public Object {
public:
virtual void deserialize(Archive &archive);
+
+private:
//_conditions
- //_sideEffects
+ Common::Array<SideEffect*> _sideEffects;
};
} // End of namespace Pink
diff --git a/engines/pink/handlers/handler_sequences.cpp b/engines/pink/handlers/handler_sequences.cpp
new file mode 100644
index 0000000000..938633876d
--- /dev/null
+++ b/engines/pink/handlers/handler_sequences.cpp
@@ -0,0 +1,33 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "handler_sequences.h"
+#include "../archive.h"
+
+namespace Pink {
+
+void HandlerSequences::deserialize(Archive &archive) {
+ Handler::deserialize(archive);
+ archive >> _sequences;
+}
+
+} // End of namespace Pink \ No newline at end of file
diff --git a/engines/pink/handlers/handler_sequences.h b/engines/pink/handlers/handler_sequences.h
new file mode 100644
index 0000000000..46023ea91c
--- /dev/null
+++ b/engines/pink/handlers/handler_sequences.h
@@ -0,0 +1,40 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+#ifndef PINK_HANDLER_SEQUENCES_H
+#define PINK_HANDLER_SEQUENCES_H
+
+#include <engines/pink/utils.h>
+#include "handler.h"
+
+namespace Pink {
+
+class HandlerSequences : public Handler {
+public:
+ virtual void deserialize(Archive &archive);
+
+private:
+ StringArray _sequences;
+};
+
+} // End of namespace Pink
+
+#endif
diff --git a/engines/pink/handlers/handler_start_page.h b/engines/pink/handlers/handler_start_page.h
index 9e76d367d2..202b320846 100644
--- a/engines/pink/handlers/handler_start_page.h
+++ b/engines/pink/handlers/handler_start_page.h
@@ -24,10 +24,11 @@
#define PINK_HANDLER_START_PAGE_H
#include "handler.h"
+#include "handler_sequences.h"
namespace Pink {
-class HandlerStartPage : public Handler {
+class HandlerStartPage : public HandlerSequences {
};
diff --git a/engines/pink/page.cpp b/engines/pink/page.cpp
index 0bbedac371..411da0b0db 100644
--- a/engines/pink/page.cpp
+++ b/engines/pink/page.cpp
@@ -53,7 +53,7 @@ void GamePage::load(Archive &archive) {
_walkMgr->deserialize(archive);
_sequencer->deserialize(archive);
- //serialize handlers
+ archive >> _handlers;
}
void GamePage::init(bool isLoadingSave) {
diff --git a/engines/pink/page.h b/engines/pink/page.h
index 5ea05bcd99..10dcd4e2ad 100644
--- a/engines/pink/page.h
+++ b/engines/pink/page.h
@@ -54,6 +54,7 @@ protected:
class CursorMgr;
class WalkMgr;
class Sequencer;
+class Handler;
class GamePage : public Page {
public:
@@ -70,12 +71,13 @@ private:
CursorMgr *_cursorMgr;
WalkMgr *_walkMgr;
Sequencer *_sequencer;
+ Common::Array<Handler*> _handlers;
+
/*
int perhaps_notLoaded;
int cunk_1;
int memfile;
CMapStringToString map;
- CObArray handlers;
int unk;
*/
};
diff --git a/engines/pink/side_effects/side_effect.cpp b/engines/pink/side_effects/side_effect.cpp
new file mode 100644
index 0000000000..58d8830ddc
--- /dev/null
+++ b/engines/pink/side_effects/side_effect.cpp
@@ -0,0 +1,25 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+namespace Pink {
+
+} // End of namespace Pink \ No newline at end of file
diff --git a/engines/pink/side_effects/side_effect.h b/engines/pink/side_effects/side_effect.h
new file mode 100644
index 0000000000..628fe1e883
--- /dev/null
+++ b/engines/pink/side_effects/side_effect.h
@@ -0,0 +1,38 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef PINK_SIDE_EFFECT_H
+#define PINK_SIDE_EFFECT_H
+
+#include <engines/pink/object.h>
+
+namespace Pink {
+
+class SideEffect : public Object {
+public:
+
+
+};
+
+}
+
+#endif
diff --git a/engines/pink/side_effects/side_effect_exit.cpp b/engines/pink/side_effects/side_effect_exit.cpp
new file mode 100644
index 0000000000..5232012ea6
--- /dev/null
+++ b/engines/pink/side_effects/side_effect_exit.cpp
@@ -0,0 +1,32 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "side_effect_exit.h"
+#include "../archive.h"
+
+namespace Pink {
+
+void SideEffectExit::deserialize(Archive &archive) {
+ archive >> _nextModule >> _nextPage;
+}
+
+} // End of namespace Pink \ No newline at end of file
diff --git a/engines/pink/side_effects/side_effect_exit.h b/engines/pink/side_effects/side_effect_exit.h
new file mode 100644
index 0000000000..fdcd7cd538
--- /dev/null
+++ b/engines/pink/side_effects/side_effect_exit.h
@@ -0,0 +1,41 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef PINK_SIDE_EFFECT_EXIT_H
+#define PINK_SIDE_EFFECT_EXIT_H
+
+#include "side_effect.h"
+
+namespace Pink {
+
+class SideEffectExit : public SideEffect {
+public:
+ virtual void deserialize(Archive &archive);
+
+private:
+ Common::String _nextModule;
+ Common::String _nextPage;
+};
+
+} // End of namespace Pink
+
+#endif
diff --git a/engines/pink/side_effects/side_effect_module_variable.cpp b/engines/pink/side_effects/side_effect_module_variable.cpp
new file mode 100644
index 0000000000..4972ad00bb
--- /dev/null
+++ b/engines/pink/side_effects/side_effect_module_variable.cpp
@@ -0,0 +1,22 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
diff --git a/engines/pink/side_effects/side_effect_module_variable.h b/engines/pink/side_effects/side_effect_module_variable.h
new file mode 100644
index 0000000000..dc46dedadb
--- /dev/null
+++ b/engines/pink/side_effects/side_effect_module_variable.h
@@ -0,0 +1,35 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+#ifndef PINK_SIDE_EFFECT_MODULE_VARIABLE_H
+#define PINK_SIDE_EFFECT_MODULE_VARIABLE_H
+
+#include "side_effect_variable.h"
+
+namespace Pink {
+
+class SideEffectModuleVariable : public SideEffectVariable {
+
+};
+
+}
+
+#endif \ No newline at end of file
diff --git a/engines/pink/side_effects/side_effect_variable.cpp b/engines/pink/side_effects/side_effect_variable.cpp
new file mode 100644
index 0000000000..17481aa5b9
--- /dev/null
+++ b/engines/pink/side_effects/side_effect_variable.cpp
@@ -0,0 +1,32 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "side_effect_variable.h"
+#include "../archive.h"
+
+namespace Pink {
+
+void SideEffectVariable::deserialize(Pink::Archive &archive) {
+ archive >> _name >> _value;
+}
+
+}
diff --git a/engines/pink/side_effects/side_effect_variable.h b/engines/pink/side_effects/side_effect_variable.h
new file mode 100644
index 0000000000..15d638035e
--- /dev/null
+++ b/engines/pink/side_effects/side_effect_variable.h
@@ -0,0 +1,41 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef PINK_SIDE_EFFECT_VARIABLE_H
+#define PINK_SIDE_EFFECT_VARIABLE_H
+
+#include "side_effect.h"
+
+namespace Pink {
+
+class SideEffectVariable : public SideEffect {
+public:
+ virtual void deserialize(Archive &archive);
+
+private:
+ Common::String _name;
+ Common::String _value;
+};
+
+} // End of namespace Pink
+
+#endif