aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/pink/module.mk28
-rw-r--r--engines/pink/objects/actors/supporting_actor.cpp44
-rw-r--r--engines/pink/objects/actors/supporting_actor.h45
-rw-r--r--engines/pink/objects/handlers/handler_mgr.cpp25
-rw-r--r--engines/pink/objects/handlers/handler_mgr.h49
-rw-r--r--engines/pink/objects/side_effect.h14
6 files changed, 174 insertions, 31 deletions
diff --git a/engines/pink/module.mk b/engines/pink/module.mk
index a78312ad5e..8621fe7d91 100644
--- a/engines/pink/module.mk
+++ b/engines/pink/module.mk
@@ -1,38 +1,40 @@
MODULE := engines/pink
MODULE_OBJS = \
- pink.o \
- console.o \
+ archive.o \
+ console.o \
+ cursor_mgr.o \
detection.o \
director.o \
- sound.o \
file.o \
- archive.o \
- cursor_mgr.o \
+ pink.o \
+ resource_mgr.o \
+ sound.o \
objects/object.o \
objects/module.o \
- objects/pages/page.o \
- objects/pages/game_page.o \
objects/inventory.o \
objects/side_effect.o \
objects/condition.o \
- resource_mgr.o \
objects/actions/action.o \
objects/actions/action_cel.o \
objects/actions/action_hide.o \
objects/actions/action_play.o \
objects/actions/action_sound.o \
objects/actions/action_still.o \
+ objects/actions/walk_action.o \
objects/actors/actor.o \
objects/actors/lead_actor.o \
- objects/walk/walk_mgr.o \
- objects/walk/walk_location.o \
+ objects/actors/supporting_actor.o \
+ objects/handlers/handler.o \
+ objects/handlers/handler_mgr.o \
+ objects/handlers/handler_timer.o \
+ objects/pages/page.o \
+ objects/pages/game_page.o \
objects/sequences/sequence.o \
objects/sequences/sequence_item.o \
objects/sequences/sequencer.o \
- objects/handlers/handler.o \
- objects/handlers/handler_timer.o \
-
+ objects/walk/walk_mgr.o \
+ objects/walk/walk_location.o \
# This module can be built as a plugin
ifeq ($(ENABLE_PLUMBERS), DYNAMIC_PLUGIN)
diff --git a/engines/pink/objects/actors/supporting_actor.cpp b/engines/pink/objects/actors/supporting_actor.cpp
new file mode 100644
index 0000000000..8e023bd7cc
--- /dev/null
+++ b/engines/pink/objects/actors/supporting_actor.cpp
@@ -0,0 +1,44 @@
+/* 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 "supporting_actor.h"
+#include <engines/pink/archive.h>
+#include <engines/pink/objects/actions/action.h>
+#include <common/debug.h>
+
+namespace Pink {
+
+void SupportingActor::deserialize(Archive &archive) {
+ Actor::deserialize(archive);
+ archive >> _location >> _pdaLink >> _cursor;
+ _handlerMgr.deserialize(archive);
+}
+
+void SupportingActor::toConsole() {
+ debug("SupportingActor: _name = %s, _location=%s, _pdaLink=%s, _cursor=%s", _name.c_str());
+ for (int i = 0; i < _actions.size(); ++i) {
+ _actions[i]->toConsole();
+ }
+ _handlerMgr.toConsole();
+}
+
+} // End of namespace Pink \ No newline at end of file
diff --git a/engines/pink/objects/actors/supporting_actor.h b/engines/pink/objects/actors/supporting_actor.h
new file mode 100644
index 0000000000..a9dd69a495
--- /dev/null
+++ b/engines/pink/objects/actors/supporting_actor.h
@@ -0,0 +1,45 @@
+/* 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_SUPPORTING_ACTOR_H
+#define PINK_SUPPORTING_ACTOR_H
+
+#include <engines/pink/objects/handlers/handler_mgr.h>
+#include "actor.h"
+
+namespace Pink {
+
+class SupportingActor : public Actor {
+public:
+ virtual void deserialize(Archive &archive);
+ virtual void toConsole();
+
+private:
+ HandlerMgr _handlerMgr;
+ Common::String _location;
+ Common::String _pdaLink;
+ Common::String _cursor;
+};
+
+} // End of namespace Pink
+
+#endif
diff --git a/engines/pink/objects/handlers/handler_mgr.cpp b/engines/pink/objects/handlers/handler_mgr.cpp
index 9c8d43c0f7..da695b407c 100644
--- a/engines/pink/objects/handlers/handler_mgr.cpp
+++ b/engines/pink/objects/handlers/handler_mgr.cpp
@@ -3,3 +3,28 @@
//
#include "handler_mgr.h"
+#include "handler.h"
+#include "handler_timer.h"
+#include <pink/archive.h>
+#include <common/debug.h>
+
+namespace Pink {
+
+void HandlerMgr::deserialize(Pink::Archive &archive) {
+ archive >> _leftClickHandlers >> _useClickHandlers >> _timerHandlers;
+}
+
+void HandlerMgr::toConsole() {
+ debug("HandlerMgr:");
+ for (int i = 0; i < _leftClickHandlers.size(); ++i) {
+ _leftClickHandlers[i]->toConsole();
+ }
+ for (int i = 0; i < _leftClickHandlers.size(); ++i) {
+ _useClickHandlers[i]->toConsole();
+ }
+ for (int i = 0; i < _leftClickHandlers.size(); ++i) {
+ _timerHandlers[i]->toConsole();
+ }
+}
+
+}
diff --git a/engines/pink/objects/handlers/handler_mgr.h b/engines/pink/objects/handlers/handler_mgr.h
index 978f8d91b3..0de44cf004 100644
--- a/engines/pink/objects/handlers/handler_mgr.h
+++ b/engines/pink/objects/handlers/handler_mgr.h
@@ -1,14 +1,49 @@
-//
-// Created by andrei on 3/21/18.
-//
+/* 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 SCUMMVM_HANDLER_MGR_H
-#define SCUMMVM_HANDLER_MGR_H
+#ifndef PINK_HANDLER_MGR_H
+#define PINK_HANDLER_MGR_H
+#include <engines/pink/objects/object.h>
+#include <common/array.h>
-class HandlerMgr {
+namespace Pink {
+class HandlerLeftClick;
+class HandlerUseClick;
+class HandlerTimer;
+
+class HandlerMgr : public Object {
+public:
+ virtual void deserialize(Archive &archive);
+
+ virtual void toConsole();
+
+private:
+ Common::Array<HandlerLeftClick*> _leftClickHandlers;
+ Common::Array<HandlerUseClick*> _useClickHandlers;
+ Common::Array<HandlerTimer*> _timerHandlers;
};
+}
-#endif //SCUMMVM_HANDLER_MGR_H
+#endif
diff --git a/engines/pink/objects/side_effect.h b/engines/pink/objects/side_effect.h
index 810dd469b6..51342267f9 100644
--- a/engines/pink/objects/side_effect.h
+++ b/engines/pink/objects/side_effect.h
@@ -39,9 +39,7 @@ public:
class SideEffectExit : public SideEffect {
public:
virtual void deserialize(Archive &archive);
-
virtual void toConsole();
-
virtual void execute(LeadActor *actor);
private:
@@ -50,10 +48,9 @@ private:
};
class SideEffectLocation : public SideEffect {
+public:
virtual void deserialize(Archive &archive);
virtual void execute(LeadActor *actor);
-
-public:
virtual void toConsole();
private:
@@ -61,10 +58,9 @@ private:
};
class SideEffectInventoryItemOwner : public SideEffect {
+public:
virtual void deserialize(Archive &archive);
virtual void execute(LeadActor *actor);
-
-public:
virtual void toConsole();
private:
@@ -97,21 +93,17 @@ public:
class SideEffectPageVariable : public SideEffectVariable {
public:
virtual void toConsole();
-
virtual void execute(LeadActor *actor);
};
class SideEffectRandomPageVariable : public SideEffect
{
- virtual void deserialize(Archive &archive);
-
public:
+ virtual void deserialize(Archive &archive);
virtual void toConsole();
private:
virtual void execute(LeadActor *actor);
-
-private:
Common::String _name;
Common::StringArray _values;
};