aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2010-06-17 23:12:38 +0000
committerMax Horn2010-06-17 23:12:38 +0000
commit69fb7032460e7874d12d8f07bcc436eb0bbab18d (patch)
tree1c3d79387854fe2a7b9c89bf81888260c4346f21
parent2556ea192cac369f86d1b237335ae7c0aa0b13e2 (diff)
downloadscummvm-rg350-69fb7032460e7874d12d8f07bcc436eb0bbab18d.tar.gz
scummvm-rg350-69fb7032460e7874d12d8f07bcc436eb0bbab18d.tar.bz2
scummvm-rg350-69fb7032460e7874d12d8f07bcc436eb0bbab18d.zip
SCI: cleanup scancode rows code
svn-id: r49964
-rw-r--r--engines/sci/event.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/engines/sci/event.cpp b/engines/sci/event.cpp
index b93f7bddec..eff7984d39 100644
--- a/engines/sci/event.cpp
+++ b/engines/sci/event.cpp
@@ -34,18 +34,19 @@
namespace Sci {
-#define SCANCODE_ROWS_NR 3
-
EventManager::EventManager(bool fontIsExtended) : _fontIsExtended(fontIsExtended), _modifierStates(0) {
}
EventManager::~EventManager() {
}
-static const struct scancode_row {
+
+struct ScancodeRow {
int offset;
const char *keys;
-} scancode_rows[SCANCODE_ROWS_NR] = {
+};
+
+static const ScancodeRow s_scancodeRows[] = {
{0x10, "QWERTYUIOP[]"},
{0x1e, "ASDFGHJKL;'\\"},
{0x2c, "ZXCVBNM,./"}
@@ -56,9 +57,9 @@ static int altify(int ch) {
int row;
int c = toupper((char)ch);
- for (row = 0; row < SCANCODE_ROWS_NR; row++) {
- const char *keys = scancode_rows[row].keys;
- int offset = scancode_rows[row].offset;
+ for (row = 0; row < ARRAYSIZE(s_scancodeRows); row++) {
+ const char *keys = s_scancodeRows[row].keys;
+ int offset = s_scancodeRows[row].offset;
while (*keys) {
if (*keys == c)