Skip to content

Commit

Permalink
Refactor event_init_controllers
Browse files Browse the repository at this point in the history
  • Loading branch information
inactive123 committed Jan 27, 2016
1 parent f634296 commit 87176df
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions command_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,8 @@ static void event_init_controllers(void)

for (i = 0; i < MAX_USERS; i++)
{
const char *ident = NULL;
const char *ident = NULL;
bool set_controller = false;
const struct retro_controller_description *desc = NULL;
unsigned device = settings->input.libretro_device[i];

Expand Down Expand Up @@ -363,7 +364,7 @@ static void event_init_controllers(void)
{
case RETRO_DEVICE_NONE:
RARCH_LOG("Disconnecting device from port %u.\n", i + 1);
core.retro_set_controller_port_device(i, device);
set_controller = true;
break;
case RETRO_DEVICE_JOYPAD:
break;
Expand All @@ -373,9 +374,12 @@ static void event_init_controllers(void)
* cores needlessly. */
RARCH_LOG("Connecting %s (ID: %u) to port %u.\n", ident,
device, i + 1);
core.retro_set_controller_port_device(i, device);
set_controller = true;
break;
}

if (set_controller)
core.retro_set_controller_port_device(i, device);
}
}

Expand Down

0 comments on commit 87176df

Please sign in to comment.