mirror of https://github.com/stella-emu/stella.git
Fix compilation for new keymapping stuff in Linux/libretro.
This commit is contained in:
parent
fc79665d3a
commit
5b4fee61dd
|
@ -18,6 +18,8 @@
|
||||||
#ifndef KEYMAP_HXX
|
#ifndef KEYMAP_HXX
|
||||||
#define KEYMAP_HXX
|
#define KEYMAP_HXX
|
||||||
|
|
||||||
|
#include <unordered_map>
|
||||||
|
|
||||||
#include "Event.hxx"
|
#include "Event.hxx"
|
||||||
#include "EventHandlerConstants.hxx"
|
#include "EventHandlerConstants.hxx"
|
||||||
|
|
||||||
|
@ -38,10 +40,10 @@ class KeyMap
|
||||||
|
|
||||||
Mapping() : mode(EventMode(0)), key(StellaKey(0)), mod(StellaMod(0)) { }
|
Mapping() : mode(EventMode(0)), key(StellaKey(0)), mod(StellaMod(0)) { }
|
||||||
Mapping(const Mapping& k) : mode(k.mode), key(k.key), mod(k.mod) { }
|
Mapping(const Mapping& k) : mode(k.mode), key(k.key), mod(k.mod) { }
|
||||||
explicit Mapping(EventMode mode, StellaKey key, StellaMod mod = StellaMod::KBDM_NONE)
|
explicit Mapping(EventMode c_mode, StellaKey c_key, StellaMod c_mod = StellaMod::KBDM_NONE)
|
||||||
: mode(mode), key(key), mod(mod) { }
|
: mode(c_mode), key(c_key), mod(c_mod) { }
|
||||||
explicit Mapping(int mode, int key, int mod = StellaMod::KBDM_NONE)
|
explicit Mapping(int c_mode, int c_key, int c_mod = StellaMod::KBDM_NONE)
|
||||||
: mode(EventMode(mode)), key(StellaKey(key)), mod(StellaMod(mod)) { }
|
: mode(EventMode(c_mode)), key(StellaKey(c_key)), mod(StellaMod(c_mod)) { }
|
||||||
|
|
||||||
bool operator==(const Mapping& other) const
|
bool operator==(const Mapping& other) const
|
||||||
{
|
{
|
||||||
|
@ -90,9 +92,9 @@ class KeyMap
|
||||||
|
|
||||||
struct KeyHash {
|
struct KeyHash {
|
||||||
size_t operator()(const Mapping& k)const {
|
size_t operator()(const Mapping& k)const {
|
||||||
return std::hash<long long>()(((long long)k.mode)
|
return std::hash<uInt64>()((uInt64(k.mode))
|
||||||
^ (((long long)k.key) << 16)
|
^ ((uInt64(k.key)) << 16)
|
||||||
^ (((long long)k.mod) << 32));
|
^ ((uInt64(k.mod)) << 32));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,7 @@ SOURCES_CXX := \
|
||||||
$(CORE_DIR)/common/Base.cxx \
|
$(CORE_DIR)/common/Base.cxx \
|
||||||
$(CORE_DIR)/common/FpsMeter.cxx \
|
$(CORE_DIR)/common/FpsMeter.cxx \
|
||||||
$(CORE_DIR)/common/FSNodeZIP.cxx \
|
$(CORE_DIR)/common/FSNodeZIP.cxx \
|
||||||
|
$(CORE_DIR)/common/KeyMap.cxx \
|
||||||
$(CORE_DIR)/common/Logger.cxx \
|
$(CORE_DIR)/common/Logger.cxx \
|
||||||
$(CORE_DIR)/common/MouseControl.cxx \
|
$(CORE_DIR)/common/MouseControl.cxx \
|
||||||
$(CORE_DIR)/common/PhysicalJoystick.cxx \
|
$(CORE_DIR)/common/PhysicalJoystick.cxx \
|
||||||
|
|
Loading…
Reference in New Issue