mirror of
https://github.com/libretro/RetroArch.git
synced 2025-04-02 10:51:52 -04:00
(task_autodetect.c) Set input_swap_override later on
This commit is contained in:
parent
44b9943738
commit
582573f324
1 changed files with 21 additions and 6 deletions
|
@ -49,6 +49,8 @@ typedef struct autoconfig_params
|
||||||
int32_t pid;
|
int32_t pid;
|
||||||
uint32_t max_users;
|
uint32_t max_users;
|
||||||
char autoconfig_directory[4096];
|
char autoconfig_directory[4096];
|
||||||
|
bool set_swap;
|
||||||
|
bool swap_val;
|
||||||
} autoconfig_params_t;
|
} autoconfig_params_t;
|
||||||
|
|
||||||
static bool input_autoconfigured[MAX_USERS];
|
static bool input_autoconfigured[MAX_USERS];
|
||||||
|
@ -163,8 +165,8 @@ static void input_autoconfigure_joypad_add(config_file_t *conf,
|
||||||
remote_is_bound = true;
|
remote_is_bound = true;
|
||||||
if (params->idx == 0)
|
if (params->idx == 0)
|
||||||
{
|
{
|
||||||
settings_t *settings = config_get_ptr();
|
params->set_swap = true;
|
||||||
configuration_set_bool(settings, settings->bools.input_swap_override, true);
|
params->swap_val = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -180,8 +182,8 @@ static void input_autoconfigure_joypad_add(config_file_t *conf,
|
||||||
{
|
{
|
||||||
if (config_get_bool(conf, "input_swap_override", &tmp))
|
if (config_get_bool(conf, "input_swap_override", &tmp))
|
||||||
{
|
{
|
||||||
settings_t *settings = config_get_ptr();
|
params->set_swap = true;
|
||||||
configuration_set_bool(settings, settings->bools.input_swap_override, tmp);
|
params->swap_val = tmp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -300,6 +302,18 @@ static bool input_autoconfigure_joypad_from_conf_internal(
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void input_autoconfigure_connect_finished(void *task_data,
|
||||||
|
void *user_data, const char *error)
|
||||||
|
{
|
||||||
|
autoconfig_params_t *params = (autoconfig_params_t*)task_data;
|
||||||
|
|
||||||
|
if (params && params->set_swap)
|
||||||
|
{
|
||||||
|
settings_t *settings = config_get_ptr();
|
||||||
|
configuration_set_bool(settings, settings->bools.input_swap_override, params->swap_val);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void input_autoconfigure_connect_handler(retro_task_t *task)
|
static void input_autoconfigure_connect_handler(retro_task_t *task)
|
||||||
{
|
{
|
||||||
autoconfig_params_t *params = (autoconfig_params_t*)task->state;
|
autoconfig_params_t *params = (autoconfig_params_t*)task->state;
|
||||||
|
@ -467,8 +481,9 @@ bool input_autoconfigure_connect(
|
||||||
|
|
||||||
input_autoconfigured[state->idx] = false;
|
input_autoconfigured[state->idx] = false;
|
||||||
|
|
||||||
task->state = state;
|
task->state = state;
|
||||||
task->handler = input_autoconfigure_connect_handler;
|
task->handler = input_autoconfigure_connect_handler;
|
||||||
|
task->callback = input_autoconfigure_connect_finished;
|
||||||
|
|
||||||
task_queue_ctl(TASK_QUEUE_CTL_PUSH, task);
|
task_queue_ctl(TASK_QUEUE_CTL_PUSH, task);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue