diff options
| author | 2020-10-27 13:33:25 -0400 | |
|---|---|---|
| committer | 2020-11-15 23:33:21 -0500 | |
| commit | 97b2220a822548eed83993fceebe0e611dbec84b (patch) | |
| tree | e4e90772c0ca7cccf3dd95d9cb49a600d0fabfb8 /src | |
| parent | sdl_impl: Revert to the "old" method of mapping sticks (diff) | |
| download | yuzu-97b2220a822548eed83993fceebe0e611dbec84b.tar.gz yuzu-97b2220a822548eed83993fceebe0e611dbec84b.tar.xz yuzu-97b2220a822548eed83993fceebe0e611dbec84b.zip | |
general: Fix compiler warnings on linux and miscellaneous changes
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/service/hid/controllers/npad.cpp | 17 | ||||
| -rw-r--r-- | src/core/hle/service/hid/controllers/npad.h | 2 | ||||
| -rw-r--r-- | src/yuzu/applets/controller.cpp | 5 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_debug_controller.cpp | 1 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_debug_controller.h | 3 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_input.h | 9 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_input_advanced.cpp | 6 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_input_advanced.h | 2 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_input_player.cpp | 3 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_input_profile_dialog.cpp | 1 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_input_profile_dialog.h | 3 | ||||
| -rw-r--r-- | src/yuzu/main.cpp | 1 |
12 files changed, 31 insertions, 22 deletions
diff --git a/src/core/hle/service/hid/controllers/npad.cpp b/src/core/hle/service/hid/controllers/npad.cpp index cfafabbd8..30715267c 100644 --- a/src/core/hle/service/hid/controllers/npad.cpp +++ b/src/core/hle/service/hid/controllers/npad.cpp | |||
| @@ -287,7 +287,7 @@ void Controller_NPad::OnLoadInputDevices() { | |||
| 287 | void Controller_NPad::OnRelease() { | 287 | void Controller_NPad::OnRelease() { |
| 288 | for (std::size_t npad_idx = 0; npad_idx < vibrations.size(); ++npad_idx) { | 288 | for (std::size_t npad_idx = 0; npad_idx < vibrations.size(); ++npad_idx) { |
| 289 | for (std::size_t device_idx = 0; device_idx < vibrations[npad_idx].size(); ++device_idx) { | 289 | for (std::size_t device_idx = 0; device_idx < vibrations[npad_idx].size(); ++device_idx) { |
| 290 | VibrateControllerAtIndex(npad_idx, device_idx); | 290 | VibrateControllerAtIndex(npad_idx, device_idx, {}); |
| 291 | } | 291 | } |
| 292 | } | 292 | } |
| 293 | } | 293 | } |
| @@ -720,11 +720,14 @@ bool Controller_NPad::VibrateControllerAtIndex(std::size_t npad_index, std::size | |||
| 720 | last_vibration_timepoints[npad_index][device_index] = now; | 720 | last_vibration_timepoints[npad_index][device_index] = now; |
| 721 | } | 721 | } |
| 722 | 722 | ||
| 723 | return vibrations[npad_index][device_index]->SetRumblePlay( | 723 | auto& vibration = vibrations[npad_index][device_index]; |
| 724 | std::min(vibration_value.amp_low * player.vibration_strength / 100.0f, 1.0f), | 724 | const auto player_vibration_strength = static_cast<f32>(player.vibration_strength); |
| 725 | vibration_value.freq_low, | 725 | const auto amp_low = |
| 726 | std::min(vibration_value.amp_high * player.vibration_strength / 100.0f, 1.0f), | 726 | std::min(vibration_value.amp_low * player_vibration_strength / 100.0f, 1.0f); |
| 727 | vibration_value.freq_high); | 727 | const auto amp_high = |
| 728 | std::min(vibration_value.amp_high * player_vibration_strength / 100.0f, 1.0f); | ||
| 729 | return vibration->SetRumblePlay(amp_low, vibration_value.freq_low, amp_high, | ||
| 730 | vibration_value.freq_high); | ||
| 728 | } | 731 | } |
| 729 | 732 | ||
| 730 | void Controller_NPad::VibrateController(const DeviceHandle& vibration_device_handle, | 733 | void Controller_NPad::VibrateController(const DeviceHandle& vibration_device_handle, |
| @@ -855,7 +858,7 @@ void Controller_NPad::DisconnectNpad(u32 npad_id) { | |||
| 855 | void Controller_NPad::DisconnectNpadAtIndex(std::size_t npad_index) { | 858 | void Controller_NPad::DisconnectNpadAtIndex(std::size_t npad_index) { |
| 856 | for (std::size_t device_idx = 0; device_idx < vibrations[npad_index].size(); ++device_idx) { | 859 | for (std::size_t device_idx = 0; device_idx < vibrations[npad_index].size(); ++device_idx) { |
| 857 | // Send an empty vibration to stop any vibrations. | 860 | // Send an empty vibration to stop any vibrations. |
| 858 | VibrateControllerAtIndex(npad_index, device_idx); | 861 | VibrateControllerAtIndex(npad_index, device_idx, {}); |
| 859 | vibration_devices_mounted[npad_index][device_idx] = false; | 862 | vibration_devices_mounted[npad_index][device_idx] = false; |
| 860 | } | 863 | } |
| 861 | 864 | ||
diff --git a/src/core/hle/service/hid/controllers/npad.h b/src/core/hle/service/hid/controllers/npad.h index f5122124c..99384524b 100644 --- a/src/core/hle/service/hid/controllers/npad.h +++ b/src/core/hle/service/hid/controllers/npad.h | |||
| @@ -149,7 +149,7 @@ public: | |||
| 149 | void SetNpadMode(u32 npad_id, NpadAssignments assignment_mode); | 149 | void SetNpadMode(u32 npad_id, NpadAssignments assignment_mode); |
| 150 | 150 | ||
| 151 | bool VibrateControllerAtIndex(std::size_t npad_index, std::size_t device_index, | 151 | bool VibrateControllerAtIndex(std::size_t npad_index, std::size_t device_index, |
| 152 | const VibrationValue& vibration_value = {}); | 152 | const VibrationValue& vibration_value); |
| 153 | 153 | ||
| 154 | void VibrateController(const DeviceHandle& vibration_device_handle, | 154 | void VibrateController(const DeviceHandle& vibration_device_handle, |
| 155 | const VibrationValue& vibration_value); | 155 | const VibrationValue& vibration_value); |
diff --git a/src/yuzu/applets/controller.cpp b/src/yuzu/applets/controller.cpp index 5112d48d2..8ecfec770 100644 --- a/src/yuzu/applets/controller.cpp +++ b/src/yuzu/applets/controller.cpp | |||
| @@ -3,6 +3,7 @@ | |||
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include <algorithm> | 5 | #include <algorithm> |
| 6 | #include <thread> | ||
| 6 | 7 | ||
| 7 | #include "common/assert.h" | 8 | #include "common/assert.h" |
| 8 | #include "common/string_util.h" | 9 | #include "common/string_util.h" |
| @@ -356,7 +357,7 @@ bool QtControllerSelectorDialog::CheckIfParametersMet() { | |||
| 356 | } | 357 | } |
| 357 | 358 | ||
| 358 | void QtControllerSelectorDialog::SetSupportedControllers() { | 359 | void QtControllerSelectorDialog::SetSupportedControllers() { |
| 359 | const QString theme = [this] { | 360 | const QString theme = [] { |
| 360 | if (QIcon::themeName().contains(QStringLiteral("dark"))) { | 361 | if (QIcon::themeName().contains(QStringLiteral("dark"))) { |
| 361 | return QStringLiteral("_dark"); | 362 | return QStringLiteral("_dark"); |
| 362 | } else if (QIcon::themeName().contains(QStringLiteral("midnight"))) { | 363 | } else if (QIcon::themeName().contains(QStringLiteral("midnight"))) { |
| @@ -445,7 +446,7 @@ void QtControllerSelectorDialog::UpdateControllerIcon(std::size_t player_index) | |||
| 445 | } | 446 | } |
| 446 | }(); | 447 | }(); |
| 447 | 448 | ||
| 448 | const QString theme = [this] { | 449 | const QString theme = [] { |
| 449 | if (QIcon::themeName().contains(QStringLiteral("dark"))) { | 450 | if (QIcon::themeName().contains(QStringLiteral("dark"))) { |
| 450 | return QStringLiteral("_dark"); | 451 | return QStringLiteral("_dark"); |
| 451 | } else if (QIcon::themeName().contains(QStringLiteral("midnight"))) { | 452 | } else if (QIcon::themeName().contains(QStringLiteral("midnight"))) { |
diff --git a/src/yuzu/configuration/configure_debug_controller.cpp b/src/yuzu/configuration/configure_debug_controller.cpp index 6dc9c5e57..a878ef9c6 100644 --- a/src/yuzu/configuration/configure_debug_controller.cpp +++ b/src/yuzu/configuration/configure_debug_controller.cpp | |||
| @@ -4,6 +4,7 @@ | |||
| 4 | 4 | ||
| 5 | #include "ui_configure_debug_controller.h" | 5 | #include "ui_configure_debug_controller.h" |
| 6 | #include "yuzu/configuration/configure_debug_controller.h" | 6 | #include "yuzu/configuration/configure_debug_controller.h" |
| 7 | #include "yuzu/configuration/configure_input_player.h" | ||
| 7 | 8 | ||
| 8 | ConfigureDebugController::ConfigureDebugController(QWidget* parent, | 9 | ConfigureDebugController::ConfigureDebugController(QWidget* parent, |
| 9 | InputCommon::InputSubsystem* input_subsystem, | 10 | InputCommon::InputSubsystem* input_subsystem, |
diff --git a/src/yuzu/configuration/configure_debug_controller.h b/src/yuzu/configuration/configure_debug_controller.h index 2694b3419..b4f53fad5 100644 --- a/src/yuzu/configuration/configure_debug_controller.h +++ b/src/yuzu/configuration/configure_debug_controller.h | |||
| @@ -6,10 +6,11 @@ | |||
| 6 | 6 | ||
| 7 | #include <memory> | 7 | #include <memory> |
| 8 | #include <QDialog> | 8 | #include <QDialog> |
| 9 | #include "yuzu/configuration/configure_input_player.h" | ||
| 10 | 9 | ||
| 11 | class QPushButton; | 10 | class QPushButton; |
| 12 | 11 | ||
| 12 | class ConfigureInputPlayer; | ||
| 13 | |||
| 13 | class InputProfiles; | 14 | class InputProfiles; |
| 14 | 15 | ||
| 15 | namespace InputCommon { | 16 | namespace InputCommon { |
diff --git a/src/yuzu/configuration/configure_input.h b/src/yuzu/configuration/configure_input.h index f135a4299..9eba9b523 100644 --- a/src/yuzu/configuration/configure_input.h +++ b/src/yuzu/configuration/configure_input.h | |||
| @@ -8,17 +8,16 @@ | |||
| 8 | #include <memory> | 8 | #include <memory> |
| 9 | 9 | ||
| 10 | #include <QKeyEvent> | 10 | #include <QKeyEvent> |
| 11 | #include <QList> | ||
| 11 | #include <QWidget> | 12 | #include <QWidget> |
| 12 | 13 | ||
| 13 | #include "yuzu/configuration/configure_input_advanced.h" | ||
| 14 | #include "yuzu/configuration/configure_input_player.h" | ||
| 15 | |||
| 16 | #include "ui_configure_input.h" | ||
| 17 | |||
| 18 | class QCheckBox; | 14 | class QCheckBox; |
| 19 | class QString; | 15 | class QString; |
| 20 | class QTimer; | 16 | class QTimer; |
| 21 | 17 | ||
| 18 | class ConfigureInputAdvanced; | ||
| 19 | class ConfigureInputPlayer; | ||
| 20 | |||
| 22 | class InputProfiles; | 21 | class InputProfiles; |
| 23 | 22 | ||
| 24 | namespace InputCommon { | 23 | namespace InputCommon { |
diff --git a/src/yuzu/configuration/configure_input_advanced.cpp b/src/yuzu/configuration/configure_input_advanced.cpp index 3074be833..abaf03630 100644 --- a/src/yuzu/configuration/configure_input_advanced.cpp +++ b/src/yuzu/configuration/configure_input_advanced.cpp | |||
| @@ -68,8 +68,7 @@ ConfigureInputAdvanced::ConfigureInputAdvanced(QWidget* parent) | |||
| 68 | for (std::size_t button_idx = 0; button_idx < color_buttons.size(); ++button_idx) { | 68 | for (std::size_t button_idx = 0; button_idx < color_buttons.size(); ++button_idx) { |
| 69 | connect(color_buttons[button_idx], &QPushButton::clicked, this, | 69 | connect(color_buttons[button_idx], &QPushButton::clicked, this, |
| 70 | [this, player_idx, button_idx] { | 70 | [this, player_idx, button_idx] { |
| 71 | OnControllerButtonClick(static_cast<int>(player_idx), | 71 | OnControllerButtonClick(player_idx, button_idx); |
| 72 | static_cast<int>(button_idx)); | ||
| 73 | }); | 72 | }); |
| 74 | } | 73 | } |
| 75 | } | 74 | } |
| @@ -94,7 +93,8 @@ ConfigureInputAdvanced::ConfigureInputAdvanced(QWidget* parent) | |||
| 94 | 93 | ||
| 95 | ConfigureInputAdvanced::~ConfigureInputAdvanced() = default; | 94 | ConfigureInputAdvanced::~ConfigureInputAdvanced() = default; |
| 96 | 95 | ||
| 97 | void ConfigureInputAdvanced::OnControllerButtonClick(int player_idx, int button_idx) { | 96 | void ConfigureInputAdvanced::OnControllerButtonClick(std::size_t player_idx, |
| 97 | std::size_t button_idx) { | ||
| 98 | const QColor new_bg_color = QColorDialog::getColor(controllers_colors[player_idx][button_idx]); | 98 | const QColor new_bg_color = QColorDialog::getColor(controllers_colors[player_idx][button_idx]); |
| 99 | if (!new_bg_color.isValid()) { | 99 | if (!new_bg_color.isValid()) { |
| 100 | return; | 100 | return; |
diff --git a/src/yuzu/configuration/configure_input_advanced.h b/src/yuzu/configuration/configure_input_advanced.h index 50bb87768..3083d55c1 100644 --- a/src/yuzu/configuration/configure_input_advanced.h +++ b/src/yuzu/configuration/configure_input_advanced.h | |||
| @@ -35,7 +35,7 @@ private: | |||
| 35 | void RetranslateUI(); | 35 | void RetranslateUI(); |
| 36 | void UpdateUIEnabled(); | 36 | void UpdateUIEnabled(); |
| 37 | 37 | ||
| 38 | void OnControllerButtonClick(int player_idx, int button_idx); | 38 | void OnControllerButtonClick(std::size_t player_idx, std::size_t button_idx); |
| 39 | 39 | ||
| 40 | void LoadConfiguration(); | 40 | void LoadConfiguration(); |
| 41 | 41 | ||
diff --git a/src/yuzu/configuration/configure_input_player.cpp b/src/yuzu/configuration/configure_input_player.cpp index 5abf9f0bf..0d10c1360 100644 --- a/src/yuzu/configuration/configure_input_player.cpp +++ b/src/yuzu/configuration/configure_input_player.cpp | |||
| @@ -4,6 +4,7 @@ | |||
| 4 | 4 | ||
| 5 | #include <algorithm> | 5 | #include <algorithm> |
| 6 | #include <memory> | 6 | #include <memory> |
| 7 | #include <thread> | ||
| 7 | #include <utility> | 8 | #include <utility> |
| 8 | #include <QGridLayout> | 9 | #include <QGridLayout> |
| 9 | #include <QInputDialog> | 10 | #include <QInputDialog> |
| @@ -857,7 +858,7 @@ void ConfigureInputPlayer::UpdateControllerIcon() { | |||
| 857 | } | 858 | } |
| 858 | }(); | 859 | }(); |
| 859 | 860 | ||
| 860 | const QString theme = [this] { | 861 | const QString theme = [] { |
| 861 | if (QIcon::themeName().contains(QStringLiteral("dark"))) { | 862 | if (QIcon::themeName().contains(QStringLiteral("dark"))) { |
| 862 | return QStringLiteral("_dark"); | 863 | return QStringLiteral("_dark"); |
| 863 | } else if (QIcon::themeName().contains(QStringLiteral("midnight"))) { | 864 | } else if (QIcon::themeName().contains(QStringLiteral("midnight"))) { |
diff --git a/src/yuzu/configuration/configure_input_profile_dialog.cpp b/src/yuzu/configuration/configure_input_profile_dialog.cpp index 818399b47..1f5cfa75b 100644 --- a/src/yuzu/configuration/configure_input_profile_dialog.cpp +++ b/src/yuzu/configuration/configure_input_profile_dialog.cpp | |||
| @@ -3,6 +3,7 @@ | |||
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include "ui_configure_input_profile_dialog.h" | 5 | #include "ui_configure_input_profile_dialog.h" |
| 6 | #include "yuzu/configuration/configure_input_player.h" | ||
| 6 | #include "yuzu/configuration/configure_input_profile_dialog.h" | 7 | #include "yuzu/configuration/configure_input_profile_dialog.h" |
| 7 | 8 | ||
| 8 | ConfigureInputProfileDialog::ConfigureInputProfileDialog( | 9 | ConfigureInputProfileDialog::ConfigureInputProfileDialog( |
diff --git a/src/yuzu/configuration/configure_input_profile_dialog.h b/src/yuzu/configuration/configure_input_profile_dialog.h index d4a3973d9..e6386bdbb 100644 --- a/src/yuzu/configuration/configure_input_profile_dialog.h +++ b/src/yuzu/configuration/configure_input_profile_dialog.h | |||
| @@ -6,10 +6,11 @@ | |||
| 6 | 6 | ||
| 7 | #include <memory> | 7 | #include <memory> |
| 8 | #include <QDialog> | 8 | #include <QDialog> |
| 9 | #include "yuzu/configuration/configure_input_player.h" | ||
| 10 | 9 | ||
| 11 | class QPushButton; | 10 | class QPushButton; |
| 12 | 11 | ||
| 12 | class ConfigureInputPlayer; | ||
| 13 | |||
| 13 | class InputProfiles; | 14 | class InputProfiles; |
| 14 | 15 | ||
| 15 | namespace InputCommon { | 16 | namespace InputCommon { |
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 76a5c32f4..9dabd8889 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp | |||
| @@ -58,6 +58,7 @@ static FileSys::VirtualFile VfsDirectoryCreateFileWrapper(const FileSys::Virtual | |||
| 58 | #include <QMessageBox> | 58 | #include <QMessageBox> |
| 59 | #include <QProgressBar> | 59 | #include <QProgressBar> |
| 60 | #include <QProgressDialog> | 60 | #include <QProgressDialog> |
| 61 | #include <QPushButton> | ||
| 61 | #include <QShortcut> | 62 | #include <QShortcut> |
| 62 | #include <QStatusBar> | 63 | #include <QStatusBar> |
| 63 | #include <QSysInfo> | 64 | #include <QSysInfo> |