aboutsummaryrefslogtreecommitdiff
path: root/engines/illusions/bbdou/bbdou_menukeys.cpp
diff options
context:
space:
mode:
authorjohndoe1232018-05-18 21:15:33 +1000
committerEugene Sandulenko2018-07-20 06:43:33 +0000
commit94fdd597d985cba1436aea7c6be67982de220199 (patch)
tree22c0dd9e3a012c688f8f054993e6413f7657fff0 /engines/illusions/bbdou/bbdou_menukeys.cpp
parent54dd3814414d7ef5de09cda197b1065655ee9242 (diff)
downloadscummvm-rg350-94fdd597d985cba1436aea7c6be67982de220199.tar.gz
scummvm-rg350-94fdd597d985cba1436aea7c6be67982de220199.tar.bz2
scummvm-rg350-94fdd597d985cba1436aea7c6be67982de220199.zip
ILLUSIONS: BBDOU: Add menu system class, adjust existing code (actual menus not done yet)
(cherry picked from commit 03b0ca1)
Diffstat (limited to 'engines/illusions/bbdou/bbdou_menukeys.cpp')
-rw-r--r--engines/illusions/bbdou/bbdou_menukeys.cpp60
1 files changed, 60 insertions, 0 deletions
diff --git a/engines/illusions/bbdou/bbdou_menukeys.cpp b/engines/illusions/bbdou/bbdou_menukeys.cpp
new file mode 100644
index 0000000000..aadd9fec35
--- /dev/null
+++ b/engines/illusions/bbdou/bbdou_menukeys.cpp
@@ -0,0 +1,60 @@
+/* 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 "illusions/bbdou/illusions_bbdou.h"
+#include "illusions/bbdou/bbdou_menukeys.h"
+#include "illusions/bbdou/menusystem_bbdou.h"
+#include "illusions/input.h"
+#include "illusions/screen.h"
+
+namespace Illusions {
+
+// BBDOUMenuKeys
+
+BBDOUMenuKeys::BBDOUMenuKeys(IllusionsEngine_BBDOU *vm)
+ : _vm(vm) {
+}
+
+BBDOUMenuKeys::~BBDOUMenuKeys() {
+
+}
+
+void BBDOUMenuKeys::addMenuKey(uint bitMask, uint32 threadId) {
+ MenuKey menuKey;
+ menuKey.bitMask = bitMask;
+ menuKey.threadId = threadId;
+ _menuKeys.push_back(menuKey);
+}
+
+void BBDOUMenuKeys::update() {
+ if (_vm->_screen->isDisplayOn() && !_vm->_menuSystem->isActive()) {
+ for (MenuKeys::iterator it = _menuKeys.begin(); it != _menuKeys.end(); ++it) {
+ const MenuKey &menuKey = *it;
+ if (_vm->_input->pollButton(menuKey.bitMask)) {
+ _vm->startScriptThread(menuKey.threadId, 0, 0, 0, 0);
+ break;
+ }
+ }
+ }
+}
+
+} // End of namespace Illusions