diff options
| -rw-r--r-- | src/core/frontend/framebuffer_layout.h | 1 | ||||
| -rw-r--r-- | src/input_common/main.h | 4 | ||||
| -rw-r--r-- | src/input_common/touch_from_button.cpp | 2 | ||||
| -rw-r--r-- | src/input_common/touch_from_button.h | 2 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_input_advanced.cpp | 2 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_motion_touch.cpp | 18 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_motion_touch.h | 8 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_touch_from_button.cpp | 1 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_touch_from_button.h | 19 |
9 files changed, 27 insertions, 30 deletions
diff --git a/src/core/frontend/framebuffer_layout.h b/src/core/frontend/framebuffer_layout.h index 91ecc30ab..e2e3bbbb3 100644 --- a/src/core/frontend/framebuffer_layout.h +++ b/src/core/frontend/framebuffer_layout.h | |||
| @@ -4,6 +4,7 @@ | |||
| 4 | 4 | ||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||
| 7 | #include "common/common_types.h" | ||
| 7 | #include "common/math_util.h" | 8 | #include "common/math_util.h" |
| 8 | 9 | ||
| 9 | namespace Layout { | 10 | namespace Layout { |
diff --git a/src/input_common/main.h b/src/input_common/main.h index 512215e7e..f3fbf696e 100644 --- a/src/input_common/main.h +++ b/src/input_common/main.h | |||
| @@ -21,9 +21,6 @@ namespace Settings::NativeButton { | |||
| 21 | enum Values : int; | 21 | enum Values : int; |
| 22 | } | 22 | } |
| 23 | 23 | ||
| 24 | /// Reloads the input devices | ||
| 25 | void ReloadInputDevices(); | ||
| 26 | |||
| 27 | namespace InputCommon { | 24 | namespace InputCommon { |
| 28 | namespace Polling { | 25 | namespace Polling { |
| 29 | 26 | ||
| @@ -118,6 +115,7 @@ public: | |||
| 118 | /// Retrieves the underlying GameCube button handler. | 115 | /// Retrieves the underlying GameCube button handler. |
| 119 | [[nodiscard]] const GCButtonFactory* GetGCButtons() const; | 116 | [[nodiscard]] const GCButtonFactory* GetGCButtons() const; |
| 120 | 117 | ||
| 118 | /// Reloads the input devices | ||
| 121 | void ReloadInputDevices(); | 119 | void ReloadInputDevices(); |
| 122 | 120 | ||
| 123 | /// Get all DevicePoller from all backends for a specific device type | 121 | /// Get all DevicePoller from all backends for a specific device type |
diff --git a/src/input_common/touch_from_button.cpp b/src/input_common/touch_from_button.cpp index d028dfa0d..98da0ef1a 100644 --- a/src/input_common/touch_from_button.cpp +++ b/src/input_common/touch_from_button.cpp | |||
| @@ -2,6 +2,7 @@ | |||
| 2 | // Licensed under GPLv2 or any later version | 2 | // Licensed under GPLv2 or any later version |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include "core/frontend/framebuffer_layout.h" | ||
| 5 | #include "core/settings.h" | 6 | #include "core/settings.h" |
| 6 | #include "input_common/touch_from_button.h" | 7 | #include "input_common/touch_from_button.h" |
| 7 | 8 | ||
| @@ -43,7 +44,6 @@ private: | |||
| 43 | 44 | ||
| 44 | std::unique_ptr<Input::TouchDevice> TouchFromButtonFactory::Create( | 45 | std::unique_ptr<Input::TouchDevice> TouchFromButtonFactory::Create( |
| 45 | const Common::ParamPackage& params) { | 46 | const Common::ParamPackage& params) { |
| 46 | |||
| 47 | return std::make_unique<TouchFromButtonDevice>(); | 47 | return std::make_unique<TouchFromButtonDevice>(); |
| 48 | } | 48 | } |
| 49 | 49 | ||
diff --git a/src/input_common/touch_from_button.h b/src/input_common/touch_from_button.h index cfb82f108..8b4d1aa96 100644 --- a/src/input_common/touch_from_button.h +++ b/src/input_common/touch_from_button.h | |||
| @@ -5,7 +5,6 @@ | |||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||
| 7 | #include <memory> | 7 | #include <memory> |
| 8 | #include "core/frontend/framebuffer_layout.h" | ||
| 9 | #include "core/frontend/input.h" | 8 | #include "core/frontend/input.h" |
| 10 | 9 | ||
| 11 | namespace InputCommon { | 10 | namespace InputCommon { |
| @@ -17,7 +16,6 @@ class TouchFromButtonFactory final : public Input::Factory<Input::TouchDevice> { | |||
| 17 | public: | 16 | public: |
| 18 | /** | 17 | /** |
| 19 | * Creates a touch device from a list of button devices | 18 | * Creates a touch device from a list of button devices |
| 20 | * @param unused | ||
| 21 | */ | 19 | */ |
| 22 | std::unique_ptr<Input::TouchDevice> Create(const Common::ParamPackage& params) override; | 20 | std::unique_ptr<Input::TouchDevice> Create(const Common::ParamPackage& params) override; |
| 23 | }; | 21 | }; |
diff --git a/src/yuzu/configuration/configure_input_advanced.cpp b/src/yuzu/configuration/configure_input_advanced.cpp index c00e3faab..81f9dc16c 100644 --- a/src/yuzu/configuration/configure_input_advanced.cpp +++ b/src/yuzu/configuration/configure_input_advanced.cpp | |||
| @@ -87,7 +87,7 @@ ConfigureInputAdvanced::ConfigureInputAdvanced(QWidget* parent) | |||
| 87 | connect(ui->touchscreen_advanced, &QPushButton::clicked, this, | 87 | connect(ui->touchscreen_advanced, &QPushButton::clicked, this, |
| 88 | [this] { CallTouchscreenConfigDialog(); }); | 88 | [this] { CallTouchscreenConfigDialog(); }); |
| 89 | connect(ui->buttonMotionTouch, &QPushButton::clicked, this, | 89 | connect(ui->buttonMotionTouch, &QPushButton::clicked, this, |
| 90 | [this] { CallMotionTouchConfigDialog(); }); | 90 | &ConfigureInputAdvanced::CallMotionTouchConfigDialog); |
| 91 | 91 | ||
| 92 | LoadConfiguration(); | 92 | LoadConfiguration(); |
| 93 | } | 93 | } |
diff --git a/src/yuzu/configuration/configure_motion_touch.cpp b/src/yuzu/configuration/configure_motion_touch.cpp index 1a4b3c996..c7d085151 100644 --- a/src/yuzu/configuration/configure_motion_touch.cpp +++ b/src/yuzu/configuration/configure_motion_touch.cpp | |||
| @@ -89,10 +89,10 @@ ConfigureMotionTouch::ConfigureMotionTouch(QWidget* parent, | |||
| 89 | : QDialog(parent), input_subsystem{input_subsystem_}, | 89 | : QDialog(parent), input_subsystem{input_subsystem_}, |
| 90 | ui(std::make_unique<Ui::ConfigureMotionTouch>()) { | 90 | ui(std::make_unique<Ui::ConfigureMotionTouch>()) { |
| 91 | ui->setupUi(this); | 91 | ui->setupUi(this); |
| 92 | for (const auto [provider, name] : MotionProviders) { | 92 | for (const auto& [provider, name] : MotionProviders) { |
| 93 | ui->motion_provider->addItem(tr(name), QString::fromUtf8(provider)); | 93 | ui->motion_provider->addItem(tr(name), QString::fromUtf8(provider)); |
| 94 | } | 94 | } |
| 95 | for (const auto [provider, name] : TouchProviders) { | 95 | for (const auto& [provider, name] : TouchProviders) { |
| 96 | ui->touch_provider->addItem(tr(name), QString::fromUtf8(provider)); | 96 | ui->touch_provider->addItem(tr(name), QString::fromUtf8(provider)); |
| 97 | } | 97 | } |
| 98 | 98 | ||
| @@ -111,10 +111,10 @@ ConfigureMotionTouch::ConfigureMotionTouch(QWidget* parent, | |||
| 111 | ConfigureMotionTouch::~ConfigureMotionTouch() = default; | 111 | ConfigureMotionTouch::~ConfigureMotionTouch() = default; |
| 112 | 112 | ||
| 113 | void ConfigureMotionTouch::SetConfiguration() { | 113 | void ConfigureMotionTouch::SetConfiguration() { |
| 114 | Common::ParamPackage motion_param(Settings::values.motion_device); | 114 | const Common::ParamPackage motion_param(Settings::values.motion_device); |
| 115 | Common::ParamPackage touch_param(Settings::values.touch_device); | 115 | const Common::ParamPackage touch_param(Settings::values.touch_device); |
| 116 | std::string motion_engine = motion_param.Get("engine", "motion_emu"); | 116 | const std::string motion_engine = motion_param.Get("engine", "motion_emu"); |
| 117 | std::string touch_engine = touch_param.Get("engine", "emu_window"); | 117 | const std::string touch_engine = touch_param.Get("engine", "emu_window"); |
| 118 | 118 | ||
| 119 | ui->motion_provider->setCurrentIndex( | 119 | ui->motion_provider->setCurrentIndex( |
| 120 | ui->motion_provider->findData(QString::fromStdString(motion_engine))); | 120 | ui->motion_provider->findData(QString::fromStdString(motion_engine))); |
| @@ -141,7 +141,7 @@ void ConfigureMotionTouch::SetConfiguration() { | |||
| 141 | void ConfigureMotionTouch::UpdateUiDisplay() { | 141 | void ConfigureMotionTouch::UpdateUiDisplay() { |
| 142 | const QString motion_engine = ui->motion_provider->currentData().toString(); | 142 | const QString motion_engine = ui->motion_provider->currentData().toString(); |
| 143 | const QString touch_engine = ui->touch_provider->currentData().toString(); | 143 | const QString touch_engine = ui->touch_provider->currentData().toString(); |
| 144 | QString cemuhook_udp = QStringLiteral("cemuhookudp"); | 144 | const QString cemuhook_udp = QStringLiteral("cemuhookudp"); |
| 145 | 145 | ||
| 146 | if (motion_engine == QStringLiteral("motion_emu")) { | 146 | if (motion_engine == QStringLiteral("motion_emu")) { |
| 147 | ui->motion_sensitivity_label->setVisible(true); | 147 | ui->motion_sensitivity_label->setVisible(true); |
| @@ -286,8 +286,8 @@ void ConfigureMotionTouch::ApplyConfiguration() { | |||
| 286 | std::string touch_engine = ui->touch_provider->currentData().toString().toStdString(); | 286 | std::string touch_engine = ui->touch_provider->currentData().toString().toStdString(); |
| 287 | 287 | ||
| 288 | Common::ParamPackage motion_param{}, touch_param{}; | 288 | Common::ParamPackage motion_param{}, touch_param{}; |
| 289 | motion_param.Set("engine", motion_engine); | 289 | motion_param.Set("engine", std::move(motion_engine)); |
| 290 | touch_param.Set("engine", touch_engine); | 290 | touch_param.Set("engine", std::move(touch_engine)); |
| 291 | 291 | ||
| 292 | if (motion_engine == "motion_emu") { | 292 | if (motion_engine == "motion_emu") { |
| 293 | motion_param.Set("sensitivity", static_cast<float>(ui->motion_sensitivity->value())); | 293 | motion_param.Set("sensitivity", static_cast<float>(ui->motion_sensitivity->value())); |
diff --git a/src/yuzu/configuration/configure_motion_touch.h b/src/yuzu/configuration/configure_motion_touch.h index 0fafb3aed..3d4b5d659 100644 --- a/src/yuzu/configuration/configure_motion_touch.h +++ b/src/yuzu/configuration/configure_motion_touch.h | |||
| @@ -12,14 +12,18 @@ class QLabel; | |||
| 12 | class QPushButton; | 12 | class QPushButton; |
| 13 | class QVBoxLayout; | 13 | class QVBoxLayout; |
| 14 | 14 | ||
| 15 | namespace Ui { | 15 | namespace InputCommon { |
| 16 | class ConfigureMotionTouch; | 16 | class InputSubsystem; |
| 17 | } | 17 | } |
| 18 | 18 | ||
| 19 | namespace InputCommon::CemuhookUDP { | 19 | namespace InputCommon::CemuhookUDP { |
| 20 | class CalibrationConfigurationJob; | 20 | class CalibrationConfigurationJob; |
| 21 | } | 21 | } |
| 22 | 22 | ||
| 23 | namespace Ui { | ||
| 24 | class ConfigureMotionTouch; | ||
| 25 | } | ||
| 26 | |||
| 23 | /// A dialog for touchpad calibration configuration. | 27 | /// A dialog for touchpad calibration configuration. |
| 24 | class CalibrationConfigurationDialog : public QDialog { | 28 | class CalibrationConfigurationDialog : public QDialog { |
| 25 | Q_OBJECT | 29 | Q_OBJECT |
diff --git a/src/yuzu/configuration/configure_touch_from_button.cpp b/src/yuzu/configuration/configure_touch_from_button.cpp index 0147e2ac3..15557e4b8 100644 --- a/src/yuzu/configuration/configure_touch_from_button.cpp +++ b/src/yuzu/configuration/configure_touch_from_button.cpp | |||
| @@ -74,7 +74,6 @@ ConfigureTouchFromButton::ConfigureTouchFromButton( | |||
| 74 | : QDialog(parent), ui(std::make_unique<Ui::ConfigureTouchFromButton>()), | 74 | : QDialog(parent), ui(std::make_unique<Ui::ConfigureTouchFromButton>()), |
| 75 | touch_maps(touch_maps), input_subsystem{input_subsystem_}, selected_index(default_index), | 75 | touch_maps(touch_maps), input_subsystem{input_subsystem_}, selected_index(default_index), |
| 76 | timeout_timer(std::make_unique<QTimer>()), poll_timer(std::make_unique<QTimer>()) { | 76 | timeout_timer(std::make_unique<QTimer>()), poll_timer(std::make_unique<QTimer>()) { |
| 77 | |||
| 78 | ui->setupUi(this); | 77 | ui->setupUi(this); |
| 79 | binding_list_model = new QStandardItemModel(0, 3, this); | 78 | binding_list_model = new QStandardItemModel(0, 3, this); |
| 80 | binding_list_model->setHorizontalHeaderLabels( | 79 | binding_list_model->setHorizontalHeaderLabels( |
diff --git a/src/yuzu/configuration/configure_touch_from_button.h b/src/yuzu/configuration/configure_touch_from_button.h index 0ddc54268..d9513e3bc 100644 --- a/src/yuzu/configuration/configure_touch_from_button.h +++ b/src/yuzu/configuration/configure_touch_from_button.h | |||
| @@ -16,28 +16,26 @@ class QStandardItemModel; | |||
| 16 | class QStandardItem; | 16 | class QStandardItem; |
| 17 | class QTimer; | 17 | class QTimer; |
| 18 | 18 | ||
| 19 | namespace InputCommon { | ||
| 20 | class InputSubsystem; | ||
| 21 | } | ||
| 22 | |||
| 23 | namespace Common { | 19 | namespace Common { |
| 24 | class ParamPackage; | 20 | class ParamPackage; |
| 25 | } | 21 | } |
| 26 | 22 | ||
| 27 | namespace InputCommon { | 23 | namespace InputCommon { |
| 28 | namespace Polling { | 24 | class InputSubsystem; |
| 29 | class DevicePoller; | ||
| 30 | } | 25 | } |
| 31 | } // namespace InputCommon | ||
| 32 | 26 | ||
| 33 | namespace Ui { | 27 | namespace InputCommon::Polling { |
| 34 | class ConfigureTouchFromButton; | 28 | class DevicePoller; |
| 35 | } | 29 | } |
| 36 | 30 | ||
| 37 | namespace Settings { | 31 | namespace Settings { |
| 38 | struct TouchFromButtonMap; | 32 | struct TouchFromButtonMap; |
| 39 | } | 33 | } |
| 40 | 34 | ||
| 35 | namespace Ui { | ||
| 36 | class ConfigureTouchFromButton; | ||
| 37 | } | ||
| 38 | |||
| 41 | class ConfigureTouchFromButton : public QDialog { | 39 | class ConfigureTouchFromButton : public QDialog { |
| 42 | Q_OBJECT | 40 | Q_OBJECT |
| 43 | 41 | ||
| @@ -82,9 +80,8 @@ private: | |||
| 82 | std::unique_ptr<Ui::ConfigureTouchFromButton> ui; | 80 | std::unique_ptr<Ui::ConfigureTouchFromButton> ui; |
| 83 | std::vector<Settings::TouchFromButtonMap> touch_maps; | 81 | std::vector<Settings::TouchFromButtonMap> touch_maps; |
| 84 | QStandardItemModel* binding_list_model; | 82 | QStandardItemModel* binding_list_model; |
| 85 | int selected_index; | ||
| 86 | |||
| 87 | InputCommon::InputSubsystem* input_subsystem; | 83 | InputCommon::InputSubsystem* input_subsystem; |
| 84 | int selected_index; | ||
| 88 | 85 | ||
| 89 | std::unique_ptr<QTimer> timeout_timer; | 86 | std::unique_ptr<QTimer> timeout_timer; |
| 90 | std::unique_ptr<QTimer> poll_timer; | 87 | std::unique_ptr<QTimer> poll_timer; |