diff options
| author | 2021-07-08 14:46:31 -0400 | |
|---|---|---|
| committer | 2021-07-08 14:46:31 -0400 | |
| commit | 5edc96f4a47bff64cfd97f0c91e42b56ab58b2d7 (patch) | |
| tree | bd1e570a3f0594557e28516b0974aa07f67ad616 /src/input_common | |
| parent | Out of bound blit (#6531) (diff) | |
| parent | general: Code formatting improvements (diff) | |
| download | yuzu-5edc96f4a47bff64cfd97f0c91e42b56ab58b2d7.tar.gz yuzu-5edc96f4a47bff64cfd97f0c91e42b56ab58b2d7.tar.xz yuzu-5edc96f4a47bff64cfd97f0c91e42b56ab58b2d7.zip | |
Merge pull request #6539 from lat9nq/default-setting
general: Move most settings' defaults and labels into their definition
Diffstat (limited to '')
| -rw-r--r-- | src/input_common/mouse/mouse_poller.cpp | 3 | ||||
| -rw-r--r-- | src/input_common/touch_from_button.cpp | 2 | ||||
| -rw-r--r-- | src/input_common/udp/client.cpp | 4 |
3 files changed, 5 insertions, 4 deletions
diff --git a/src/input_common/mouse/mouse_poller.cpp b/src/input_common/mouse/mouse_poller.cpp index 758f7af1f..45b3d7340 100644 --- a/src/input_common/mouse/mouse_poller.cpp +++ b/src/input_common/mouse/mouse_poller.cpp | |||
| @@ -84,7 +84,8 @@ public: | |||
| 84 | std::lock_guard lock{mutex}; | 84 | std::lock_guard lock{mutex}; |
| 85 | const auto axis_value = | 85 | const auto axis_value = |
| 86 | static_cast<float>(mouse_input->GetMouseState(button).axis.at(axis)); | 86 | static_cast<float>(mouse_input->GetMouseState(button).axis.at(axis)); |
| 87 | return axis_value * Settings::values.mouse_panning_sensitivity / (100.0f * range); | 87 | const float sensitivity = Settings::values.mouse_panning_sensitivity.GetValue(); |
| 88 | return axis_value * sensitivity / (100.0f * range); | ||
| 88 | } | 89 | } |
| 89 | 90 | ||
| 90 | std::pair<float, float> GetAnalog(u32 analog_axis_x, u32 analog_axis_y) const { | 91 | std::pair<float, float> GetAnalog(u32 analog_axis_x, u32 analog_axis_y) const { |
diff --git a/src/input_common/touch_from_button.cpp b/src/input_common/touch_from_button.cpp index 5b24fd8bf..7878a56d7 100644 --- a/src/input_common/touch_from_button.cpp +++ b/src/input_common/touch_from_button.cpp | |||
| @@ -13,7 +13,7 @@ class TouchFromButtonDevice final : public Input::TouchDevice { | |||
| 13 | public: | 13 | public: |
| 14 | TouchFromButtonDevice() { | 14 | TouchFromButtonDevice() { |
| 15 | const auto button_index = | 15 | const auto button_index = |
| 16 | static_cast<std::size_t>(Settings::values.touch_from_button_map_index); | 16 | static_cast<u64>(Settings::values.touch_from_button_map_index.GetValue()); |
| 17 | const auto& buttons = Settings::values.touch_from_button_maps[button_index].buttons; | 17 | const auto& buttons = Settings::values.touch_from_button_maps[button_index].buttons; |
| 18 | 18 | ||
| 19 | for (const auto& config_entry : buttons) { | 19 | for (const auto& config_entry : buttons) { |
diff --git a/src/input_common/udp/client.cpp b/src/input_common/udp/client.cpp index bc1dfab3d..9b0aec797 100644 --- a/src/input_common/udp/client.cpp +++ b/src/input_common/udp/client.cpp | |||
| @@ -201,7 +201,7 @@ bool Client::DeviceConnected(std::size_t pad) const { | |||
| 201 | void Client::ReloadSockets() { | 201 | void Client::ReloadSockets() { |
| 202 | Reset(); | 202 | Reset(); |
| 203 | 203 | ||
| 204 | std::stringstream servers_ss(Settings::values.udp_input_servers); | 204 | std::stringstream servers_ss(static_cast<std::string>(Settings::values.udp_input_servers)); |
| 205 | std::string server_token; | 205 | std::string server_token; |
| 206 | std::size_t client = 0; | 206 | std::size_t client = 0; |
| 207 | while (std::getline(servers_ss, server_token, ',')) { | 207 | while (std::getline(servers_ss, server_token, ',')) { |
| @@ -370,7 +370,7 @@ std::optional<std::size_t> Client::GetUnusedFingerID() const { | |||
| 370 | 370 | ||
| 371 | void Client::UpdateTouchInput(Response::TouchPad& touch_pad, std::size_t client, std::size_t id) { | 371 | void Client::UpdateTouchInput(Response::TouchPad& touch_pad, std::size_t client, std::size_t id) { |
| 372 | // TODO: Use custom calibration per device | 372 | // TODO: Use custom calibration per device |
| 373 | const Common::ParamPackage touch_param(Settings::values.touch_device); | 373 | const Common::ParamPackage touch_param(Settings::values.touch_device.GetValue()); |
| 374 | const u16 min_x = static_cast<u16>(touch_param.Get("min_x", 100)); | 374 | const u16 min_x = static_cast<u16>(touch_param.Get("min_x", 100)); |
| 375 | const u16 min_y = static_cast<u16>(touch_param.Get("min_y", 50)); | 375 | const u16 min_y = static_cast<u16>(touch_param.Get("min_y", 50)); |
| 376 | const u16 max_x = static_cast<u16>(touch_param.Get("max_x", 1800)); | 376 | const u16 max_x = static_cast<u16>(touch_param.Get("max_x", 1800)); |