mirror of
https://github.com/libretro/RetroArch
synced 2025-03-01 07:13:35 +00:00
Go through input bind map wrapper functions
This commit is contained in:
parent
0ca0bd182b
commit
0b0b3431b0
@ -1057,17 +1057,17 @@ static void read_keybinds_keyboard(config_file_t *conf, unsigned user,
|
|||||||
{
|
{
|
||||||
const char *prefix = NULL;
|
const char *prefix = NULL;
|
||||||
|
|
||||||
if (!input_config_bind_map[idx].valid)
|
if (!input_bind_map_get_valid(idx))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!input_config_bind_map[idx].base)
|
if (!input_bind_map_get_base(idx))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
prefix = input_config_get_prefix(user, input_config_bind_map[idx].meta);
|
prefix = input_config_get_prefix(user, input_bind_map_get_meta(idx));
|
||||||
|
|
||||||
if (prefix)
|
if (prefix)
|
||||||
input_config_parse_key(conf, prefix,
|
input_config_parse_key(conf, prefix,
|
||||||
input_config_bind_map[idx].base, bind);
|
input_bind_map_get_base(idx), bind);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void read_keybinds_button(config_file_t *conf, unsigned user,
|
static void read_keybinds_button(config_file_t *conf, unsigned user,
|
||||||
@ -1075,17 +1075,17 @@ static void read_keybinds_button(config_file_t *conf, unsigned user,
|
|||||||
{
|
{
|
||||||
const char *prefix = NULL;
|
const char *prefix = NULL;
|
||||||
|
|
||||||
if (!input_config_bind_map[idx].valid)
|
if (!input_bind_map_get_valid(idx))
|
||||||
return;
|
return;
|
||||||
if (!input_config_bind_map[idx].base)
|
if (!input_bind_map_get_base(idx))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
prefix = input_config_get_prefix(user,
|
prefix = input_config_get_prefix(user,
|
||||||
input_config_bind_map[idx].meta);
|
input_bind_map_get_meta(idx));
|
||||||
|
|
||||||
if (prefix)
|
if (prefix)
|
||||||
input_config_parse_joy_button(conf, prefix,
|
input_config_parse_joy_button(conf, prefix,
|
||||||
input_config_bind_map[idx].base, bind);
|
input_bind_map_get_base(idx), bind);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void read_keybinds_axis(config_file_t *conf, unsigned user,
|
static void read_keybinds_axis(config_file_t *conf, unsigned user,
|
||||||
@ -1093,17 +1093,17 @@ static void read_keybinds_axis(config_file_t *conf, unsigned user,
|
|||||||
{
|
{
|
||||||
const char *prefix = NULL;
|
const char *prefix = NULL;
|
||||||
|
|
||||||
if (!input_config_bind_map[idx].valid)
|
if (!input_bind_map_get_valid(idx))
|
||||||
return;
|
return;
|
||||||
if (!input_config_bind_map[idx].base)
|
if (!input_bind_map_get_base(idx))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
prefix = input_config_get_prefix(user,
|
prefix = input_config_get_prefix(user,
|
||||||
input_config_bind_map[idx].meta);
|
input_bind_map_get_meta(idx));
|
||||||
|
|
||||||
if (prefix)
|
if (prefix)
|
||||||
input_config_parse_joy_axis(conf, prefix,
|
input_config_parse_joy_axis(conf, prefix,
|
||||||
input_config_bind_map[idx].base, bind);
|
input_bind_map_get_base(idx), bind);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void read_keybinds_user(config_file_t *conf, unsigned user)
|
static void read_keybinds_user(config_file_t *conf, unsigned user)
|
||||||
@ -1111,7 +1111,7 @@ static void read_keybinds_user(config_file_t *conf, unsigned user)
|
|||||||
unsigned i;
|
unsigned i;
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
|
|
||||||
for (i = 0; input_config_bind_map[i].valid; i++)
|
for (i = 0; input_bind_map_get_valid(i); i++)
|
||||||
{
|
{
|
||||||
struct retro_keybind *bind = (struct retro_keybind*)
|
struct retro_keybind *bind = (struct retro_keybind*)
|
||||||
&settings->input.binds[user][i];
|
&settings->input.binds[user][i];
|
||||||
@ -2298,13 +2298,13 @@ static void save_keybinds_user(config_file_t *conf, unsigned user)
|
|||||||
unsigned i = 0;
|
unsigned i = 0;
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
|
|
||||||
for (i = 0; input_config_bind_map[i].valid; i++)
|
for (i = 0; input_bind_map_get_valid(i); i++)
|
||||||
{
|
{
|
||||||
const char *prefix = input_config_get_prefix(user,
|
const char *prefix = input_config_get_prefix(user,
|
||||||
input_config_bind_map[i].meta);
|
input_bind_map_get_meta(i));
|
||||||
|
|
||||||
if (prefix)
|
if (prefix)
|
||||||
save_keybind(conf, prefix, input_config_bind_map[i].base,
|
save_keybind(conf, prefix, input_bind_map_get_base(i),
|
||||||
&settings->input.binds[user][i], true, true);
|
&settings->input.binds[user][i], true, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2420,7 +2420,7 @@ bool config_save_autoconf_profile(const char *path, unsigned user)
|
|||||||
|
|
||||||
for (i = 0; i < RARCH_FIRST_META_KEY; i++)
|
for (i = 0; i < RARCH_FIRST_META_KEY; i++)
|
||||||
{
|
{
|
||||||
save_keybind(conf, "input", input_config_bind_map[i].base,
|
save_keybind(conf, "input", input_bind_map_get_base(i),
|
||||||
&settings->input.binds[user][i], false, false);
|
&settings->input.binds[user][i], false, false);
|
||||||
}
|
}
|
||||||
ret = config_file_write(conf, autoconf_file);
|
ret = config_file_write(conf, autoconf_file);
|
||||||
|
@ -124,6 +124,14 @@ const void *input_bind_map_get(unsigned i)
|
|||||||
return keybind;
|
return keybind;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool input_bind_map_get_valid(unsigned i)
|
||||||
|
{
|
||||||
|
const struct input_bind_map* keybind = (const struct input_bind_map*)input_bind_map_get(i);
|
||||||
|
if (!keybind)
|
||||||
|
return false;
|
||||||
|
return keybind->valid;
|
||||||
|
}
|
||||||
|
|
||||||
unsigned input_bind_map_get_meta(unsigned i)
|
unsigned input_bind_map_get_meta(unsigned i)
|
||||||
{
|
{
|
||||||
const struct input_bind_map* keybind = (const struct input_bind_map*)input_bind_map_get(i);
|
const struct input_bind_map* keybind = (const struct input_bind_map*)input_bind_map_get(i);
|
||||||
|
@ -48,6 +48,8 @@ unsigned input_bind_map_get_meta(unsigned i);
|
|||||||
|
|
||||||
const char *input_bind_map_get_desc(unsigned i);
|
const char *input_bind_map_get_desc(unsigned i);
|
||||||
|
|
||||||
|
bool input_bind_map_get_valid(unsigned i);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* input_translate_coord_viewport:
|
* input_translate_coord_viewport:
|
||||||
* @mouse_x : Pointer X coordinate.
|
* @mouse_x : Pointer X coordinate.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user