Rename 'player' to 'user'

This commit is contained in:
twinaphex 2014-12-05 13:48:54 +01:00
parent 6615f26749
commit 181d163b36
8 changed files with 107 additions and 107 deletions

View File

@ -96,17 +96,17 @@ static PyObject *py_read_input(PyObject *self, PyObject *args)
if (!driver.input_data) if (!driver.input_data)
return PyBool_FromLong(0); return PyBool_FromLong(0);
unsigned player; unsigned user;
unsigned key; unsigned key;
if (!PyArg_ParseTuple(args, "II", &player, &key)) if (!PyArg_ParseTuple(args, "II", &user, &key))
return NULL; return NULL;
if (player > MAX_PLAYERS || player < 1 || key >= RARCH_FIRST_META_KEY) if (user > MAX_PLAYERS || user < 1 || key >= RARCH_FIRST_META_KEY)
return NULL; return NULL;
int16_t res = driver.block_libretro_input ? 0 : int16_t res = driver.block_libretro_input ? 0 :
driver.input->input_state(driver.input_data, driver.input->input_state(driver.input_data,
py_binds, player - 1, RETRO_DEVICE_JOYPAD, 0, key); py_binds, user - 1, RETRO_DEVICE_JOYPAD, 0, key);
return PyBool_FromLong(res); return PyBool_FromLong(res);
} }
@ -116,17 +116,17 @@ static PyObject *py_read_analog(PyObject *self, PyObject *args)
if (!driver.input_data) if (!driver.input_data)
return PyBool_FromLong(0); return PyBool_FromLong(0);
unsigned player; unsigned user;
unsigned index; unsigned index;
unsigned id; unsigned id;
if (!PyArg_ParseTuple(args, "III", &player, &index, &id)) if (!PyArg_ParseTuple(args, "III", &user, &index, &id))
return NULL; return NULL;
if (player > MAX_PLAYERS || player < 1 || index > 1 || id > 1) if (user > MAX_PLAYERS || user < 1 || index > 1 || id > 1)
return NULL; return NULL;
int16_t res = driver.input->input_state(driver.input_data, int16_t res = driver.input->input_state(driver.input_data,
py_binds, player - 1, RETRO_DEVICE_ANALOG, index, id); py_binds, user - 1, RETRO_DEVICE_ANALOG, index, id);
return PyFloat_FromDouble((double)res / 0x7fff); return PyFloat_FromDouble((double)res / 0x7fff);
} }

View File

@ -59,7 +59,7 @@ struct menu_bind_state
int64_t timeout_end; int64_t timeout_end;
unsigned begin; unsigned begin;
unsigned last; unsigned last;
unsigned player; unsigned user;
struct menu_bind_state_port state[MAX_PLAYERS]; struct menu_bind_state_port state[MAX_PLAYERS];
struct menu_bind_axis_state axis_state[MAX_PLAYERS]; struct menu_bind_axis_state axis_state[MAX_PLAYERS];
bool skip; bool skip;

View File

@ -277,7 +277,7 @@ bool menu_poll_find_trigger(struct menu_bind_state *state,
{ {
/* Update the joypad mapping automatically. /* Update the joypad mapping automatically.
* More friendly that way. */ * More friendly that way. */
g_settings.input.joypad_map[state->player] = i; g_settings.input.joypad_map[state->user] = i;
return true; return true;
} }
} }

View File

@ -80,7 +80,7 @@ struct netplay
int fd; int fd;
/* UDP connection for game state updates. */ /* UDP connection for game state updates. */
int udp_fd; int udp_fd;
/* Which port is governed by netplay (other player)? */ /* Which port is governed by netplay (other user)? */
unsigned port; unsigned port;
bool has_connection; bool has_connection;
@ -1171,15 +1171,15 @@ static bool netplay_get_cmd(netplay_t *netplay)
flip_frame = ntohl(flip_frame); flip_frame = ntohl(flip_frame);
if (flip_frame < netplay->flip_frame) if (flip_frame < netplay->flip_frame)
{ {
RARCH_ERR("Host asked us to flip players in the past. Not possible ...\n"); RARCH_ERR("Host asked us to flip users in the past. Not possible ...\n");
return netplay_cmd_nak(netplay); return netplay_cmd_nak(netplay);
} }
netplay->flip ^= true; netplay->flip ^= true;
netplay->flip_frame = flip_frame; netplay->flip_frame = flip_frame;
RARCH_LOG("Netplay players are flipped.\n"); RARCH_LOG("Netplay users are flipped.\n");
msg_queue_push(g_extern.msg_queue, "Netplay players are flipped.", 1, 180); msg_queue_push(g_extern.msg_queue, "Netplay users are flipped.", 1, 180);
return netplay_cmd_ack(netplay); return netplay_cmd_ack(netplay);
} }
@ -1190,7 +1190,7 @@ static bool netplay_get_cmd(netplay_t *netplay)
} }
} }
void netplay_flip_players(netplay_t *netplay) void netplay_flip_users(netplay_t *netplay)
{ {
uint32_t flip_frame = netplay->frame_count + 2 * UDP_FRAME_PACKETS; uint32_t flip_frame = netplay->frame_count + 2 * UDP_FRAME_PACKETS;
uint32_t flip_frame_net = htonl(flip_frame); uint32_t flip_frame_net = htonl(flip_frame);
@ -1198,20 +1198,20 @@ void netplay_flip_players(netplay_t *netplay)
if (netplay->spectate) if (netplay->spectate)
{ {
msg = "Cannot flip players in spectate mode."; msg = "Cannot flip users in spectate mode.";
goto error; goto error;
} }
if (netplay->port == 0) if (netplay->port == 0)
{ {
msg = "Cannot flip players if you're not the host."; msg = "Cannot flip users if you're not the host.";
goto error; goto error;
} }
/* Make sure both clients are definitely synced up. */ /* Make sure both clients are definitely synced up. */
if (netplay->frame_count < (netplay->flip_frame + 2 * UDP_FRAME_PACKETS)) if (netplay->frame_count < (netplay->flip_frame + 2 * UDP_FRAME_PACKETS))
{ {
msg = "Cannot flip players yet. Wait a second or two before attempting flip."; msg = "Cannot flip users yet. Wait a second or two before attempting flip.";
goto error; goto error;
} }
@ -1219,8 +1219,8 @@ void netplay_flip_players(netplay_t *netplay)
&flip_frame_net, sizeof(flip_frame_net)) &flip_frame_net, sizeof(flip_frame_net))
&& netplay_get_response(netplay)) && netplay_get_response(netplay))
{ {
RARCH_LOG("Netplay players are flipped.\n"); RARCH_LOG("Netplay users are flipped.\n");
msg_queue_push(g_extern.msg_queue, "Netplay players are flipped.", 1, 180); msg_queue_push(g_extern.msg_queue, "Netplay users are flipped.", 1, 180);
/* Queue up a flip well enough in the future. */ /* Queue up a flip well enough in the future. */
netplay->flip ^= true; netplay->flip ^= true;
@ -1228,7 +1228,7 @@ void netplay_flip_players(netplay_t *netplay)
} }
else else
{ {
msg = "Failed to flip players."; msg = "Failed to flip users.";
goto error; goto error;
} }

View File

@ -46,7 +46,7 @@ typedef struct netplay netplay_t;
bool netplay_init_network(void); bool netplay_init_network(void);
/* Creates a new netplay handle. A NULL host means we're /* Creates a new netplay handle. A NULL host means we're
* hosting (player 1). :) */ * hosting (user 1). :) */
netplay_t *netplay_new(const char *server, netplay_t *netplay_new(const char *server,
uint16_t port, unsigned frames, uint16_t port, unsigned frames,
const struct retro_callbacks *cb, bool spectate, const struct retro_callbacks *cb, bool spectate,
@ -54,8 +54,8 @@ netplay_t *netplay_new(const char *server,
void netplay_free(netplay_t *handle); void netplay_free(netplay_t *handle);
/* On regular netplay, flip who controls player 1 and 2. */ /* On regular netplay, flip who controls user 1 and 2. */
void netplay_flip_players(netplay_t *handle); void netplay_flip_users(netplay_t *handle);
/* Call this before running retro_run(). */ /* Call this before running retro_run(). */
void netplay_pre_frame(netplay_t *handle); void netplay_pre_frame(netplay_t *handle);

View File

@ -499,12 +499,12 @@ static void print_help(void)
puts("\t\tDo note that noload-save implies that save files will be deleted and overwritten."); puts("\t\tDo note that noload-save implies that save files will be deleted and overwritten.");
#ifdef HAVE_NETPLAY #ifdef HAVE_NETPLAY
puts("\t-H/--host: Host netplay as player 1."); puts("\t-H/--host: Host netplay as user 1.");
puts("\t-C/--connect: Connect to netplay as player 2."); puts("\t-C/--connect: Connect to netplay as user 2.");
puts("\t--port: Port used to netplay. Default is 55435."); puts("\t--port: Port used to netplay. Default is 55435.");
puts("\t-F/--frames: Sync frames when using netplay."); puts("\t-F/--frames: Sync frames when using netplay.");
puts("\t--spectate: Netplay will become spectating mode."); puts("\t--spectate: Netplay will become spectating mode.");
puts("\t\tHost can live stream the game content to players that connect."); puts("\t\tHost can live stream the game content to users that connect.");
puts("\t\tHowever, the client will not be able to play. Multiple clients can connect to the host."); puts("\t\tHowever, the client will not be able to play. Multiple clients can connect to the host.");
#endif #endif
puts("\t--nick: Picks a username (for use with netplay). Not mandatory."); puts("\t--nick: Picks a username (for use with netplay). Not mandatory.");
@ -2649,7 +2649,7 @@ bool rarch_main_command(unsigned cmd)
{ {
netplay_t *netplay = (netplay_t*)driver.netplay_data; netplay_t *netplay = (netplay_t*)driver.netplay_data;
if (netplay) if (netplay)
netplay_flip_players(netplay); netplay_flip_users(netplay);
} }
#endif #endif
break; break;

View File

@ -1336,12 +1336,12 @@ static void parse_config_file(void)
} }
static void read_keybinds_keyboard(config_file_t *conf, unsigned player, static void read_keybinds_keyboard(config_file_t *conf, unsigned user,
unsigned idx, struct retro_keybind *bind) unsigned idx, struct retro_keybind *bind)
{ {
if (input_config_bind_map[idx].valid && input_config_bind_map[idx].base) if (input_config_bind_map[idx].valid && input_config_bind_map[idx].base)
{ {
const char *prefix = input_config_get_prefix(player, const char *prefix = input_config_get_prefix(user,
input_config_bind_map[idx].meta); input_config_bind_map[idx].meta);
if (prefix) if (prefix)
input_config_parse_key(conf, prefix, input_config_parse_key(conf, prefix,
@ -1349,12 +1349,12 @@ static void read_keybinds_keyboard(config_file_t *conf, unsigned player,
} }
} }
static void read_keybinds_button(config_file_t *conf, unsigned player, static void read_keybinds_button(config_file_t *conf, unsigned user,
unsigned idx, struct retro_keybind *bind) unsigned idx, struct retro_keybind *bind)
{ {
if (input_config_bind_map[idx].valid && input_config_bind_map[idx].base) if (input_config_bind_map[idx].valid && input_config_bind_map[idx].base)
{ {
const char *prefix = input_config_get_prefix(player, const char *prefix = input_config_get_prefix(user,
input_config_bind_map[idx].meta); input_config_bind_map[idx].meta);
if (prefix) if (prefix)
input_config_parse_joy_button(conf, prefix, input_config_parse_joy_button(conf, prefix,
@ -1362,12 +1362,12 @@ static void read_keybinds_button(config_file_t *conf, unsigned player,
} }
} }
static void read_keybinds_axis(config_file_t *conf, unsigned player, static void read_keybinds_axis(config_file_t *conf, unsigned user,
unsigned idx, struct retro_keybind *bind) unsigned idx, struct retro_keybind *bind)
{ {
if (input_config_bind_map[idx].valid && input_config_bind_map[idx].base) if (input_config_bind_map[idx].valid && input_config_bind_map[idx].base)
{ {
const char *prefix = input_config_get_prefix(player, const char *prefix = input_config_get_prefix(user,
input_config_bind_map[idx].meta); input_config_bind_map[idx].meta);
if (prefix) if (prefix)
input_config_parse_joy_axis(conf, prefix, input_config_parse_joy_axis(conf, prefix,
@ -1375,20 +1375,20 @@ static void read_keybinds_axis(config_file_t *conf, unsigned player,
} }
} }
static void read_keybinds_player(config_file_t *conf, unsigned player) static void read_keybinds_user(config_file_t *conf, unsigned user)
{ {
unsigned i; unsigned i;
for (i = 0; input_config_bind_map[i].valid; i++) for (i = 0; input_config_bind_map[i].valid; i++)
{ {
struct retro_keybind *bind = (struct retro_keybind*) struct retro_keybind *bind = (struct retro_keybind*)
&g_settings.input.binds[player][i]; &g_settings.input.binds[user][i];
if (!bind->valid) if (!bind->valid)
continue; continue;
read_keybinds_keyboard(conf, player, i, bind); read_keybinds_keyboard(conf, user, i, bind);
read_keybinds_button(conf, player, i, bind); read_keybinds_button(conf, user, i, bind);
read_keybinds_axis(conf, player, i, bind); read_keybinds_axis(conf, user, i, bind);
} }
} }
@ -1396,7 +1396,7 @@ static void config_read_keybinds_conf(config_file_t *conf)
{ {
unsigned i; unsigned i;
for (i = 0; i < MAX_PLAYERS; i++) for (i = 0; i < MAX_PLAYERS; i++)
read_keybinds_player(conf, i); read_keybinds_user(conf, i);
} }
#if 0 #if 0
@ -1512,16 +1512,16 @@ static void save_keybind(config_file_t *conf, const char *prefix,
save_keybind_axis(conf, prefix, base, bind); save_keybind_axis(conf, prefix, base, bind);
} }
static void save_keybinds_player(config_file_t *conf, unsigned player) static void save_keybinds_user(config_file_t *conf, unsigned user)
{ {
unsigned i = 0; unsigned i = 0;
for (i = 0; input_config_bind_map[i].valid; i++) for (i = 0; input_config_bind_map[i].valid; i++)
{ {
const char *prefix = input_config_get_prefix(player, const char *prefix = input_config_get_prefix(user,
input_config_bind_map[i].meta); input_config_bind_map[i].meta);
if (prefix) if (prefix)
save_keybind(conf, prefix, input_config_bind_map[i].base, save_keybind(conf, prefix, input_config_bind_map[i].base,
&g_settings.input.binds[player][i]); &g_settings.input.binds[user][i]);
} }
} }
@ -1791,7 +1791,7 @@ bool config_save_file(const char *path)
} }
for (i = 0; i < MAX_PLAYERS; i++) for (i = 0; i < MAX_PLAYERS; i++)
save_keybinds_player(conf, i); save_keybinds_user(conf, i);
config_set_bool(conf, "core_specific_config", config_set_bool(conf, "core_specific_config",
g_settings.core_specific_config); g_settings.core_specific_config);

View File

@ -1217,7 +1217,7 @@ static int setting_data_bind_action_ok(void *data, unsigned action)
driver.menu->binds.begin = setting->bind_type; driver.menu->binds.begin = setting->bind_type;
driver.menu->binds.last = setting->bind_type; driver.menu->binds.last = setting->bind_type;
driver.menu->binds.target = keybind; driver.menu->binds.target = keybind;
driver.menu->binds.player = setting->index_offset; driver.menu->binds.user = setting->index_offset;
menu_list_push_stack( menu_list_push_stack(
driver.menu->menu_list, driver.menu->menu_list,
"", "",
@ -2083,7 +2083,7 @@ int setting_data_get_description(const char *label, char *msg,
"where (d) is slot number."); "where (d) is slot number.");
else if (!strcmp(label, "netplay_flip_players")) else if (!strcmp(label, "netplay_flip_players"))
snprintf(msg, sizeof_msg, snprintf(msg, sizeof_msg,
" -- Netplay flip players."); " -- Netplay flip users.");
else if (!strcmp(label, "frame_advance")) else if (!strcmp(label, "frame_advance"))
snprintf(msg, sizeof_msg, snprintf(msg, sizeof_msg,
" -- Frame advance when content is paused."); " -- Frame advance when content is paused.");
@ -2174,7 +2174,7 @@ int setting_data_get_description(const char *label, char *msg,
snprintf(msg, sizeof_msg, snprintf(msg, sizeof_msg,
" -- Input Device. \n" " -- Input Device. \n"
" \n" " \n"
"Picks which gamepad to use for player N. \n" "Picks which gamepad to use for user N. \n"
"The name of the pad is available." "The name of the pad is available."
); );
else if (!strcmp(label, "input_bind_device_type")) else if (!strcmp(label, "input_bind_device_type"))
@ -4292,7 +4292,7 @@ static bool setting_data_append_list_input_options(
{ {
rarch_setting_group_info_t group_info; rarch_setting_group_info_t group_info;
rarch_setting_group_info_t subgroup_info; rarch_setting_group_info_t subgroup_info;
unsigned i, player; unsigned i, user;
START_GROUP(group_info, "Input Options"); START_GROUP(group_info, "Input Options");
START_SUB_GROUP(list, list_info, "State", group_info.name, subgroup_info); START_SUB_GROUP(list, list_info, "State", group_info.name, subgroup_info);
@ -4342,11 +4342,11 @@ static bool setting_data_append_list_input_options(
general_write_handler, general_write_handler,
general_read_handler); general_read_handler);
for (player = 0; player < MAX_PLAYERS; player ++) for (user = 0; user < MAX_PLAYERS; user ++)
{ {
/* These constants match the string lengths. /* These constants match the string lengths.
* Keep them up to date or you'll get some really obvious bugs. * Keep them up to date or you'll get some really obvious bugs.
* 2 is the length of '99'; we don't need more players than that. * 2 is the length of '99'; we don't need more users than that.
*/ */
/* FIXME/TODO - really need to clean up this mess in some way. */ /* FIXME/TODO - really need to clean up this mess in some way. */
static char key[MAX_PLAYERS][64]; static char key[MAX_PLAYERS][64];
@ -4361,83 +4361,83 @@ static bool setting_data_append_list_input_options(
static char label_bind_all[MAX_PLAYERS][64]; static char label_bind_all[MAX_PLAYERS][64];
static char label_bind_defaults[MAX_PLAYERS][64]; static char label_bind_defaults[MAX_PLAYERS][64];
snprintf(key[player], sizeof(key[player]), snprintf(key[user], sizeof(key[user]),
"input_player%d_joypad_index", player + 1); "input_player%d_joypad_index", user + 1);
snprintf(key_type[player], sizeof(key_type[player]), snprintf(key_type[user], sizeof(key_type[user]),
"input_libretro_device_p%u", player + 1); "input_libretro_device_p%u", user + 1);
snprintf(key_analog[player], sizeof(key_analog[player]), snprintf(key_analog[user], sizeof(key_analog[user]),
"input_player%u_analog_dpad_mode", player + 1); "input_player%u_analog_dpad_mode", user + 1);
snprintf(key_bind_all[player], sizeof(key_bind_all[player]), snprintf(key_bind_all[user], sizeof(key_bind_all[user]),
"input_player%u_bind_all", player + 1); "input_player%u_bind_all", user + 1);
snprintf(key_bind_defaults[player], sizeof(key_bind_defaults[player]), snprintf(key_bind_defaults[user], sizeof(key_bind_defaults[user]),
"input_player%u_bind_defaults", player + 1); "input_player%u_bind_defaults", user + 1);
snprintf(label[player], sizeof(label[player]), snprintf(label[user], sizeof(label[user]),
"User %d Device Index", player + 1); "User %d Device Index", user + 1);
snprintf(label_type[player], sizeof(label_type[player]), snprintf(label_type[user], sizeof(label_type[user]),
"User %d Device Type", player + 1); "User %d Device Type", user + 1);
snprintf(label_analog[player], sizeof(label_analog[player]), snprintf(label_analog[user], sizeof(label_analog[user]),
"User %d Analog To Digital Type", player + 1); "User %d Analog To Digital Type", user + 1);
snprintf(label_bind_all[player], sizeof(label_bind_all[player]), snprintf(label_bind_all[user], sizeof(label_bind_all[user]),
"User %d Bind All", player + 1); "User %d Bind All", user + 1);
snprintf(label_bind_defaults[player], sizeof(label_bind_defaults[player]), snprintf(label_bind_defaults[user], sizeof(label_bind_defaults[user]),
"User %d Bind Default All", player + 1); "User %d Bind Default All", user + 1);
CONFIG_UINT( CONFIG_UINT(
g_settings.input.libretro_device[player], g_settings.input.libretro_device[user],
key_type[player], key_type[user],
label_type[player], label_type[user],
player, user,
group_info.name, group_info.name,
subgroup_info.name, subgroup_info.name,
general_write_handler, general_write_handler,
general_read_handler); general_read_handler);
(*list)[list_info->index - 1].index = player + 1; (*list)[list_info->index - 1].index = user + 1;
(*list)[list_info->index - 1].index_offset = player; (*list)[list_info->index - 1].index_offset = user;
(*list)[list_info->index - 1].action_toggle = &setting_data_uint_action_toggle_libretro_device_type; (*list)[list_info->index - 1].action_toggle = &setting_data_uint_action_toggle_libretro_device_type;
(*list)[list_info->index - 1].action_start = &setting_data_uint_action_start_libretro_device_type; (*list)[list_info->index - 1].action_start = &setting_data_uint_action_start_libretro_device_type;
CONFIG_UINT( CONFIG_UINT(
g_settings.input.analog_dpad_mode[player], g_settings.input.analog_dpad_mode[user],
key_analog[player], key_analog[user],
label_analog[player], label_analog[user],
player, user,
group_info.name, group_info.name,
subgroup_info.name, subgroup_info.name,
general_write_handler, general_write_handler,
general_read_handler); general_read_handler);
(*list)[list_info->index - 1].index = player + 1; (*list)[list_info->index - 1].index = user + 1;
(*list)[list_info->index - 1].index_offset = player; (*list)[list_info->index - 1].index_offset = user;
(*list)[list_info->index - 1].action_toggle = &setting_data_uint_action_toggle_analog_dpad_mode; (*list)[list_info->index - 1].action_toggle = &setting_data_uint_action_toggle_analog_dpad_mode;
(*list)[list_info->index - 1].action_start = &setting_data_uint_action_start_analog_dpad_mode; (*list)[list_info->index - 1].action_start = &setting_data_uint_action_start_analog_dpad_mode;
CONFIG_ACTION( CONFIG_ACTION(
key[player], key[user],
label[player], label[user],
group_info.name, group_info.name,
subgroup_info.name); subgroup_info.name);
(*list)[list_info->index - 1].index = player + 1; (*list)[list_info->index - 1].index = user + 1;
(*list)[list_info->index - 1].index_offset = player; (*list)[list_info->index - 1].index_offset = user;
(*list)[list_info->index - 1].action_start = &setting_data_action_start_bind_device; (*list)[list_info->index - 1].action_start = &setting_data_action_start_bind_device;
(*list)[list_info->index - 1].action_toggle = &setting_data_action_toggle_bind_device; (*list)[list_info->index - 1].action_toggle = &setting_data_action_toggle_bind_device;
(*list)[list_info->index - 1].get_string_representation = &get_string_representation_bind_device; (*list)[list_info->index - 1].get_string_representation = &get_string_representation_bind_device;
CONFIG_ACTION( CONFIG_ACTION(
key_bind_all[player], key_bind_all[user],
label_bind_all[player], label_bind_all[user],
group_info.name, group_info.name,
subgroup_info.name); subgroup_info.name);
(*list)[list_info->index - 1].index = player + 1; (*list)[list_info->index - 1].index = user + 1;
(*list)[list_info->index - 1].index_offset = player; (*list)[list_info->index - 1].index_offset = user;
(*list)[list_info->index - 1].action_ok = &setting_data_action_ok_bind_all; (*list)[list_info->index - 1].action_ok = &setting_data_action_ok_bind_all;
CONFIG_ACTION( CONFIG_ACTION(
key_bind_defaults[player], key_bind_defaults[user],
label_bind_defaults[player], label_bind_defaults[user],
group_info.name, group_info.name,
subgroup_info.name); subgroup_info.name);
(*list)[list_info->index - 1].index = player + 1; (*list)[list_info->index - 1].index = user + 1;
(*list)[list_info->index - 1].index_offset = player; (*list)[list_info->index - 1].index_offset = user;
(*list)[list_info->index - 1].action_ok = &setting_data_action_ok_bind_defaults; (*list)[list_info->index - 1].action_ok = &setting_data_action_ok_bind_defaults;
} }
@ -4485,7 +4485,7 @@ static bool setting_data_append_list_input_options(
END_SUB_GROUP(list, list_info); END_SUB_GROUP(list, list_info);
/* The second argument to config bind is 1 /* The second argument to config bind is 1
* based for players and 0 only for meta keys. */ * based for users and 0 only for meta keys. */
START_SUB_GROUP( START_SUB_GROUP(
list, list,
list_info, list_info,
@ -4508,22 +4508,22 @@ static bool setting_data_append_list_input_options(
} }
END_SUB_GROUP(list, list_info); END_SUB_GROUP(list, list_info);
for (player = 0; player < MAX_PLAYERS; player ++) for (user = 0; user < MAX_PLAYERS; user++)
{ {
/* This constants matches the string length. /* This constants matches the string length.
* Keep it up to date or you'll get some really obvious bugs. * Keep it up to date or you'll get some really obvious bugs.
* 2 is the length of '99'; we don't need more players than that. * 2 is the length of '99'; we don't need more users than that.
*/ */
static char buffer[MAX_PLAYERS][7+2+1]; static char buffer[MAX_PLAYERS][7+2+1];
const struct retro_keybind* const defaults = const struct retro_keybind* const defaults =
(player == 0) ? retro_keybinds_1 : retro_keybinds_rest; (user == 0) ? retro_keybinds_1 : retro_keybinds_rest;
snprintf(buffer[player], sizeof(buffer[player]), "User %d", player + 1); snprintf(buffer[user], sizeof(buffer[user]), "User %d", user + 1);
START_SUB_GROUP( START_SUB_GROUP(
list, list,
list_info, list_info,
buffer[player], buffer[user],
group_info.name, group_info.name,
subgroup_info); subgroup_info);
@ -4543,17 +4543,17 @@ static bool setting_data_append_list_input_options(
&& (g_extern.has_set_input_descriptors) && (g_extern.has_set_input_descriptors)
&& (i != RARCH_TURBO_ENABLE) && (i != RARCH_TURBO_ENABLE)
) )
snprintf(label, sizeof(label), "%s %s", buffer[player], snprintf(label, sizeof(label), "%s %s", buffer[user],
g_extern.system.input_desc_btn[player][i] ? g_extern.system.input_desc_btn[player][i] : "N/A"); g_extern.system.input_desc_btn[user][i] ? g_extern.system.input_desc_btn[user][i] : "N/A");
else else
snprintf(label, sizeof(label), "%s %s", buffer[player], keybind->desc); snprintf(label, sizeof(label), "%s %s", buffer[user], keybind->desc);
snprintf(name, sizeof(name), "p%u_%s", player + 1, keybind->base); snprintf(name, sizeof(name), "p%u_%s", user + 1, keybind->base);
CONFIG_BIND( CONFIG_BIND(
g_settings.input.binds[player][i], g_settings.input.binds[user][i],
player + 1, user + 1,
player, user,
strdup(name), /* TODO: Find a way to fix these memleaks. */ strdup(name), /* TODO: Find a way to fix these memleaks. */
strdup(label), strdup(label),
&defaults[i], &defaults[i],