Move autoconfigured variables out of settings struct;
these values are not written back to the config file
This commit is contained in:
parent
e36564b2b0
commit
7b5b49a5e6
|
@ -1174,10 +1174,10 @@ static void config_set_defaults(void)
|
|||
settings->input.autoconf_binds[i][j].joykey = NO_BTN;
|
||||
settings->input.autoconf_binds[i][j].joyaxis = AXIS_NONE;
|
||||
}
|
||||
|
||||
settings->input.autoconfigured[i] = 0;
|
||||
}
|
||||
|
||||
input_autoconfigure_reset();
|
||||
|
||||
/* Verify that binds are in proper order. */
|
||||
for (i = 0; i < MAX_USERS; i++)
|
||||
{
|
||||
|
|
|
@ -285,7 +285,6 @@ typedef struct settings
|
|||
|
||||
/* Set by autoconfiguration in joypad_autoconfig_dir.
|
||||
* Does not override main binds. */
|
||||
bool autoconfigured[MAX_USERS];
|
||||
bool swap_override;
|
||||
int vid[MAX_USERS];
|
||||
int pid[MAX_USERS];
|
||||
|
|
|
@ -645,7 +645,7 @@ static int menu_displaylist_parse_system_info(menu_displaylist_info_t *info)
|
|||
|
||||
for(controller = 0; controller < MAX_USERS; controller++)
|
||||
{
|
||||
if (settings->input.autoconfigured[controller])
|
||||
if (input_is_autoconfigured(controller))
|
||||
{
|
||||
snprintf(tmp, sizeof(tmp), "Port #%d device name: %s (#%d)",
|
||||
controller, settings->input.device_names[controller],
|
||||
|
|
|
@ -50,6 +50,8 @@ typedef struct autoconfig_params
|
|||
char autoconfig_directory[4096];
|
||||
} autoconfig_params_t;
|
||||
|
||||
static bool input_autoconfigured[MAX_USERS];
|
||||
|
||||
/* Adds an index for devices with the same name,
|
||||
* so they can be identified in the GUI. */
|
||||
static void input_autoconfigure_joypad_reindex_devices(autoconfig_params_t *params)
|
||||
|
@ -154,11 +156,10 @@ static void input_autoconfigure_joypad_add(config_file_t *conf,
|
|||
|
||||
/* This will be the case if input driver is reinitialized.
|
||||
* No reason to spam autoconfigure messages every time. */
|
||||
block_osd_spam = settings->input.autoconfigured[params->idx]
|
||||
block_osd_spam = input_autoconfigured[params->idx]
|
||||
&& !string_is_empty(params->name);
|
||||
|
||||
configuration_set_bool(settings,
|
||||
settings->input.autoconfigured[params->idx], true);
|
||||
input_autoconfigured[params->idx] = true;
|
||||
|
||||
input_autoconfigure_joypad_conf(conf,
|
||||
settings->input.autoconf_binds[params->idx]);
|
||||
|
@ -399,6 +400,18 @@ error:
|
|||
return false;
|
||||
}
|
||||
|
||||
void input_autoconfigure_reset(void)
|
||||
{
|
||||
unsigned i;
|
||||
for (i = 0; i < MAX_USERS; i++)
|
||||
input_autoconfigured[i] = 0;
|
||||
}
|
||||
|
||||
bool input_is_autoconfigured(unsigned i)
|
||||
{
|
||||
return input_autoconfigured[i];
|
||||
}
|
||||
|
||||
bool input_autoconfigure_connect(
|
||||
const char *name,
|
||||
const char *display_name,
|
||||
|
@ -449,8 +462,7 @@ bool input_autoconfigure_connect(
|
|||
settings->input.autoconf_binds[state->idx][i].joyaxis_label[0] = '\0';
|
||||
}
|
||||
|
||||
configuration_set_bool(settings,
|
||||
settings->input.autoconfigured[state->idx], false);
|
||||
input_autoconfigured[state->idx] = false;
|
||||
|
||||
task->state = state;
|
||||
task->handler = input_autoconfigure_connect_handler;
|
||||
|
|
|
@ -219,6 +219,10 @@ void *savefile_ptr_get(void);
|
|||
|
||||
void path_init_savefile_new(void);
|
||||
|
||||
void input_autoconfigure_reset(void);
|
||||
|
||||
bool input_is_autoconfigured(unsigned i);
|
||||
|
||||
bool input_autoconfigure_connect(
|
||||
const char *name,
|
||||
const char *display_name,
|
||||
|
|
Loading…
Reference in New Issue