summaryrefslogtreecommitdiff
path: root/src/input_common/motion_emu.cpp
diff options
context:
space:
mode:
authorGravatar Lioncash2018-04-19 23:01:50 -0400
committerGravatar Lioncash2018-04-20 10:14:13 -0400
commitfae2dd034462c5a6b086e46b3437ea6e2456d5eb (patch)
tree3a53e7b4786e4712874d63a2a1cecc6755475051 /src/input_common/motion_emu.cpp
parentMerge pull request #356 from lioncash/shader (diff)
downloadyuzu-fae2dd034462c5a6b086e46b3437ea6e2456d5eb.tar.gz
yuzu-fae2dd034462c5a6b086e46b3437ea6e2456d5eb.tar.xz
yuzu-fae2dd034462c5a6b086e46b3437ea6e2456d5eb.zip
math_util: Remove the Clamp() function
C++17 adds clamp() to the standard library, so we can remove ours in favor of it.
Diffstat (limited to 'src/input_common/motion_emu.cpp')
-rw-r--r--src/input_common/motion_emu.cpp5
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 }