mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2024-12-25 09:17:12 +01:00
Fix GameCube controller power level being reset to unknown
HIDAPI_DriverGameCube_OpenJoystick() set power level to wired and then it was set to unknown in SDL_JoystickOpen().
This commit is contained in:
parent
bd95290075
commit
b23cce282e
@ -323,6 +323,7 @@ SDL_JoystickOpen(int device_index)
|
|||||||
joystick->instance_id = instance_id;
|
joystick->instance_id = instance_id;
|
||||||
joystick->attached = SDL_TRUE;
|
joystick->attached = SDL_TRUE;
|
||||||
joystick->player_index = -1;
|
joystick->player_index = -1;
|
||||||
|
joystick->epowerlevel = SDL_JOYSTICK_POWER_UNKNOWN;
|
||||||
|
|
||||||
if (driver->Open(joystick, device_index) < 0) {
|
if (driver->Open(joystick, device_index) < 0) {
|
||||||
SDL_free(joystick);
|
SDL_free(joystick);
|
||||||
@ -360,7 +361,6 @@ SDL_JoystickOpen(int device_index)
|
|||||||
SDL_UnlockJoysticks();
|
SDL_UnlockJoysticks();
|
||||||
return NULL;
|
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 this joystick is known to have all zero centered axes, skip the auto-centering code */
|
||||||
if (SDL_JoystickAxesCenteredAtZero(joystick)) {
|
if (SDL_JoystickAxesCenteredAtZero(joystick)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user