Skip to content

Conversation

ABeltramo
Copy link
Contributor

@ABeltramo ABeltramo commented Mar 19, 2025

This is part of a series of PRs:

Moonlight client

Sunshine server

20250319_175750.mp4

// 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;
Copy link
Member

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?

Copy link
Contributor Author

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.

// https://gist.github.com/Nielk1/6d54cc2c00d2201ccb8c2720ad7538db
uint8_t *left;
uint8_t *right;
} ds_adaptive_trigger;
Copy link
Member

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.

@ABeltramo
Copy link
Contributor Author

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!

@ABeltramo
Copy link
Contributor Author

Sorry about that, I should have fixed all the remaining cases.

@cgutman cgutman merged commit e95feaf into moonlight-stream:master Mar 25, 2025
1 check passed
cfalas pushed a commit to cfalas/moonlight-common-c that referenced this pull request May 17, 2025
cfalas pushed a commit to cfalas/moonlight-common-c that referenced this pull request May 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants