Changing key settings now doesn't require a game restart
authorPerttu Ahola <celeron55@gmail.com>
Fri, 22 Jul 2011 19:35:20 +0000 (22:35 +0300)
committerPerttu Ahola <celeron55@gmail.com>
Fri, 22 Jul 2011 19:35:20 +0000 (22:35 +0300)
src/guiKeyChangeMenu.cpp
src/keycode.cpp
src/keycode.h

index 3e594aecadf89eba8195cf7b8eabc2a2fefc60fc..4a11cf93c0ee3a16e28ffadfe6bf55b9c639185b 100644 (file)
@@ -338,7 +338,7 @@ bool GUIKeyChangeMenu::acceptInput()
        g_settings.set("keymap_fastmove", keycode_to_keyname(key_fast));
        g_settings.set("keymap_special1", keycode_to_keyname(key_use));
        g_settings.set("keymap_print_debug_stacks", keycode_to_keyname(key_dump));
-       //clearKeyCache(); Y U NO SCOPE?!
+       clearKeyCache();
        return true;
 }
 void GUIKeyChangeMenu::init_keys()
index f014914d02a6f27e3070a60aa4693e9affc36a36..d6472d2eaa7e0e780f4dc42ecca7ed02fc9ad2f1 100644 (file)
@@ -233,3 +233,4 @@ void clearKeyCache()
 {
        g_key_setting_cache.clear();
 }
+
index 9c62004d8f744644185d61ad4ded8bfab9abb4a1..300682b121d7fded978b9638bdfebde227b46bfe 100644 (file)
@@ -24,11 +24,13 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include <string>
 
 irr::EKEY_CODE keyname_to_keycode(const char *name);
+std::string keycode_to_keyname(s32 keycode);
 
 // Key configuration getter
 irr::EKEY_CODE getKeySetting(const char *settingname);
-std::string keycode_to_keyname(s32 keycode);
-void clearCache();
+
+// Clear fast lookup cache
+void clearKeyCache();
 
 #endif