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

DolphinQt: StickWidget and IRWidget check for changed x/y before signaling change #11732

Merged

Conversation

malleoz
Copy link
Contributor

@malleoz malleoz commented Apr 6, 2023

This is a pretty inconsequential change, I just noticed this as I was skimming TAS-related code.

Even if your mouse moved ever-so-slightly as to not change the x/y position of the stick, or if you held down left-click and dragged your mouse off of the stick widget, it would continuously fire the ChangedX/Y signal as well as queue up a Qt re-draw for the widget.

I have no idea if this actually helps performance to any noticeable degree, but I just figured this is likely more beneficial than it could be harmful.
This appears to reduce window latency issues encountered when holding down frame advance and rotating the stick at the same time. It does not get rid of the latency, but definitely reduces it.

@malleoz malleoz changed the title DolphinQt: Check for changed x/y before signaling change DolphinQt: StickWidget Check for changed x/y before signaling change Apr 6, 2023
@malleoz malleoz changed the title DolphinQt: StickWidget Check for changed x/y before signaling change DolphinQt: StickWidget and IRWidget check for changed x/y before signaling change Apr 6, 2023
@malleoz malleoz force-pushed the malleo/limit_stick_emits branch 3 times, most recently from 7f50e76 to cd79207 Compare April 6, 2023 15:05
Copy link
Member

@JosJuice JosJuice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds reasonable.

@malleoz
Copy link
Contributor Author

malleoz commented Apr 6, 2023

After reviewing, this actually seems to help with latency issues encountered when holding down frame advance when TAS Input is the window-of-focus.

  1. Hold down frame advance
  2. Hold down left click and rotate stick
  3. Notice latency increases over time as update() calls stack up

This PR seems to reduce the latency noticed in step 3. Doesn't fix it, but definitely limits it a bit.

@Pokechu22
Copy link
Contributor

I assume this doesn't cause #11649 to regress? (It shouldn't from my understanding since this is the opposite direction, but it's worth double-checking.)

@malleoz
Copy link
Contributor Author

malleoz commented Apr 6, 2023

@Pokechu22 I've just verified that, with controller enabled, using controller to adjust sticks and IR are correctly updated/reflected in the TAS Input windows.

@AdmiralCurtiss AdmiralCurtiss merged commit d32e47c into dolphin-emu:master Apr 6, 2023
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants