mirror of
https://github.com/libretro/RetroArch
synced 2025-01-27 21:35:25 +00:00
Move input_get_auto_bind to input_config.c
This commit is contained in:
parent
c351aed001
commit
bd53c33069
@ -322,19 +322,6 @@ error:
|
||||
return false;
|
||||
}
|
||||
|
||||
const struct retro_keybind *input_get_auto_bind(unsigned port, unsigned id)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
unsigned joy_idx = 0;
|
||||
|
||||
if (settings)
|
||||
joy_idx = settings->input.joypad_map[port];
|
||||
|
||||
if (joy_idx < MAX_USERS)
|
||||
return &settings->input.autoconf_binds[joy_idx][id];
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void input_config_autoconfigure_disconnect(unsigned i, const char *ident)
|
||||
{
|
||||
char msg[255];
|
||||
|
@ -32,9 +32,6 @@ typedef struct autoconfig_params
|
||||
int32_t pid;
|
||||
} autoconfig_params_t;
|
||||
|
||||
const struct retro_keybind *input_get_auto_bind(unsigned port,
|
||||
unsigned id);
|
||||
|
||||
bool input_config_autoconfigure_joypad(autoconfig_params_t *params);
|
||||
|
||||
void input_config_autoconfigure_disconnect(unsigned i, const char *ident);
|
||||
|
@ -470,3 +470,16 @@ void input_config_get_bind_string(char *buf, const struct retro_keybind *bind,
|
||||
strlcat(buf, keybuf, size);
|
||||
#endif
|
||||
}
|
||||
|
||||
const struct retro_keybind *input_config_get_bind_auto(unsigned port, unsigned id)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
unsigned joy_idx = 0;
|
||||
|
||||
if (settings)
|
||||
joy_idx = settings->input.joypad_map[port];
|
||||
|
||||
if (joy_idx < MAX_USERS)
|
||||
return &settings->input.autoconf_binds[joy_idx][id];
|
||||
return NULL;
|
||||
}
|
||||
|
@ -69,4 +69,6 @@ void input_config_parse_joy_button(config_file_t *conf, const char *prefix,
|
||||
void input_config_parse_joy_axis(config_file_t *conf, const char *prefix,
|
||||
const char *axis, struct retro_keybind *bind);
|
||||
|
||||
const struct retro_keybind *input_config_get_bind_auto(unsigned port, unsigned id);
|
||||
|
||||
#endif
|
||||
|
@ -475,7 +475,7 @@ static void menu_action_setting_disp_set_label_input_desc(
|
||||
keybind = (const struct retro_keybind*)
|
||||
&settings->input.binds[inp_desc_user][remap_id];
|
||||
auto_bind = (const struct retro_keybind*)
|
||||
input_get_auto_bind(inp_desc_user, remap_id);
|
||||
input_config_get_bind_auto(inp_desc_user, remap_id);
|
||||
|
||||
input_config_get_bind_string(descriptor,
|
||||
keybind, auto_bind, sizeof(descriptor));
|
||||
|
@ -111,7 +111,7 @@ int menu_dialog_iterate(char *s, size_t len, const char *label)
|
||||
&settings->input.binds[0][binds[i]];
|
||||
const struct retro_keybind *auto_bind =
|
||||
(const struct retro_keybind*)
|
||||
input_get_auto_bind(0, binds[i]);
|
||||
input_config_get_bind_auto(0, binds[i]);
|
||||
|
||||
input_config_get_bind_string(desc[i],
|
||||
keybind, auto_bind, sizeof(desc[i]));
|
||||
|
@ -610,7 +610,7 @@ static void setting_get_string_representation_st_bind(void *data,
|
||||
index_offset = setting->index_offset;
|
||||
keybind = (const struct retro_keybind*)setting->value.target.keybind;
|
||||
auto_bind = (const struct retro_keybind*)
|
||||
input_get_auto_bind(index_offset, keybind->id);
|
||||
input_config_get_bind_auto(index_offset, keybind->id);
|
||||
|
||||
input_config_get_bind_string(s, keybind, auto_bind, len);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user