[Scummvm-cvs-logs] SF.net SVN: scummvm:[43397] scummvm/branches/gsoc2009-16bit/backends/ keymapper/keymap.h
upthorn at users.sourceforge.net
upthorn at users.sourceforge.net
Sat Aug 15 10:55:23 CEST 2009
Revision: 43397
http://scummvm.svn.sourceforge.net/scummvm/?rev=43397&view=rev
Author: upthorn
Date: 2009-08-15 08:55:22 +0000 (Sat, 15 Aug 2009)
Log Message:
-----------
Added hash function for ActionKey in preparation for replacing KeyStates in the main keymapper hashtable with ActionKeys, removed a duplicated comment line.
Modified Paths:
--------------
scummvm/branches/gsoc2009-16bit/backends/keymapper/keymap.h
Modified: scummvm/branches/gsoc2009-16bit/backends/keymapper/keymap.h
===================================================================
--- scummvm/branches/gsoc2009-16bit/backends/keymapper/keymap.h 2009-08-15 08:52:40 UTC (rev 43396)
+++ scummvm/branches/gsoc2009-16bit/backends/keymapper/keymap.h 2009-08-15 08:55:22 UTC (rev 43397)
@@ -36,6 +36,7 @@
#include "common/keyboard.h"
#include "common/list.h"
#include "backends/keymapper/action.h"
+#include "backends/keymapper/hardware-key.h"
namespace Common {
@@ -53,6 +54,17 @@
}
};
+/**
+ * Hash function for ActionKey
+ */
+template<> struct Hash<ActionKey>
+ : public UnaryFunction<ActionKey, uint> {
+
+ uint operator()(const ActionKey &val) const {
+ return (uint)val.keycode | ((uint)val.flags << 24);
+ }
+};
+
class Keymap {
public:
Keymap(const String& name, Keymap *parent = 0) : _name(name), _parent(parent) {}
@@ -90,7 +102,6 @@
/**
* Save this keymap's mappings to the config manager
* @note Changes are *not* flushed to disk, to do so call ConfMan.flushToDisk()
- * @note Changes are *not* flushed to disk, to do so call ConfMan.flushToDisk()
*/
void saveMappings();
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