diff options
| author | 2021-12-13 09:09:03 -0500 | |
|---|---|---|
| committer | 2021-12-13 09:16:10 -0500 | |
| commit | 38f3442ea56a3ac9447924c015c2a9ade0f5bb83 (patch) | |
| tree | 4fbdcc84b82ff753306647b309c8a0b128af02f0 /src/input_common/drivers/gc_adapter.cpp | |
| parent | input_engine: std::move engine name where applicable (diff) | |
| download | yuzu-38f3442ea56a3ac9447924c015c2a9ade0f5bb83.tar.gz yuzu-38f3442ea56a3ac9447924c015c2a9ade0f5bb83.tar.xz yuzu-38f3442ea56a3ac9447924c015c2a9ade0f5bb83.zip | |
input_engine: Pass VibrationStatus by const reference in SetRumble()
Avoids creating copies of the struct where not necessary.
Diffstat (limited to 'src/input_common/drivers/gc_adapter.cpp')
| -rw-r--r-- | src/input_common/drivers/gc_adapter.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/input_common/drivers/gc_adapter.cpp b/src/input_common/drivers/gc_adapter.cpp index 451147755..7ab4540a8 100644 --- a/src/input_common/drivers/gc_adapter.cpp +++ b/src/input_common/drivers/gc_adapter.cpp | |||
| @@ -325,8 +325,8 @@ bool GCAdapter::GetGCEndpoint(libusb_device* device) { | |||
| 325 | return true; | 325 | return true; |
| 326 | } | 326 | } |
| 327 | 327 | ||
| 328 | Common::Input::VibrationError GCAdapter::SetRumble(const PadIdentifier& identifier, | 328 | Common::Input::VibrationError GCAdapter::SetRumble( |
| 329 | const Common::Input::VibrationStatus vibration) { | 329 | const PadIdentifier& identifier, const Common::Input::VibrationStatus& vibration) { |
| 330 | const auto mean_amplitude = (vibration.low_amplitude + vibration.high_amplitude) * 0.5f; | 330 | const auto mean_amplitude = (vibration.low_amplitude + vibration.high_amplitude) * 0.5f; |
| 331 | const auto processed_amplitude = | 331 | const auto processed_amplitude = |
| 332 | static_cast<u8>((mean_amplitude + std::pow(mean_amplitude, 0.3f)) * 0.5f * 0x8); | 332 | static_cast<u8>((mean_amplitude + std::pow(mean_amplitude, 0.3f)) * 0.5f * 0x8); |