-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Deps: Update to SDL3 #12311
Deps: Update to SDL3 #12311
Conversation
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.
A look through the code comparing some of the basic stuff with the SDL3 migration manual seems good, but somebody more qualified is going to need to take a look at more complex migration stuff like SDLInputSource.cpp lines 732 to 755 to see if they track. Testing for about 20 minutes revealed no obvious errors introduced or fixed in the audio or controller.
Rebased to include the SDL audio hint I'm now using Regarding TellowKrinkle's comments, I think I will go with the approach of breaking old binds |
I had missed that SDL3 added additional buttons to the standard gamepad (asserts have been added to catch this in future) Adding support for these buttons required adjusting how unmapped* joystick bindings where done, as internally we offset these to after the standard gamepad buttons. The following steps will be performed *unmapped refers to SDL not having gamepad mappings for its standard layout, instead having numbered buttons and axes. |
Added generating more readable text for UI, for SDL this will also reflect the label on the buttons for PS controllers (and the ABXY labels for Nintendo controllers as per SDL2) Add migration from SDL2's label based assignment to SDL3's positional based assignment |
f553a6e
to
5a2a011
Compare
I think this is ready for review and further testing |
3c82517
to
15231d9
Compare
Just tested FSUI with a switch controller and A is back and B is forwards. Also minor nitpick: If you shift-click a binding and add that way, the internal button name is used instead of the display name until you close and reopen the interface. |
Except for our own ControllerData structure, which retains its name
Also rename these bindings to avoid conflicts with binds
Also add asserts to ensure name arrays match the length of the SDL enums
Keyboard keys are still not spaced, but otherwise matches the same format
… enhanced reports
Ahh okay. In that case, we need a warning that it needs to be enabled for wired switch controllers on macOS (especially since we default to 0, so by default wired switch controllers won't work). Also since this affects more than just PS controllers in SDL3, we might want to change the UI label. |
Oh? SDL 3.2.6 didn't fix this? |
Testing now, but from the change, I suspect it fixed |
Never mind it's fixed for both values |
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.
Quick test on macOS with my Xbox One controller had positive results.
My original mappings migrated over fine. Remapping worked fine. Input as a whole worked fine.
Description of Changes
Rationale behind Changes
SDL3 is the hip new thing in town!
Single motor haptic feedback logic seemed incorrect
SDL allows us to fetch information about the connected controller, allowing us to display a name matching its buttons.
The above put in place infrastructure that then allows us to display more readable text for binds, and other sources got the same treatment for consistency.
RFC
SDL3 provides a default value for output latency (Sample frames in SDL terms) and recommends that we use that
I've opted instead to specify the user set value (via
SDL_HINT_AUDIO_DEVICE_SAMPLE_FRAMES
)Do we want to offer UI for the default rate? or always use the default value, or keep what I've done?
Note: This value gets ignored on Windows (matching SDL2 here) so this would only effect Linux (and Mac?).
SDL3's audio system requires us to call a function to put data, instead of copying into a memory buffer like with SDL2/Cubeb.
Currently a temporary buffer is used, rather then adapting
AudioStream::ReadFrames()
to be able to use a function.Is this suitable? or would we want
ReadFrames()
to be able to use a Put function?SDL3 renamed the face buttons to compass directions (with a function to get the label).We now save the new namesI, however, have retained the old names in our
ConvertKeyToString()
as this is what gets saved to our config file, in addition to what is displayed in the config screen.How are we wanting the commits squashed? given both me and Tech worked on this?
Suggested Testing Steps
Note that the new or migrated binds may not work on SDL2 builds after testing with this PR
SDL_HAPTIC_LEFTRIGHT
, and those that don't.