aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph-Eugene Winzer2017-08-30 22:38:34 +0200
committerThierry Crozat2018-01-23 02:01:00 +0000
commit7f513ac1db35a3cc76d9193b01d89974066ddfb9 (patch)
treee28a2071a13f83d48145441e2e4707b1394fc011
parenta334a4730dca4ac0085c61c639bb30ba6b4fb9bb (diff)
downloadscummvm-rg350-7f513ac1db35a3cc76d9193b01d89974066ddfb9.tar.gz
scummvm-rg350-7f513ac1db35a3cc76d9193b01d89974066ddfb9.tar.bz2
scummvm-rg350-7f513ac1db35a3cc76d9193b01d89974066ddfb9.zip
SUPERNOVA: Adds key input check function
This is temporary. Input is all over the place right now I feel, so it will be reworked 'soon'.
-rw-r--r--engines/supernova/state.cpp8
-rw-r--r--engines/supernova/state.h2
2 files changed, 10 insertions, 0 deletions
diff --git a/engines/supernova/state.cpp b/engines/supernova/state.cpp
index 0cf8441521..5fc764fc69 100644
--- a/engines/supernova/state.cpp
+++ b/engines/supernova/state.cpp
@@ -464,6 +464,14 @@ void GameManager::resetInputState() {
processInput();
}
+bool GameManager::keyPressed(Common::KeyCode keycode, bool equal) {
+ bool ret = _key.keycode == keycode;
+ _key.reset();
+
+ return equal ? ret : !ret;
+}
+
+
void GameManager::processInput() {
if (_mouseClickType == Common::EVENT_LBUTTONUP) {
_vm->removeMessage();
diff --git a/engines/supernova/state.h b/engines/supernova/state.h
index e50ef3bae2..72aad4cb53 100644
--- a/engines/supernova/state.h
+++ b/engines/supernova/state.h
@@ -24,6 +24,7 @@
#define STATE_H
#include "common/rect.h"
+#include "common/keyboard.h"
#include "supernova/rooms.h"
namespace Supernova {
@@ -146,6 +147,7 @@ public:
Common::EventType getMouseInput();
uint16 getKeyInput(bool blockForPrintChar = false);
void getInput();
+ bool keyPressed(Common::KeyCode keycode, bool equal);
void mouseInput3();
void mouseWait(int delay);
void wait2(int ticks);