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;
|
||||
uint32_t max_users;
|
||||
char autoconfig_directory[4096];
|
||||
bool set_swap;
|
||||
bool swap_val;
|
||||
} autoconfig_params_t;
|
||||
|
||||
static bool input_autoconfigured[MAX_USERS];
|
||||
|
@ -163,8 +165,8 @@ static void input_autoconfigure_joypad_add(config_file_t *conf,
|
|||
remote_is_bound = true;
|
||||
if (params->idx == 0)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
configuration_set_bool(settings, settings->bools.input_swap_override, true);
|
||||
params->set_swap = true;
|
||||
params->swap_val = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -180,8 +182,8 @@ static void input_autoconfigure_joypad_add(config_file_t *conf,
|
|||
{
|
||||
if (config_get_bool(conf, "input_swap_override", &tmp))
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
configuration_set_bool(settings, settings->bools.input_swap_override, tmp);
|
||||
params->set_swap = true;
|
||||
params->swap_val = tmp;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -300,6 +302,18 @@ static bool input_autoconfigure_joypad_from_conf_internal(
|
|||
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)
|
||||
{
|
||||
autoconfig_params_t *params = (autoconfig_params_t*)task->state;
|
||||
|
@ -469,6 +483,7 @@ bool input_autoconfigure_connect(
|
|||
|
||||
task->state = state;
|
||||
task->handler = input_autoconfigure_connect_handler;
|
||||
task->callback = input_autoconfigure_connect_finished;
|
||||
|
||||
task_queue_ctl(TASK_QUEUE_CTL_PUSH, task);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue