mirror of
https://github.com/libretro/RetroArch.git
synced 2025-04-02 10:51:52 -04:00
Turn into char pointer array
This commit is contained in:
parent
b79f95668b
commit
fcf6228dce
3 changed files with 12 additions and 5 deletions
|
@ -2364,7 +2364,10 @@ void input_config_parse_joy_axis(void *data, const char *prefix,
|
||||||
|
|
||||||
if (config_get_string(conf, key_label, &tmp_a))
|
if (config_get_string(conf, key_label, &tmp_a))
|
||||||
{
|
{
|
||||||
strlcpy(bind->joyaxis_label, tmp_a, sizeof(bind->joyaxis_label));
|
if (bind->joyaxis_label &&
|
||||||
|
!string_is_empty(bind->joyaxis_label))
|
||||||
|
free(bind->joyaxis_label);
|
||||||
|
bind->joyaxis_label = strdup(tmp_a);
|
||||||
free(tmp_a);
|
free(tmp_a);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2423,7 +2426,8 @@ static void input_config_get_bind_string_joyaxis(char *buf, const char *prefix,
|
||||||
{
|
{
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
|
|
||||||
if (!string_is_empty(bind->joyaxis_label)
|
if (bind->joyaxis_label &&
|
||||||
|
!string_is_empty(bind->joyaxis_label)
|
||||||
&& settings->bools.input_descriptor_label_show)
|
&& settings->bools.input_descriptor_label_show)
|
||||||
snprintf(buf, size, "%s%s (axis) ", prefix, bind->joyaxis_label);
|
snprintf(buf, size, "%s%s (axis) ", prefix, bind->joyaxis_label);
|
||||||
else
|
else
|
||||||
|
|
|
@ -115,7 +115,7 @@ struct retro_keybind
|
||||||
uint32_t orig_joyaxis;
|
uint32_t orig_joyaxis;
|
||||||
|
|
||||||
char *joykey_label;
|
char *joykey_label;
|
||||||
char joyaxis_label[64];
|
char *joyaxis_label;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct rarch_joypad_info
|
typedef struct rarch_joypad_info
|
||||||
|
|
|
@ -478,8 +478,11 @@ bool input_autoconfigure_connect(
|
||||||
if (input_autoconf_binds[state->idx][i].joykey_label
|
if (input_autoconf_binds[state->idx][i].joykey_label
|
||||||
&& !string_is_empty(input_autoconf_binds[state->idx][i].joykey_label))
|
&& !string_is_empty(input_autoconf_binds[state->idx][i].joykey_label))
|
||||||
free(input_autoconf_binds[state->idx][i].joykey_label);
|
free(input_autoconf_binds[state->idx][i].joykey_label);
|
||||||
|
if (input_autoconf_binds[state->idx][i].joyaxis_label
|
||||||
|
&& !string_is_empty(input_autoconf_binds[state->idx][i].joyaxis_label))
|
||||||
|
free(input_autoconf_binds[state->idx][i].joyaxis_label);
|
||||||
input_autoconf_binds[state->idx][i].joykey_label = NULL;
|
input_autoconf_binds[state->idx][i].joykey_label = NULL;
|
||||||
input_autoconf_binds[state->idx][i].joyaxis_label[0] = '\0';
|
input_autoconf_binds[state->idx][i].joyaxis_label = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
input_autoconfigured[state->idx] = false;
|
input_autoconfigured[state->idx] = false;
|
||||||
|
|
Loading…
Add table
Reference in a new issue