summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-08-24 00:50:03 +0300
committerAndrei Karas <akaras@inbox.ru>2013-08-24 21:08:17 +0300
commitfe8eaac0bddd1d6416bf16abdb9206290fcced2f (patch)
tree7356ee830cbcecf418c63f1222c741d0b0b1bb7e
parent076e2f4655c43e7dc79a01d576551942c7c3c057 (diff)
downloadmv-fe8eaac0bddd1d6416bf16abdb9206290fcced2f.tar.gz
mv-fe8eaac0bddd1d6416bf16abdb9206290fcced2f.tar.bz2
mv-fe8eaac0bddd1d6416bf16abdb9206290fcced2f.tar.xz
mv-fe8eaac0bddd1d6416bf16abdb9206290fcced2f.zip
In SDL2 key configuration options add prefix "sdl2".
This allow separate SDL1.2 and SDL2 keys in same config.
-rw-r--r--src/inputmanager.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/inputmanager.cpp b/src/inputmanager.cpp
index 6e421498e..03aba6ecf 100644
--- a/src/inputmanager.cpp
+++ b/src/inputmanager.cpp
@@ -102,8 +102,12 @@ void InputManager::retrieve()
{
for (int i = 0; i < Input::KEY_TOTAL; i++)
{
- const char *const cf = keyData[i].configField;
- if (*cf)
+#ifdef USE_SDL2
+ const std::string cf = std::string("sdl2") + keyData[i].configField;
+#else
+ const std::string cf = keyData[i].configField;
+#endif
+ if (!cf.empty())
{
mNameMap[cf] = i;
KeyFunction &kf = mKey[i];
@@ -153,8 +157,12 @@ void InputManager::store() const
{
for (int i = 0; i < Input::KEY_TOTAL; i++)
{
- const char *const cf = keyData[i].configField;
- if (*cf)
+#ifdef USE_SDL2
+ const std::string cf = std::string("sdl2") + keyData[i].configField;
+#else
+ const std::string cf = keyData[i].configField;
+#endif
+ if (!cf.empty())
{
std::string keyStr;
const KeyFunction &kf = mKey[i];