aboutsummaryrefslogtreecommitdiff
path: root/engines/kyra
diff options
context:
space:
mode:
authorJohannes Schickel2010-02-17 16:08:47 +0000
committerJohannes Schickel2010-02-17 16:08:47 +0000
commit5d6b9af72a0e40d6d48a6e064516509d6129a4ce (patch)
tree641d8bb56d37c0a1e03cefe2fb6b452b6356aace /engines/kyra
parent8daaeae84903a8f29f8f3c25808e157ab886cbbb (diff)
downloadscummvm-rg350-5d6b9af72a0e40d6d48a6e064516509d6129a4ce.tar.gz
scummvm-rg350-5d6b9af72a0e40d6d48a6e064516509d6129a4ce.tar.bz2
scummvm-rg350-5d6b9af72a0e40d6d48a6e064516509d6129a4ce.zip
Use Common::KeyCode instead of int as key type for KeyMap.
svn-id: r48078
Diffstat (limited to 'engines/kyra')
-rw-r--r--engines/kyra/gui_lol.cpp4
-rw-r--r--engines/kyra/kyra_v1.h6
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<int, int16>::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<Common::KeyCode, uint> {
+ 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<Event> _eventList;
- typedef Common::HashMap<int, int16> KeyMap;
+ typedef Common::HashMap<Common::KeyCode, int16, KeyCodeHash> KeyMap;
KeyMap _keyMap;
// config specific