aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2017-11-23 19:20:22 -0500
committerPaul Gilbert2017-11-23 19:20:22 -0500
commit02ffcacacf1cb56c5c770c0302c252186a6189ab (patch)
tree93e4287cd568d333b58623e888ac66377561525a /engines
parent07fe6504a3cd3c969b10ec57ac3b0bdc2ba56de8 (diff)
downloadscummvm-rg350-02ffcacacf1cb56c5c770c0302c252186a6189ab.tar.gz
scummvm-rg350-02ffcacacf1cb56c5c770c0302c252186a6189ab.tar.bz2
scummvm-rg350-02ffcacacf1cb56c5c770c0302c252186a6189ab.zip
XEEN: Fix strafing left & right with Control key held
Diffstat (limited to 'engines')
-rw-r--r--engines/xeen/dialogs.cpp2
-rw-r--r--engines/xeen/events.cpp16
-rw-r--r--engines/xeen/events.h2
3 files changed, 10 insertions, 10 deletions
diff --git a/engines/xeen/dialogs.cpp b/engines/xeen/dialogs.cpp
index 92082b4e0b..a88efd2520 100644
--- a/engines/xeen/dialogs.cpp
+++ b/engines/xeen/dialogs.cpp
@@ -94,7 +94,7 @@ bool ButtonContainer::checkEvents(XeenEngine *vm) {
else if (_buttonValue == Common::KEYCODE_KP_ENTER)
_buttonValue = Common::KEYCODE_RETURN;
- _buttonValue |= (keyState.flags << 8);
+ _buttonValue |= keyState.flags << 16;
if (_buttonValue)
return true;
}
diff --git a/engines/xeen/events.cpp b/engines/xeen/events.cpp
index 55ff24491d..9299eee040 100644
--- a/engines/xeen/events.cpp
+++ b/engines/xeen/events.cpp
@@ -33,9 +33,9 @@ namespace Xeen {
EventsManager::EventsManager(XeenEngine *vm) : _vm(vm),
_frameCounter(0), _priorFrameCounterTime(0), _gameCounter(0),
- _leftButton(false), _rightButton(false), _sprites("mouse.icn"),
- _keyCode(Common::KEYCODE_INVALID) {
+ _leftButton(false), _rightButton(false), _sprites("mouse.icn") {
Common::fill(&_gameCounters[0], &_gameCounters[6], 0);
+ _key.keycode = Common::KEYCODE_INVALID;
}
EventsManager::~EventsManager() {
@@ -81,7 +81,7 @@ void EventsManager::pollEvents() {
_vm->_debugger->attach();
_vm->_debugger->onFrame();
} else {
- _keyCode = event.kbd.keycode;
+ _key = event.kbd;
}
break;
case Common::EVENT_MOUSEMOVE:
@@ -111,7 +111,7 @@ void EventsManager::pollEventsAndWait() {
}
void EventsManager::clearEvents() {
- _keyCode = Common::KEYCODE_INVALID;
+ _key.keycode = Common::KEYCODE_INVALID;
_leftButton = _rightButton = false;
}
@@ -122,17 +122,17 @@ void EventsManager::debounceMouse() {
}
}
bool EventsManager::getKey(Common::KeyState &key) {
- if (_keyCode == Common::KEYCODE_INVALID) {
+ if (_key.keycode == Common::KEYCODE_INVALID) {
return false;
} else {
- key = _keyCode;
- _keyCode = Common::KEYCODE_INVALID;
+ key = _key;
+ _key.keycode = Common::KEYCODE_INVALID;
return true;
}
}
bool EventsManager::isKeyPending() const {
- return _keyCode != Common::KEYCODE_INVALID;
+ return _key.keycode != Common::KEYCODE_INVALID;
}
bool EventsManager::isKeyMousePressed() {
diff --git a/engines/xeen/events.h b/engines/xeen/events.h
index 36ef939004..4ebc36d3f7 100644
--- a/engines/xeen/events.h
+++ b/engines/xeen/events.h
@@ -40,7 +40,7 @@ private:
uint32 _priorFrameCounterTime;
uint32 _gameCounter;
uint32 _gameCounters[6];
- Common::KeyCode _keyCode;
+ Common::KeyState _key;
SpriteResource _sprites;
/**