From 7c3b128661d4131001c2a5940796c527ab710817 Mon Sep 17 00:00:00 2001 From: Joseph-Eugene Winzer Date: Sun, 26 May 2019 18:15:45 +0200 Subject: SUPERNOVA: Removes optional parameter for getKeyInput() It doesn't serve a purpose anymore. The parameter was used to keep waiting for key input if it was a 'non text editing' event, like pressing the shift modifier key. The only place it was used was for text input when interacting with the computer in ShipSleepCabin. --- engines/supernova/state.cpp | 24 +++--------------------- engines/supernova/state.h | 2 +- 2 files changed, 4 insertions(+), 22 deletions(-) diff --git a/engines/supernova/state.cpp b/engines/supernova/state.cpp index 8d54bd7d61..6600613a35 100644 --- a/engines/supernova/state.cpp +++ b/engines/supernova/state.cpp @@ -1579,29 +1579,11 @@ void GameManager::drawInventory() { } } -uint16 GameManager::getKeyInput(bool blockForPrintChar) { +int GameManager::getKeyInput() { while (!_vm->shouldQuit()) { updateEvents(); if (_keyPressed) { - if (blockForPrintChar) { - if (Common::isPrint(_key.keycode) || - _key.keycode == Common::KEYCODE_BACKSPACE || - _key.keycode == Common::KEYCODE_DELETE || - _key.keycode == Common::KEYCODE_RETURN || - _key.keycode == Common::KEYCODE_SPACE || - _key.keycode == Common::KEYCODE_ESCAPE || - _key.keycode == Common::KEYCODE_UP || - _key.keycode == Common::KEYCODE_DOWN || - _key.keycode == Common::KEYCODE_LEFT || - _key.keycode == Common::KEYCODE_RIGHT) { - if (_key.flags & Common::KBD_SHIFT) - return toupper(_key.ascii); - else - return tolower(_key.ascii); - } - } else { - return _key.ascii; - } + return _key.ascii; } g_system->updateScreen(); g_system->delayMillis(_vm->_delay); @@ -1805,7 +1787,7 @@ void GameManager::edit(Common::String &input, int x, int y, uint length) { _vm->renderBox(_vm->_screen->getTextCursorPos().x, y - 1, 1, 9, kColorWhite99); } - getKeyInput(true); + getKeyInput(); if (_vm->shouldQuit()) break; switch (_key.keycode) { diff --git a/engines/supernova/state.h b/engines/supernova/state.h index c0446705f0..c1712b4149 100644 --- a/engines/supernova/state.h +++ b/engines/supernova/state.h @@ -192,7 +192,7 @@ public: bool airless(); void shock(); Common::EventType getMouseInput(); - uint16 getKeyInput(bool blockForPrintChar = false); + int getKeyInput(); void getInput(); void wait(int ticks); void waitOnInput(int ticks); -- cgit v1.2.3