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

Logic & UI for "Virtual Notches" #9203

Merged
merged 1 commit into from Nov 3, 2020

Conversation

nick-michael
Copy link
Contributor

@nick-michael nick-michael commented Oct 27, 2020

This is a feature that I wanted in Dolphin for quite some time now. It should make playing games like Super Monkey Ball feel a bit closer to using a GC controller when using a controller without an Octagonal gate (e.g. Xbox, PS4, Steam e.t.c).

Adds an option in the controller config to set the size of the virtual notches. These virtual notches add a sticky behaviour that will snap the controller to the different axis.

ezgif com-gif-maker (3)

Disclaimer:
I've never written C++ before (besides Hello World about 10 years ago) so I'm completely open to suggestions for improvements. I was unable to get the linter running locally but I think Visual Studio was enforcing code styling while developing so I'm hoping it's already formatted correctly.

@nick-michael
Copy link
Contributor Author

@lioncash Cheers for the review! Please check my most recent changes and mark as resolved if all is fine, otherwise let me know what I got wrong and I'll happily take another look 👍

Copy link
Member

@lioncash lioncash left a comment

Choose a reason for hiding this comment

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

Only a few minor nits, otherwise the changes in response to the suggestions look pretty good!

Source/Core/InputCommon/ControllerEmu/StickGate.cpp Outdated Show resolved Hide resolved
Source/Core/InputCommon/ControllerEmu/StickGate.cpp Outdated Show resolved Hide resolved
Source/Core/DolphinQt/Config/Mapping/MappingIndicator.cpp Outdated Show resolved Hide resolved
Source/Core/DolphinQt/Config/Mapping/MappingIndicator.cpp Outdated Show resolved Hide resolved
Source/Core/DolphinQt/Config/Mapping/MappingIndicator.cpp Outdated Show resolved Hide resolved
Source/Core/InputCommon/ControllerEmu/StickGate.cpp Outdated Show resolved Hide resolved
@JMC47
Copy link
Contributor

JMC47 commented Oct 27, 2020

I do believe something like this would be very helpful in games that use notches. It's one of the reasons I use original GameCube controllers via adapter for most games.

Copy link
Member

@jordan-woyak jordan-woyak left a comment

Choose a reason for hiding this comment

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

Super neat feature. I just had a few suggestions.
Your code was not too bad for being new to C++.
The main thing was ApplyVirtualNotches being overly complicated.

Source/Core/InputCommon/ControllerEmu/StickGate.cpp Outdated Show resolved Hide resolved
Source/Core/InputCommon/ControllerEmu/StickGate.cpp Outdated Show resolved Hide resolved
Source/Core/InputCommon/ControllerEmu/StickGate.cpp Outdated Show resolved Hide resolved
Source/Core/DolphinQt/Config/Mapping/MappingIndicator.cpp Outdated Show resolved Hide resolved
@nick-michael
Copy link
Contributor Author

NULL isn't a special value and isn't doing what you think it is. You're basically just writing 0.0 here.
I don't know why you changed this. Always assigning angle in Rehape was fine.

Ahh I left that in from when I was making additional changes to the dist value that should only be applied when inside a virtual notch. I removed that code so this can also be reverted to your original suggestion

Copy link
Member

@jordan-woyak jordan-woyak left a comment

Choose a reason for hiding this comment

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

After fixing the lint issues and squashing the commits this looks good to me.

@jordan-woyak jordan-woyak merged commit 3cd4c56 into dolphin-emu:master Nov 3, 2020
10 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