Make autoconfig more explicit:

- add pid and vid to autoconfig file if avaiable
This commit is contained in:
pamapa 2015-05-08 16:57:54 +02:00
parent 08c0a59e40
commit 399cc0d8e0

View File

@ -46,6 +46,8 @@ static char *g_out_path = NULL;
static char *g_auto_path = NULL;
static char *g_driver = NULL;
static unsigned g_meta_level = 0;
static int g_input_vid = 0;
static int g_input_pid = 0;
bool rarch_main_verbosity(void)
{
@ -141,10 +143,19 @@ static void get_binds(config_file_t *conf, config_file_t *auto_conf,
const char *joypad_name = input_joypad_name(driver, joypad);
fprintf(stderr, "Using joypad: %s\n", joypad_name ? joypad_name : "Unknown");
if (joypad_name && auto_conf)
if (auto_conf)
{
config_set_string(auto_conf, "input_device", joypad_name);
config_set_string(auto_conf, "input_driver", driver->ident);
if (joypad_name)
{
config_set_string(auto_conf, "input_device", joypad_name);
config_set_string(auto_conf, "input_driver", driver->ident);
}
if (g_input_vid != 0 && g_input_pid != 0)
{
config_set_int(auto_conf, "input_vendor_id", g_input_vid);
config_set_int(auto_conf, "input_product_id", g_input_pid);
}
}
int16_t initial_axes[MAX_AXES] = {0};
@ -450,7 +461,8 @@ static void parse_input(int argc, char *argv[])
void input_config_autoconfigure_joypad(autoconfig_params_t *params)
{
(void)params;
g_input_vid = params->vid;
g_input_pid = params->pid;
}
// Need SDL_main on OSX.