-
Notifications
You must be signed in to change notification settings - Fork 199
Protocol extension: DualSense adaptive trigger support #102
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
Conversation
src/ControlStream.c
Outdated
// if you are curious about the actual data, there's some rationale in | ||
// https://gist.github.com/Nielk1/6d54cc2c00d2201ccb8c2720ad7538db | ||
uint8_t *left; | ||
uint8_t *right; |
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.
Any reason not to just define the left[DS_EFFECT_PAYLOAD_SIZE]
and right[DS_EFFECT_PAYLOAD_SIZE]
arrays here and avoid having additional allocations?
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.
I was trying to keep the copies at a minimum, and I started with a pointer in the callback function definition. I agree though, better to keep the code simple and avoid another mallov; I've updated the code to use plain arrays instead.
src/ControlStream.c
Outdated
// https://gist.github.com/Nielk1/6d54cc2c00d2201ccb8c2720ad7538db | ||
uint8_t *left; | ||
uint8_t *right; | ||
} ds_adaptive_trigger; |
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.
Please use camel case for variables, arguments, and fields.
I've pushed a few fixes and tested all the patches together in Helldivers 2, which seems to have a lot of effects. I should've addressed all comments. Let me know what you think! |
Sorry about that, I should have fixed all the remaining cases. |
This is part of a series of PRs:
Moonlight client
moonlight-common-c
and exposes the adaptive trigger events via SDLSunshine server
moonlight-common-c
andinputtino
and delivers the adaptive trigger events to Moonlight clients20250319_175750.mp4