Improvements to input descriptors being shown

This commit is contained in:
twinaphex 2014-12-04 13:45:56 +01:00
parent e3e5f5f8a8
commit 1e1457c45c
4 changed files with 13 additions and 3 deletions

View File

@ -700,6 +700,8 @@ bool rarch_environment_cb(unsigned cmd, void *data)
}
}
g_extern.has_set_input_descriptors = true;
break;
}

View File

@ -484,6 +484,7 @@ struct global
char gb_rom_path[PATH_MAX];
char bsx_rom_path[PATH_MAX];
char sufami_rom_path[2][PATH_MAX];
bool has_set_input_descriptors;
bool has_set_save_path;
bool has_set_state_path;
bool has_set_libretro_device[MAX_PLAYERS];

View File

@ -442,6 +442,7 @@ static void config_set_defaults(void)
g_settings.camera.allow = false;
g_settings.input.input_descriptor_label_show = input_descriptor_label_show;
rarch_assert(sizeof(g_settings.input.binds[0]) >= sizeof(retro_keybinds_1));
rarch_assert(sizeof(g_settings.input.binds[1]) >= sizeof(retro_keybinds_rest));
memcpy(g_settings.input.binds[0], retro_keybinds_1, sizeof(retro_keybinds_1));
@ -1531,6 +1532,9 @@ void config_load(void)
g_settings.config_save_on_exit && g_settings.core_specific_config)
config_save_file(g_extern.core_specific_config_path);
/* Flush out some states that could have been set by core environment variables */
g_extern.has_set_input_descriptors = false;
if (!g_extern.block_config_read)
{
config_set_defaults();

View File

@ -4537,10 +4537,13 @@ static bool setting_data_append_list_input_options(
if (!keybind || keybind->meta)
continue;
if (g_settings.input.input_descriptor_label_show)
if (
g_settings.input.input_descriptor_label_show
&& (i < RARCH_FIRST_CUSTOM_BIND)
&& (g_extern.has_set_input_descriptors)
)
snprintf(label, sizeof(label), "%s %s", buffer[player],
g_extern.system.input_desc_btn[player][i]
? g_extern.system.input_desc_btn[player][i] : keybind->desc);
g_extern.system.input_desc_btn[player][i] ? g_extern.system.input_desc_btn[player][i] : "N/A");
else
snprintf(label, sizeof(label), "%s %s", buffer[player], keybind->desc);