summaryrefslogtreecommitdiff
path: root/Source/Core/InputCommon/ControllerEmu
diff options
context:
space:
mode:
authorLéo Lam <leo@innovatetechnologi.es>2019-05-05 10:24:18 +0200
committerGitHub <noreply@github.com>2019-05-05 10:24:18 +0200
commit5d52b6ff095a4f8285ae757745ab0285bad47b9e (patch)
treeac4904dfb02322a55dd7e5a2d7cdedf756f8eaf6 /Source/Core/InputCommon/ControllerEmu
parent99a4ca8de7111c8554b50217744e24bc71912cfe (diff)
parent9133e8f1befbebd87c6e61f0e454f3ae2754285a (diff)
Merge pull request #6273 from leoetlino/c++17
Enable C++17
Diffstat (limited to 'Source/Core/InputCommon/ControllerEmu')
-rw-r--r--Source/Core/InputCommon/ControllerEmu/ControlGroup/Cursor.cpp6
-rw-r--r--Source/Core/InputCommon/ControllerEmu/StickGate.cpp5
2 files changed, 6 insertions, 5 deletions
diff --git a/Source/Core/InputCommon/ControllerEmu/ControlGroup/Cursor.cpp b/Source/Core/InputCommon/ControllerEmu/ControlGroup/Cursor.cpp
index dd5bc87887..410cf87b33 100644
--- a/Source/Core/InputCommon/ControllerEmu/ControlGroup/Cursor.cpp
+++ b/Source/Core/InputCommon/ControllerEmu/ControlGroup/Cursor.cpp
@@ -109,7 +109,7 @@ Cursor::StateData Cursor::GetState(const bool adjusted)
// Smooth out z movement:
// FYI: Not using relative input for Z.
- m_state.z += MathUtil::Clamp(z - m_state.z, -max_z_step, max_z_step);
+ m_state.z += std::clamp(z - m_state.z, -max_z_step, max_z_step);
// Relative input:
if (m_relative_setting.GetValue())
@@ -122,8 +122,8 @@ Cursor::StateData Cursor::GetState(const bool adjusted)
}
else
{
- m_state.x = MathUtil::Clamp(m_state.x + input.x * max_step, -1.0, 1.0);
- m_state.y = MathUtil::Clamp(m_state.y + input.y * max_step, -1.0, 1.0);
+ m_state.x = std::clamp(m_state.x + input.x * max_step, -1.0, 1.0);
+ m_state.y = std::clamp(m_state.y + input.y * max_step, -1.0, 1.0);
}
}
// Absolute input:
diff --git a/Source/Core/InputCommon/ControllerEmu/StickGate.cpp b/Source/Core/InputCommon/ControllerEmu/StickGate.cpp
index 48c21ae5be..70ed383398 100644
--- a/Source/Core/InputCommon/ControllerEmu/StickGate.cpp
+++ b/Source/Core/InputCommon/ControllerEmu/StickGate.cpp
@@ -4,6 +4,7 @@
#include "InputCommon/ControllerEmu/StickGate.h"
+#include <algorithm>
#include <cmath>
#include "Common/Common.h"
@@ -277,8 +278,8 @@ ReshapableInput::ReshapeData ReshapableInput::Reshape(ControlState x, ControlSta
// Scale to the gate shape/radius:
dist *= gate_max_dist;
- return {MathUtil::Clamp(std::cos(angle) * dist, -1.0, 1.0),
- MathUtil::Clamp(std::sin(angle) * dist, -1.0, 1.0)};
+ return {std::clamp(std::cos(angle) * dist, -1.0, 1.0),
+ std::clamp(std::sin(angle) * dist, -1.0, 1.0)};
}
} // namespace ControllerEmu