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

Android: Use touch emulation of IR by default #8729

Merged
merged 1 commit into from Apr 27, 2020

Conversation

JosJuice
Copy link
Member

@JosJuice JosJuice commented Apr 7, 2020

While having motion control emulation of IR enabled by default makes sense in situations like using a DualShock 4 on a PC, Android has the additional option of touch emulation of IR which seems to be better liked, and the default value which was chosen with PC in mind was carried over to Android without any particular consideration. This change disables motion control emulation of IR by default on Android only.

enum class CanBeDisabled
{
No,
Yes,
AlwaysEnabled,
EnabledByDefault,
DisabledByDefault,
};

explicit ControlGroup(std::string name, GroupType type = GroupType::Other,
CanBeDisabled can_be_disabled = CanBeDisabled::No);
CanBeDisabled can_be_disabled = CanBeDisabled::AlwaysEnabled);
Copy link
Contributor

@rlnilsen rlnilsen Apr 11, 2020

Choose a reason for hiding this comment

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

Perhaps there is a reason you did it this way, but it seems more readable to leave the CanBeDisabled enum untouched and in stead initialize the ControlGroup's existing enabled member through an additional constructor argument, like this:

ControlGroup(std::string name, GroupType type = GroupType::Other, 
             CanBeDisabled can_be_disabled = CanBeDisabled::No, 
             EnabledByDefault enabled_by_default = EnabledByDefault::Yes);

edit: or

             Enabled enabled = Enabled::Yes);

Copy link
Member Author

Choose a reason for hiding this comment

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

Your suggestion works too, though I think it's more wordy. Does anyone else have an opinion on this?

Copy link
Member

Choose a reason for hiding this comment

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

I think I'd keep the one-enum solution, but rename CanBeDisabled to something like DefaultState, so that the options become DefaultState::Enabled, DefaultState::Disabled and DefaultState::AlwaysEnabled, which is more readable IMO. Using two enums has the drawback of making it possible to specify a nonsensical combination like (CanBeDisabled::No, EnabledByDefault::No).

Copy link
Member Author

Choose a reason for hiding this comment

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

I've made it use @leoetlino's suggestion.

While having motion control emulation of IR enabled by default
makes sense in situations like using a DualShock 4 on a PC,
Android has the additional option of touch emulation of IR
which seems to be better liked, and the default value which
was chosen with PC in mind was carried over to Android
without any particular consideration. This change disables
motion control emulation of IR by default on Android only.
@leoetlino leoetlino merged commit 88ae4c7 into dolphin-emu:master Apr 27, 2020
@JosJuice JosJuice deleted the android-touch-ir-default branch April 27, 2020 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants