aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorwhiterandrek2018-05-11 16:14:34 +0300
committerEugene Sandulenko2018-06-28 23:51:32 +0200
commitc9887c6151f2206ef3a1349b2def5924759b4535 (patch)
tree3dd0f8c089652e7c0e4dacebf86c97fbffcacad7 /engines
parent9f8356e52e25b11d0e842728d2134d5c32e22e3b (diff)
downloadscummvm-rg350-c9887c6151f2206ef3a1349b2def5924759b4535.tar.gz
scummvm-rg350-c9887c6151f2206ef3a1349b2def5924759b4535.tar.bz2
scummvm-rg350-c9887c6151f2206ef3a1349b2def5924759b4535.zip
PINK: added PDAButtonActor and AudioInfoPDAButton
Diffstat (limited to 'engines')
-rw-r--r--engines/pink/archive.cpp8
-rw-r--r--engines/pink/objects/actors/audio_info_pda_button.h54
-rw-r--r--engines/pink/objects/actors/pda_button_actor.cpp43
-rw-r--r--engines/pink/objects/actors/pda_button_actor.h49
4 files changed, 151 insertions, 3 deletions
diff --git a/engines/pink/archive.cpp b/engines/pink/archive.cpp
index ac56b8756b..16f54b715c 100644
--- a/engines/pink/archive.cpp
+++ b/engines/pink/archive.cpp
@@ -45,7 +45,8 @@
#include <engines/pink/objects/actors/cursor_actor.h>
#include <engines/pink/objects/handlers/handler_timer.h>
#include <engines/pink/objects/actors/inventory_actor.h>
-#include "constants.h"
+#include <engines/pink/objects/actors/audio_info_pda_button.h>
+#include <engines/pink/objects/actors/pda_button_actor.h>
namespace Pink {
@@ -128,7 +129,7 @@ static Object* createObject(int objectId){
case kActor:
return new Actor;
case kAudioInfoPDAButton:
- // return new AudioInfoPDAButton;
+ return new AudioInfoPDAButton;
case kConditionGameVariable:
return new ConditionGameVariable;
case kConditionInventoryItemOwner:
@@ -167,7 +168,7 @@ static Object* createObject(int objectId){
case kModuleProxy:
return new ModuleProxy;
case kPDAButtonActor:
- //return new PDAButtonActor;
+ return new PDAButtonActor;
case kParlSqPink:
return new ParlSqPink;
case kPubPink:
@@ -207,6 +208,7 @@ static Object* createObject(int objectId){
case kWalkLocation:
return new WalkLocation;
default:
+ error("Unknown object id");
return nullptr;
}
}
diff --git a/engines/pink/objects/actors/audio_info_pda_button.h b/engines/pink/objects/actors/audio_info_pda_button.h
new file mode 100644
index 0000000000..f869596436
--- /dev/null
+++ b/engines/pink/objects/actors/audio_info_pda_button.h
@@ -0,0 +1,54 @@
+/* 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_AUDIO_INFO_PDA_BUTTON_H
+#define PINK_AUDIO_INFO_PDA_BUTTON_H
+
+#include <common/debug.h>
+#include <pink/objects/actions/action.h>
+#include <engines/pink/constants.h>
+#include <engines/pink/cursor_mgr.h>
+#include "actor.h"
+
+namespace Pink {
+
+class AudioInfoPDAButton : public Actor {
+public:
+ void toConsole() {
+ debug("CursorActor: _name = %s", _name.c_str());
+ for (int i = 0; i < _actions.size(); ++i) {
+ _actions[i]->toConsole();
+ }
+ }
+
+ void onMouseOver(Common::Point point, CursorMgr *mgr) override {
+ mgr->setCursor(kClickableFirstFrameCursor, point, Common::String());
+ }
+
+ void onHover(Common::Point point, const Common::String &itemName, CursorMgr *cursorMgr) override {
+ onMouseOver(point, cursorMgr);
+ }
+};
+
+} // End of namespace Pink
+
+#endif
diff --git a/engines/pink/objects/actors/pda_button_actor.cpp b/engines/pink/objects/actors/pda_button_actor.cpp
new file mode 100644
index 0000000000..8ccaf6063a
--- /dev/null
+++ b/engines/pink/objects/actors/pda_button_actor.cpp
@@ -0,0 +1,43 @@
+/* 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 "pda_button_actor.h"
+#include "pink/archive.h"
+
+namespace Pink {
+
+void PDAButtonActor::deserialize(Archive &archive) {
+ Actor::deserialize(archive);
+ _hideOnStop = (bool) archive.readDWORD();
+ _opaque = (bool) archive.readDWORD();
+
+ int comm = archive.readDWORD();
+ assert(comm <= 4);
+ _command = (Command) comm;
+}
+
+void PDAButtonActor::toConsole() {
+ debug("PDAButtonActor: _name = %s, _x = %u _y = %u _hideOnStop = %u, _opaque = %u, _command = %u",
+ _name.c_str(), _x, _y, _hideOnStop, _opaque, (int) _command);
+}
+
+} // End of namespace Pink \ No newline at end of file
diff --git a/engines/pink/objects/actors/pda_button_actor.h b/engines/pink/objects/actors/pda_button_actor.h
new file mode 100644
index 0000000000..15bf8ae7df
--- /dev/null
+++ b/engines/pink/objects/actors/pda_button_actor.h
@@ -0,0 +1,49 @@
+/* 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_PDA_BUTTON_ACTOR_H
+#define PINK_PDA_BUTTON_ACTOR_H
+
+#include "actor.h"
+
+namespace Pink {
+
+class PDAButtonActor : Actor {
+public:
+ enum Command {Null = 0, GoToPage = 1, Close = 2, Unk = 4};
+
+ void deserialize(Archive &archive) override;
+ void toConsole() override;
+
+private:
+ int _x;
+ int _y;
+
+ bool _hideOnStop;
+ bool _opaque;
+
+ Command _command;
+};
+
+}
+
+#endif