-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix joystick events in WaitEventTimeout, fix HapticRumbleSupported return value #238
Conversation
src/sdl3_syms.h
Outdated
@@ -429,7 +432,7 @@ SDL3_SYM_RENAMED_RETCODE(bool,HapticPause,PauseHaptic,(SDL_Haptic *a),(a),return | |||
SDL3_SYM_RENAMED_RETCODE(bool,HapticRumbleInit,InitHapticRumble,(SDL_Haptic *a),(a),return) | |||
SDL3_SYM_RENAMED_RETCODE(bool,HapticRumblePlay,PlayHapticRumble,(SDL_Haptic *a, float b, Uint32 c),(a,b,c),return) | |||
SDL3_SYM_RENAMED_RETCODE(bool,HapticRumbleStop,StopHapticRumble,(SDL_Haptic *a),(a),return) | |||
SDL3_SYM_PASSTHROUGH_RETCODE(bool,HapticRumbleSupported,(SDL_Haptic *a),(a),return) | |||
SDL3_SYM_PASSTHROUGH_INT_BOOL(bool,HapticRumbleSupported,(SDL_Haptic *a),(a),return) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How did this not error before?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SDL3_SYM_PASSTHROUGH_RETCODE matches type but returns 0 and -1, which flips the outcome
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be changed to a wrapper function rather than adding a new passthrough macro.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implemented SDL_HapticRumbleSupported as a wrapper function instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SDL3_SYM_PASSTHROUGH_RETCODE matches type but returns 0 and -1, which flips the outcome
I wonder whether there are any other places where we screwed up like that. (I hope not..)
src/sdl2_compat.c
Outdated
return SDL3_GetBooleanProperty(SDL3_GetJoystickProperties(joystick), SDL_PROP_JOYSTICK_CAP_RGB_LED_BOOLEAN, false) ? SDL2_TRUE : SDL2_FALSE; | ||
bool has_led = SDL3_GetBooleanProperty(SDL3_GetJoystickProperties(joystick), SDL_PROP_JOYSTICK_CAP_RGB_LED_BOOLEAN, false) || | ||
SDL3_GetBooleanProperty(SDL3_GetJoystickProperties(joystick), SDL_PROP_JOYSTICK_CAP_MONO_LED_BOOLEAN, false); | ||
return has_led ? SDL2_TRUE : SDL2_FALSE; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SDL_JoystickHasLED() in SDL2 only returned true for RGB LED support. This change should be dropped.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
retracted the commit changing JoystickHasLED
800f836
to
e2da18b
Compare
e2da18b
to
50ada75
Compare
50ada75
to
ac556b8
Compare
@slouken: is this good now? |
Merged, thanks! |
I think SDL_PROP_JOYSTICK_CAP_MONO_LED_BOOLEAN should be mapped to JoystickHasLED true, but I'm unsure
update: not changing JoystickHasLED anymore