summaryrefslogtreecommitdiff
path: root/src/yuzu/applets/qt_controller.cpp
diff options
context:
space:
mode:
authorNarr the Reg <juangerman-13@hotmail.com>2021-11-29 21:10:02 -0600
committerGitHub <noreply@github.com>2021-11-29 21:10:02 -0600
commit46e3ed5a483eac404ff1e2103ecc4e93e815d45b (patch)
treeb5317954b6692942ba01b262616a7979141c95fc /src/yuzu/applets/qt_controller.cpp
parente4492a9a821659cd0c4e874234020cdb630a108b (diff)
parent5deecd714b78233a4cec207b67d2a32c2defbf0a (diff)
Merge pull request #7472 from Morph1984/post-kraken-cleanup
core: hid: Post kraken cleanup
Diffstat (limited to 'src/yuzu/applets/qt_controller.cpp')
-rw-r--r--src/yuzu/applets/qt_controller.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/yuzu/applets/qt_controller.cpp b/src/yuzu/applets/qt_controller.cpp
index 7e80e7836..c5685db2e 100644
--- a/src/yuzu/applets/qt_controller.cpp
+++ b/src/yuzu/applets/qt_controller.cpp
@@ -139,7 +139,6 @@ QtControllerSelectorDialog::QtControllerSelectorDialog(
DisableUnsupportedPlayers();
for (std::size_t player_index = 0; player_index < NUM_PLAYERS; ++player_index) {
- system.HIDCore().GetEmulatedControllerByIndex(player_index)->EnableConfiguration();
SetEmulatedControllers(player_index);
}
@@ -205,9 +204,6 @@ QtControllerSelectorDialog::QtControllerSelectorDialog(
// If all the parameters are met AND only allows a single player,
// stop the constructor here as we do not need to continue.
if (CheckIfParametersMet() && parameters.enable_single_mode) {
- for (std::size_t player_index = 0; player_index < NUM_PLAYERS; ++player_index) {
- system.HIDCore().GetEmulatedControllerByIndex(player_index)->DisableConfiguration();
- }
return;
}
@@ -221,7 +217,9 @@ QtControllerSelectorDialog::QtControllerSelectorDialog(
resize(0, 0);
}
-QtControllerSelectorDialog::~QtControllerSelectorDialog() = default;
+QtControllerSelectorDialog::~QtControllerSelectorDialog() {
+ system.HIDCore().DisableAllControllerConfiguration();
+}
int QtControllerSelectorDialog::exec() {
if (parameters_met && parameters.enable_single_mode) {
@@ -237,12 +235,11 @@ void QtControllerSelectorDialog::ApplyConfiguration() {
Settings::values.vibration_enabled.SetValue(ui->vibrationGroup->isChecked());
Settings::values.motion_enabled.SetValue(ui->motionGroup->isChecked());
- for (std::size_t player_index = 0; player_index < NUM_PLAYERS; ++player_index) {
- system.HIDCore().GetEmulatedControllerByIndex(player_index)->DisableConfiguration();
- }
}
void QtControllerSelectorDialog::LoadConfiguration() {
+ system.HIDCore().EnableAllControllerConfiguration();
+
const auto* handheld = system.HIDCore().GetEmulatedController(Core::HID::NpadIdType::Handheld);
for (std::size_t index = 0; index < NUM_PLAYERS; ++index) {
const auto* controller = system.HIDCore().GetEmulatedControllerByIndex(index);