From 5d6b9af72a0e40d6d48a6e064516509d6129a4ce Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Wed, 17 Feb 2010 16:08:47 +0000 Subject: Use Common::KeyCode instead of int as key type for KeyMap. svn-id: r48078 --- engines/kyra/gui_lol.cpp | 4 ++-- engines/kyra/kyra_v1.h | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/engines/kyra/gui_lol.cpp b/engines/kyra/gui_lol.cpp index b890dcc9e9..184e28beec 100644 --- a/engines/kyra/gui_lol.cpp +++ b/engines/kyra/gui_lol.cpp @@ -843,9 +843,9 @@ void LoLEngine::gui_triggerEvent(int eventType) { } else { evt.type = Common::EVENT_KEYDOWN; - for (Common::HashMap::const_iterator c = _keyMap.begin(); c != _keyMap.end(); ++c) { + for (KeyMap::const_iterator c = _keyMap.begin(); c != _keyMap.end(); ++c) { if (c->_value == eventType) - evt.kbd.keycode = (Common::KeyCode) c->_key; + evt.kbd.keycode = (Common::KeyCode)c->_key; } } diff --git a/engines/kyra/kyra_v1.h b/engines/kyra/kyra_v1.h index 1ad13cd092..0e71f039f4 100644 --- a/engines/kyra/kyra_v1.h +++ b/engines/kyra/kyra_v1.h @@ -119,6 +119,10 @@ struct GameFlags { byte gameID; }; +struct KeyCodeHash : public Common::UnaryFunction { + uint operator()(Common::KeyCode val) const { return (uint)val; } +}; + enum { GI_KYRA1 = 0, GI_KYRA2 = 1, @@ -277,7 +281,7 @@ protected: operator Common::Event() const { return event; } }; Common::List _eventList; - typedef Common::HashMap KeyMap; + typedef Common::HashMap KeyMap; KeyMap _keyMap; // config specific -- cgit v1.2.3