File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -2631,14 +2631,14 @@ bool SDL_IsGamepad(SDL_JoystickID instance_id)
2631
2631
{
2632
2632
const void * value ;
2633
2633
SDL_JoystickType js_type = SDL_GetJoystickTypeForID (instance_id );
2634
- if (js_type != SDL_JOYSTICK_TYPE_GAMEPAD && js_type != SDL_JOYSTICK_TYPE_UNKNOWN )
2635
- {
2636
- // avoid creating HIDAPI mapping if type is SDL_Joystick knows it is not a game pad
2637
- result = false;
2638
- } else if (SDL_FindInHashTable (s_gamepadInstanceIDs , (void * )(uintptr_t )instance_id , & value )) {
2634
+ if (SDL_FindInHashTable (s_gamepadInstanceIDs , (void * )(uintptr_t )instance_id , & value )) {
2639
2635
result = (bool )(uintptr_t )value ;
2640
2636
} else {
2641
- if (SDL_PrivateGetGamepadMapping (instance_id , true) != NULL ) {
2637
+ SDL_JoystickType js_type = SDL_GetJoystickTypeForID (instance_id );
2638
+ if (js_type != SDL_JOYSTICK_TYPE_GAMEPAD && js_type != SDL_JOYSTICK_TYPE_UNKNOWN ) {
2639
+ // avoid creating HIDAPI mapping if SDL_Joystick knows it is not a game pad
2640
+ result = false;
2641
+ } else if (SDL_PrivateGetGamepadMapping (instance_id , true) != NULL ) {
2642
2642
result = true;
2643
2643
} else {
2644
2644
result = false;
You can’t perform that action at this time.
0 commit comments