diff options
| author | 2018-04-20 14:18:03 -0400 | |
|---|---|---|
| committer | 2018-04-20 14:18:03 -0400 | |
| commit | 326b044c19df0b1a342acf87f2ba7cd06e9a1e97 (patch) | |
| tree | d815c707b437b3685e8ba188bbf0940d4205de2a /src/input_common | |
| parent | Merge pull request #361 from lioncash/common (diff) | |
| parent | math_util: Remove the Clamp() function (diff) | |
| download | yuzu-326b044c19df0b1a342acf87f2ba7cd06e9a1e97.tar.gz yuzu-326b044c19df0b1a342acf87f2ba7cd06e9a1e97.tar.xz yuzu-326b044c19df0b1a342acf87f2ba7cd06e9a1e97.zip | |
Merge pull request #367 from lioncash/clamp
math_util: Remove the Clamp() function
Diffstat (limited to 'src/input_common')
| -rw-r--r-- | src/input_common/motion_emu.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/input_common/motion_emu.cpp b/src/input_common/motion_emu.cpp index 59a035e70..caffe48cb 100644 --- a/src/input_common/motion_emu.cpp +++ b/src/input_common/motion_emu.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 <algorithm> | ||
| 5 | #include <chrono> | 6 | #include <chrono> |
| 6 | #include <mutex> | 7 | #include <mutex> |
| 7 | #include <thread> | 8 | #include <thread> |
| @@ -43,8 +44,8 @@ public: | |||
| 43 | tilt_angle = 0; | 44 | tilt_angle = 0; |
| 44 | } else { | 45 | } else { |
| 45 | tilt_direction = mouse_move.Cast<float>(); | 46 | tilt_direction = mouse_move.Cast<float>(); |
| 46 | tilt_angle = MathUtil::Clamp(tilt_direction.Normalize() * sensitivity, 0.0f, | 47 | tilt_angle = |
| 47 | MathUtil::PI * 0.5f); | 48 | std::clamp(tilt_direction.Normalize() * sensitivity, 0.0f, MathUtil::PI * 0.5f); |
| 48 | } | 49 | } |
| 49 | } | 50 | } |
| 50 | } | 51 | } |