[Scummvm-cvs-logs] SF.net SVN: scummvm:[45730] scummvm/trunk/engines/kyra
lordhoto at users.sourceforge.net
lordhoto at users.sourceforge.net
Sat Nov 7 16:06:26 CET 2009
Revision: 45730
http://scummvm.svn.sourceforge.net/scummvm/?rev=45730&view=rev
Author: lordhoto
Date: 2009-11-07 15:06:25 +0000 (Sat, 07 Nov 2009)
Log Message:
-----------
Access _keyMap a little different, so that no additional entries are created, when an unmapped key is pressed.
Modified Paths:
--------------
scummvm/trunk/engines/kyra/kyra_v1.cpp
scummvm/trunk/engines/kyra/kyra_v1.h
Modified: scummvm/trunk/engines/kyra/kyra_v1.cpp
===================================================================
--- scummvm/trunk/engines/kyra/kyra_v1.cpp 2009-11-07 15:06:03 UTC (rev 45729)
+++ scummvm/trunk/engines/kyra/kyra_v1.cpp 2009-11-07 15:06:25 UTC (rev 45730)
@@ -282,7 +282,11 @@
quitGame();
}
} else {
- keys = _keyMap[event.kbd.keycode];
+ KeyMap::const_iterator keycode = _keyMap.find(event.kbd.keycode);
+ if (keycode != _keyMap.end())
+ keys = keycode->_value;
+ else
+ keys = 0;
// When we got an keypress, which we might need to handle,
// break the event loop and pass it to GUI code.
Modified: scummvm/trunk/engines/kyra/kyra_v1.h
===================================================================
--- scummvm/trunk/engines/kyra/kyra_v1.h 2009-11-07 15:06:03 UTC (rev 45729)
+++ scummvm/trunk/engines/kyra/kyra_v1.h 2009-11-07 15:06:25 UTC (rev 45730)
@@ -223,7 +223,8 @@
operator Common::Event() const { return event; }
};
Common::List<Event> _eventList;
- Common::HashMap<int, int16> _keyMap;
+ typedef Common::HashMap<int, int16> KeyMap;
+ KeyMap _keyMap;
// config specific
virtual void registerDefaultSettings();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list