diff options
author | Johannes Schickel | 2011-12-30 20:41:47 +0100 |
---|---|---|
committer | Johannes Schickel | 2011-12-30 20:41:47 +0100 |
commit | 27e38d16ee66367f7589e545c1377825a36e8891 (patch) | |
tree | 5576a58d4ee54e92a03a0573f73e7f00545ab6ce /engines | |
parent | 548a3e25342c44cd8ebaecf7a62968f8b62c15f7 (diff) | |
download | scummvm-rg350-27e38d16ee66367f7589e545c1377825a36e8891.tar.gz scummvm-rg350-27e38d16ee66367f7589e545c1377825a36e8891.tar.bz2 scummvm-rg350-27e38d16ee66367f7589e545c1377825a36e8891.zip |
KYRA: Clean up LoL keymap setup a bit.
Diffstat (limited to 'engines')
-rw-r--r-- | engines/kyra/lol.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/engines/kyra/lol.cpp b/engines/kyra/lol.cpp index 290c3bad26..b24ab4fca8 100644 --- a/engines/kyra/lol.cpp +++ b/engines/kyra/lol.cpp @@ -466,15 +466,13 @@ Common::Error LoLEngine::init() { void LoLEngine::initKeymap() { #ifdef ENABLE_KEYMAPPER - - Common::Keymapper *mapper = _eventMan->getKeymapper(); + Common::Keymapper *const mapper = _eventMan->getKeymapper(); // Do not try to recreate same keymap over again if (mapper->getKeymap(kKeymapName) != 0) return; - Common::Action *act; - Common::Keymap *engineKeyMap = new Common::Keymap(kKeymapName); + Common::Keymap *const engineKeyMap = new Common::Keymap(kKeymapName); const Common::KeyActionEntry keyActionEntries[] = { {Common::KeyState(Common::KEYCODE_F1, Common::ASCII_F1), "AT1", _("Attack 1")}, @@ -492,14 +490,12 @@ void LoLEngine::initKeymap() { {Common::KeyState(), 0, 0} }; - const Common::KeyActionEntry *entry; - for (entry = keyActionEntries; entry->id; ++entry) { - act = new Common::Action(engineKeyMap, entry->id, Common::String(entry->description), Common::kGenericActionType, Common::kActionKeyType); - act->addKeyEvent(Common::KeyState(entry->ks)); + for (const Common::KeyActionEntry *entry = keyActionEntries; entry->id; ++entry) { + Common::Action *const act = new Common::Action(engineKeyMap, entry->id, entry->description, Common::kGenericActionType, Common::kActionKeyType); + act->addKeyEvent(entry->ks); } mapper->addGameKeymap(engineKeyMap); - #endif } |