mirror of
https://github.com/CTCaer/RetroArch.git
synced 2025-02-04 18:47:09 +00:00
Cleanups
This commit is contained in:
parent
188029373f
commit
8fc2a05a70
@ -108,7 +108,8 @@ static int input_try_autoconfigure_joypad_from_conf(config_file_t *conf,
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!string_is_empty(ident) && !strncmp(params->name, ident, strlen(ident)))
|
||||
if (!string_is_empty(ident)
|
||||
&& !strncmp(params->name, ident, strlen(ident)))
|
||||
{
|
||||
score += 1;
|
||||
#if 0
|
||||
@ -117,12 +118,14 @@ static int input_try_autoconfigure_joypad_from_conf(config_file_t *conf,
|
||||
}
|
||||
}
|
||||
#if 0
|
||||
RARCH_LOG("Autodetect: configuration file: %s score: %d\n", conf->path, score);
|
||||
RARCH_LOG("Autodetect: configuration file: %s score: %d\n",
|
||||
conf->path, score);
|
||||
#endif
|
||||
return score;
|
||||
}
|
||||
|
||||
static void input_autoconfigure_joypad_add(config_file_t *conf, autoconfig_params_t *params)
|
||||
static void input_autoconfigure_joypad_add(config_file_t *conf,
|
||||
autoconfig_params_t *params)
|
||||
{
|
||||
bool block_osd_spam;
|
||||
static bool remote_is_bound = false;
|
||||
@ -131,8 +134,10 @@ static void input_autoconfigure_joypad_add(config_file_t *conf, autoconfig_param
|
||||
char device_type[PATH_MAX_LENGTH] = {0};
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
config_get_array(conf, "input_device_display_name", display_name, sizeof(display_name));
|
||||
config_get_array(conf, "input_device_type", device_type, sizeof(device_type));
|
||||
config_get_array(conf, "input_device_display_name",
|
||||
display_name, sizeof(display_name));
|
||||
config_get_array(conf, "input_device_type", device_type,
|
||||
sizeof(device_type));
|
||||
|
||||
if (!settings)
|
||||
return;
|
||||
@ -213,7 +218,8 @@ static bool input_autoconfigure_joypad_from_conf_dir(
|
||||
list = dir_list_new(path, "cfg", false, false);
|
||||
|
||||
if (!list || !list->size)
|
||||
list = dir_list_new(settings->input.autoconfig_dir, "cfg", false, false);
|
||||
list = dir_list_new(settings->input.autoconfig_dir,
|
||||
"cfg", false, false);
|
||||
|
||||
if(!list)
|
||||
return false;
|
||||
@ -323,8 +329,10 @@ bool input_config_autoconfigure_joypad(autoconfig_params_t *params)
|
||||
{
|
||||
char msg[PATH_MAX_LENGTH];
|
||||
|
||||
RARCH_LOG("Autodetect: no profiles found for %s (%d/%d)", params->name, params->vid, params->pid);
|
||||
snprintf(msg, sizeof(msg), "%s (%ld/%ld) not configured", params->name, (long)params->vid, (long)params->pid);
|
||||
RARCH_LOG("Autodetect: no profiles found for %s (%d/%d)",
|
||||
params->name, params->vid, params->pid);
|
||||
snprintf(msg, sizeof(msg), "%s (%ld/%ld) not configured",
|
||||
params->name, (long)params->vid, (long)params->pid);
|
||||
runloop_msg_queue_push(msg, 0, 60, false);
|
||||
}
|
||||
return ret;
|
||||
|
@ -40,7 +40,7 @@ static hid_driver_t *hid_drivers[] = {
|
||||
NULL,
|
||||
};
|
||||
|
||||
static const void *hid_data;
|
||||
static const void *hid_data = NULL;
|
||||
|
||||
/**
|
||||
* hid_driver_find_handle:
|
||||
|
@ -70,8 +70,8 @@ typedef struct input_overlay_state
|
||||
uint32_t keys[RETROK_LAST / 32 + 1];
|
||||
} input_overlay_state_t;
|
||||
|
||||
static input_overlay_t *overlay_ptr;
|
||||
static input_overlay_state_t overlay_st_ptr;
|
||||
static input_overlay_t *overlay_ptr = NULL;
|
||||
|
||||
/**
|
||||
* input_overlay_scale:
|
||||
|
@ -45,8 +45,11 @@ bool input_remapping_load_file(void *data, const char *path)
|
||||
{
|
||||
char buf[64] = {0};
|
||||
char key_ident[RARCH_FIRST_CUSTOM_BIND + 4][128] = {{0}};
|
||||
char key_strings[RARCH_FIRST_CUSTOM_BIND + 4][128] = { "b", "y", "select", "start",
|
||||
"up", "down", "left", "right", "a", "x", "l", "r", "l2", "r2", "l3", "r3", "l_x", "l_y", "r_x", "r_y" };
|
||||
char key_strings[RARCH_FIRST_CUSTOM_BIND + 4][128] =
|
||||
{ "b", "y", "select", "start",
|
||||
"up", "down", "left", "right",
|
||||
"a", "x", "l", "r", "l2", "r2",
|
||||
"l3", "r3", "l_x", "l_y", "r_x", "r_y" };
|
||||
|
||||
snprintf(buf, sizeof(buf), "input_player%u", i + 1);
|
||||
|
||||
@ -54,8 +57,10 @@ bool input_remapping_load_file(void *data, const char *path)
|
||||
{
|
||||
int key_remap = -1;
|
||||
|
||||
fill_pathname_join_delim(key_ident[j], buf, key_strings[j], '_', sizeof(key_ident[j]));
|
||||
if (config_get_int(conf, key_ident[j], &key_remap) && key_remap < RARCH_FIRST_CUSTOM_BIND)
|
||||
fill_pathname_join_delim(key_ident[j], buf,
|
||||
key_strings[j], '_', sizeof(key_ident[j]));
|
||||
if (config_get_int(conf, key_ident[j], &key_remap)
|
||||
&& key_remap < RARCH_FIRST_CUSTOM_BIND)
|
||||
settings->input.remap_ids[i][j] = key_remap;
|
||||
}
|
||||
|
||||
@ -69,8 +74,10 @@ bool input_remapping_load_file(void *data, const char *path)
|
||||
buf,
|
||||
key_strings[RARCH_FIRST_CUSTOM_BIND + j]);
|
||||
|
||||
if (config_get_int(conf, key_ident[RARCH_FIRST_CUSTOM_BIND + j], &key_remap) && (key_remap < 4))
|
||||
settings->input.remap_ids[i][RARCH_FIRST_CUSTOM_BIND + j] = key_remap;
|
||||
if (config_get_int(conf, key_ident[RARCH_FIRST_CUSTOM_BIND + j],
|
||||
&key_remap) && (key_remap < 4))
|
||||
settings->input.remap_ids[i][RARCH_FIRST_CUSTOM_BIND + j] =
|
||||
key_remap;
|
||||
}
|
||||
}
|
||||
|
||||
@ -113,14 +120,18 @@ bool input_remapping_save_file(const char *path)
|
||||
for (i = 0; i < settings->input.max_users; i++)
|
||||
{
|
||||
char key_ident[RARCH_FIRST_CUSTOM_BIND + 4][128] = {{0}};
|
||||
char key_strings[RARCH_FIRST_CUSTOM_BIND + 4][128] = { "b", "y", "select", "start",
|
||||
"up", "down", "left", "right", "a", "x", "l", "r", "l2", "r2", "l3", "r3", "l_x", "l_y", "r_x", "r_y" };
|
||||
char key_strings[RARCH_FIRST_CUSTOM_BIND + 4][128] = {
|
||||
"b", "y", "select", "start",
|
||||
"up", "down", "left", "right",
|
||||
"a", "x", "l", "r", "l2", "r2",
|
||||
"l3", "r3", "l_x", "l_y", "r_x", "r_y" };
|
||||
|
||||
snprintf(buf, sizeof(buf), "input_player%u", i + 1);
|
||||
|
||||
for (j = 0; j < RARCH_FIRST_CUSTOM_BIND + 4; j++)
|
||||
{
|
||||
fill_pathname_join_delim(key_ident[j], buf, key_strings[j], '_', sizeof(key_ident[j]));
|
||||
fill_pathname_join_delim(key_ident[j], buf,
|
||||
key_strings[j], '_', sizeof(key_ident[j]));
|
||||
config_set_int(conf, key_ident[j], settings->input.remap_ids[i][j]);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user