mirror of
https://github.com/libretro/RetroArch.git
synced 2024-11-24 08:30:16 +00:00
remap-redux part2: clean up gamepad mapper callbacks
This commit is contained in:
parent
f7b94e5f66
commit
e71826e3d6
@ -547,14 +547,13 @@ static void menu_action_setting_disp_set_label_input_desc(
|
|||||||
const char *path,
|
const char *path,
|
||||||
char *s2, size_t len2)
|
char *s2, size_t len2)
|
||||||
{
|
{
|
||||||
rarch_system_info_t *system = NULL;
|
rarch_system_info_t *system = NULL;
|
||||||
const char* descriptor = NULL;
|
settings_t *settings = config_get_ptr();
|
||||||
|
const char* descriptor = NULL;
|
||||||
const struct retro_keybind *auto_bind = NULL;
|
const struct retro_keybind *auto_bind = NULL;
|
||||||
const struct retro_keybind *keybind = NULL;
|
const struct retro_keybind *keybind = NULL;
|
||||||
settings_t *settings = config_get_ptr();
|
|
||||||
|
|
||||||
unsigned btn_idx, user_idx;
|
unsigned btn_idx, user_idx, remap_idx;
|
||||||
unsigned remap_id = 0;
|
|
||||||
|
|
||||||
if (!settings)
|
if (!settings)
|
||||||
return;
|
return;
|
||||||
@ -562,7 +561,7 @@ static void menu_action_setting_disp_set_label_input_desc(
|
|||||||
user_idx = (type - MENU_SETTINGS_INPUT_DESC_BEGIN) / (RARCH_FIRST_CUSTOM_BIND + 8);
|
user_idx = (type - MENU_SETTINGS_INPUT_DESC_BEGIN) / (RARCH_FIRST_CUSTOM_BIND + 8);
|
||||||
btn_idx = (type - MENU_SETTINGS_INPUT_DESC_BEGIN) - (RARCH_FIRST_CUSTOM_BIND + 8) * user_idx;
|
btn_idx = (type - MENU_SETTINGS_INPUT_DESC_BEGIN) - (RARCH_FIRST_CUSTOM_BIND + 8) * user_idx;
|
||||||
|
|
||||||
remap_id =
|
remap_idx =
|
||||||
settings->uints.input_remap_ids[user_idx][btn_idx];
|
settings->uints.input_remap_ids[user_idx][btn_idx];
|
||||||
|
|
||||||
system = runloop_get_system_info();
|
system = runloop_get_system_info();
|
||||||
@ -570,7 +569,7 @@ static void menu_action_setting_disp_set_label_input_desc(
|
|||||||
if (!system)
|
if (!system)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
descriptor = system->input_desc_btn[user_idx][remap_id];
|
descriptor = system->input_desc_btn[user_idx][remap_idx];
|
||||||
|
|
||||||
if (!string_is_empty(descriptor))
|
if (!string_is_empty(descriptor))
|
||||||
strlcpy(s, descriptor, len);
|
strlcpy(s, descriptor, len);
|
||||||
|
Loading…
Reference in New Issue
Block a user