Skip to content

Commit

Permalink
Fix GameCube controller power level being reset to unknown
Browse files Browse the repository at this point in the history
HIDAPI_DriverGameCube_OpenJoystick() set power level to wired and then
it was set to unknown in SDL_JoystickOpen().
  • Loading branch information
zturtleman committed Jun 19, 2019
1 parent bd95290 commit b23cce2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/joystick/SDL_joystick.c
Expand Up @@ -323,6 +323,7 @@ SDL_JoystickOpen(int device_index)
joystick->instance_id = instance_id;
joystick->attached = SDL_TRUE;
joystick->player_index = -1;
joystick->epowerlevel = SDL_JOYSTICK_POWER_UNKNOWN;

if (driver->Open(joystick, device_index) < 0) {
SDL_free(joystick);
Expand Down Expand Up @@ -360,7 +361,6 @@ SDL_JoystickOpen(int device_index)
SDL_UnlockJoysticks();
return NULL;
}
joystick->epowerlevel = SDL_JOYSTICK_POWER_UNKNOWN;

/* If this joystick is known to have all zero centered axes, skip the auto-centering code */
if (SDL_JoystickAxesCenteredAtZero(joystick)) {
Expand Down

0 comments on commit b23cce2

Please sign in to comment.