Просмотр исходного кода

yuzu: Fix loading input profiles

german77 4 лет назад
Родитель
Сommit
21819da8cd
2 измененных файлов с 9 добавлено и 0 удалено
  1. 2 0
      src/core/hid/motion_input.cpp
  2. 7 0
      src/yuzu/configuration/configure_input_player.cpp

+ 2 - 0
src/core/hid/motion_input.cpp

@@ -73,6 +73,8 @@ void MotionInput::UpdateRotation(u64 elapsed_time) {
     rotations += gyro * sample_period;
     rotations += gyro * sample_period;
 }
 }
 
 
+// Based on Madgwick's implementation of Mayhony's AHRS algorithm.
+// https://github.com/xioTechnologies/Open-Source-AHRS-With-x-IMU/blob/master/x-IMU%20IMU%20and%20AHRS%20Algorithms/x-IMU%20IMU%20and%20AHRS%20Algorithms/AHRS/MahonyAHRS.cs
 void MotionInput::UpdateOrientation(u64 elapsed_time) {
 void MotionInput::UpdateOrientation(u64 elapsed_time) {
     if (!IsCalibrated(0.1f)) {
     if (!IsCalibrated(0.1f)) {
         ResetOrientation();
         ResetOrientation();

+ 7 - 0
src/yuzu/configuration/configure_input_player.cpp

@@ -598,8 +598,15 @@ void ConfigureInputPlayer::RetranslateUI() {
 }
 }
 
 
 void ConfigureInputPlayer::LoadConfiguration() {
 void ConfigureInputPlayer::LoadConfiguration() {
+    emulated_controller->ReloadFromSettings();
+
     UpdateUI();
     UpdateUI();
     UpdateInputDeviceCombobox();
     UpdateInputDeviceCombobox();
+
+    if (debug) {
+        return;
+    }
+
     const int comboBoxIndex = GetIndexFromControllerType(emulated_controller->GetNpadType(true));
     const int comboBoxIndex = GetIndexFromControllerType(emulated_controller->GetNpadType(true));
     ui->comboControllerType->setCurrentIndex(comboBoxIndex);
     ui->comboControllerType->setCurrentIndex(comboBoxIndex);
     ui->groupConnectedController->setChecked(emulated_controller->IsConnected(true));
     ui->groupConnectedController->setChecked(emulated_controller->IsConnected(true));