Fixup setting_data_action_toggle_bind_device

This commit is contained in:
twinaphex 2014-10-24 09:52:35 +02:00
parent b38a36b2d6
commit 60258889cf
1 changed files with 11 additions and 13 deletions

View File

@ -832,27 +832,25 @@ static int setting_data_bool_action_toggle_savestates(void *data, unsigned actio
static int setting_data_action_toggle_bind_device(void *data, unsigned action) static int setting_data_action_toggle_bind_device(void *data, unsigned action)
{ {
int *p = NULL; unsigned *p = NULL;
rarch_setting_t *setting = (rarch_setting_t*)data; rarch_setting_t *setting = (rarch_setting_t*)data;
if (!setting || !driver.menu) if (!setting || !driver.menu)
return -1; return -1;
p = (int*)&g_settings.input.joypad_map[setting->index_offset]; p = (unsigned*)&g_settings.input.joypad_map[setting->index_offset];
if (action == MENU_ACTION_START) switch (action)
*p = 0;
else if (action == MENU_ACTION_LEFT)
{ {
if (*p > 0) case MENU_ACTION_LEFT:
if ((*p) > 0)
(*p)--; (*p)--;
} break;
else if (action == MENU_ACTION_RIGHT) case MENU_ACTION_RIGHT:
if (*p < MAX_PLAYERS)
(*p)++; (*p)++;
if (*p < -1) break;
*p = -1; }
else if (*p >= MAX_PLAYERS)
*p = MAX_PLAYERS - 1;
return 0; return 0;
} }