Skip to content
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

Is the Section trigger effect set up properly? #26

Open
BLesnau opened this issue Jun 9, 2021 · 1 comment
Open

Is the Section trigger effect set up properly? #26

BLesnau opened this issue Jun 9, 2021 · 1 comment

Comments

@BLesnau
Copy link

BLesnau commented Jun 9, 2021

In processTrigger(), the code for the Continuous trigger effect looks like this:

case DS5W::TriggerEffectType::ContinuousResitance:
// Mode
buffer[0x00] = 0x01;
// Parameters
buffer[0x01] = ptrEffect->Continuous.startPosition;
buffer[0x02] = ptrEffect->Continuous.force;
break;

And the code for the Section trigger effect looks like this:

case DS5W::TriggerEffectType::SectionResitance:
// Mode
buffer[0x00] = 0x02;
// Parameters
buffer[0x01] = ptrEffect->Continuous.startPosition;
buffer[0x02] = ptrEffect->Continuous.force;
break;

The Section trigger effect sets the first part of the array to a different value, which probably makes it do the Section effect rather than the Continuous effect, but the rest of that code actually uses the values from the Continuous effect.

The value for the end position should be put somewhere, correct?

Also, shouldn't the struct for the Section effect contain a value for the force to be used?

@BLesnau BLesnau changed the title Is the Section trigger effect setup properly? Is the Section trigger effect set up properly? Jun 9, 2021
@AliElSaleh
Copy link

Technically, it is setup properly. Because the trigger effect types are all wrapped in a union, meaning all members in the struct will share the same memory space, think of it as structs overlaying over each other. So startPosition of struct Continuous would have the same value as startPosition of struct Section, due to how it's laid out in the structs. But of course, it should still use the Section struct, for readability.

And yeah a force parameter for the Section type would be useful as well.

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

No branches or pull requests

2 participants