aboutsummaryrefslogtreecommitdiff
path: root/engines/hugo/parser.cpp
diff options
context:
space:
mode:
authorArnaud Boutonné2010-12-20 17:25:58 +0000
committerArnaud Boutonné2010-12-20 17:25:58 +0000
commit184d56df0ace87d5350ce394691904b00fd27c56 (patch)
tree29c6273aad562166d52582e43508040a4ceeb967 /engines/hugo/parser.cpp
parent26dfb6affabbe3da91934b43819c3a998cd8d125 (diff)
downloadscummvm-rg350-184d56df0ace87d5350ce394691904b00fd27c56.tar.gz
scummvm-rg350-184d56df0ace87d5350ce394691904b00fd27c56.tar.bz2
scummvm-rg350-184d56df0ace87d5350ce394691904b00fd27c56.zip
HUGO: Improve keyboard handling
- Handle keypad - Fix 'QWERTY' only issue - Suppress useless variable and parameter svn-id: r54977
Diffstat (limited to 'engines/hugo/parser.cpp')
-rw-r--r--engines/hugo/parser.cpp75
1 files changed, 0 insertions, 75 deletions
diff --git a/engines/hugo/parser.cpp b/engines/hugo/parser.cpp
index a07fbff319..9836861bca 100644
--- a/engines/hugo/parser.cpp
+++ b/engines/hugo/parser.cpp
@@ -35,9 +35,7 @@
#include "hugo/hugo.h"
#include "hugo/parser.h"
#include "hugo/file.h"
-#include "hugo/display.h"
#include "hugo/schedule.h"
-#include "hugo/route.h"
#include "hugo/util.h"
#include "hugo/sound.h"
#include "hugo/object.h"
@@ -55,79 +53,6 @@ Parser::Parser(HugoEngine *vm) :
Parser::~Parser() {
}
-void Parser::keyHandler(uint16 nChar, uint16 nFlags) {
- debugC(1, kDebugParser, "keyHandler(%d, %d)", nChar, nFlags);
-
- status_t &gameStatus = _vm->getGameStatus();
- bool repeatedFl = (nFlags & 0x4000); // TRUE if key is a repeat
-
-// Process key down event - called from OnKeyDown()
- switch (nChar) { // Set various toggle states
- case Common::KEYCODE_ESCAPE: // Escape key, may want to QUIT
- if (gameStatus.inventoryState == I_ACTIVE) // Remove inventory, if displayed
- gameStatus.inventoryState = I_UP;
- gameStatus.inventoryObjId = -1; // Deselect any dragged icon
- break;
- case Common::KEYCODE_END:
- case Common::KEYCODE_HOME:
- case Common::KEYCODE_LEFT:
- case Common::KEYCODE_RIGHT:
- case Common::KEYCODE_UP:
- case Common::KEYCODE_DOWN:
- if (!repeatedFl) {
- gameStatus.routeIndex = -1; // Stop any automatic route
- _vm->_route->setWalk(nChar); // Direction of hero travel
- }
- break;
- case Common::KEYCODE_F1: // User Help (DOS)
- if (_checkDoubleF1Fl)
- _vm->_file->instructions();
- else
- _vm->_screen->userHelp();
- _checkDoubleF1Fl = !_checkDoubleF1Fl;
- break;
- case Common::KEYCODE_F2: // Toggle sound
- _vm->_sound->toggleSound();
- _vm->_sound->toggleMusic();
- break;
- case Common::KEYCODE_F3: // Repeat last line
- gameStatus.recallFl = true;
- break;
- case Common::KEYCODE_F4: // Save game
- if (gameStatus.viewState == V_PLAY)
- _vm->_file->saveGame(-1, Common::String());
- break;
- case Common::KEYCODE_F5: // Restore game
- _vm->_file->restoreGame(-1);
- _vm->_scheduler->restoreScreen(*_vm->_screen_p);
- gameStatus.viewState = V_PLAY;
- break;
- case Common::KEYCODE_F6: // Inventory
- showDosInventory();
- break;
- case Common::KEYCODE_F8: // Turbo mode
- _config.turboFl = !_config.turboFl;
- break;
- case Common::KEYCODE_F9: // Boss button
- warning("STUB: F9 (DOS) - BossKey");
- break;
- default: // Any other key
- if (!gameStatus.storyModeFl) { // Keyboard disabled
- // Add printable keys to ring buffer
- uint16 bnext = _putIndex + 1;
- if (bnext >= sizeof(_ringBuffer))
- bnext = 0;
- if (bnext != _getIndex) {
- _ringBuffer[_putIndex] = nChar;
- _putIndex = bnext;
- }
- }
- break;
- }
- if (_checkDoubleF1Fl && (nChar != Common::KEYCODE_F1))
- _checkDoubleF1Fl = false;
-}
-
/**
* Add any new chars to line buffer and display them.
* If CR pressed, pass line to LineHandler()