From: Perttu Ahola Date: Fri, 22 Jul 2011 19:35:20 +0000 (+0300) Subject: Changing key settings now doesn't require a game restart X-Git-Url: http://81.2.79.47:8989/gitweb/?a=commitdiff_plain;h=58f612eca17e9f2bc8d296df0aba627d4e2e18e3;p=zefram%2Fminetest%2Fminetest_engine.git Changing key settings now doesn't require a game restart --- diff --git a/src/guiKeyChangeMenu.cpp b/src/guiKeyChangeMenu.cpp index 3e594aec..4a11cf93 100644 --- a/src/guiKeyChangeMenu.cpp +++ b/src/guiKeyChangeMenu.cpp @@ -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() diff --git a/src/keycode.cpp b/src/keycode.cpp index f014914d..d6472d2e 100644 --- a/src/keycode.cpp +++ b/src/keycode.cpp @@ -233,3 +233,4 @@ void clearKeyCache() { g_key_setting_cache.clear(); } + diff --git a/src/keycode.h b/src/keycode.h index 9c62004d..300682b1 100644 --- a/src/keycode.h +++ b/src/keycode.h @@ -24,11 +24,13 @@ with this program; if not, write to the Free Software Foundation, Inc., #include 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