Replace MathUtil::Clamp with std::clamp

This commit is contained in:
Léo Lam
2017-12-26 00:38:44 +01:00
parent 6f84984b7b
commit ab9ece9bca
31 changed files with 101 additions and 109 deletions

View File

@ -2,6 +2,7 @@
// Licensed under GPLv2+
// Refer to the license.txt file included.
#include <algorithm>
#include <array>
#include <cstdlib>
#include <fcntl.h>
@ -15,7 +16,6 @@
#include <vector>
#include "Common/FileUtil.h"
#include "Common/MathUtil.h"
#include "Common/StringUtil.h"
#include "InputCommon/ControllerInterface/ControllerInterface.h"
#include "InputCommon/ControllerInterface/Pipes/Pipes.h"
@ -123,7 +123,7 @@ void PipeDevice::AddAxis(const std::string& name, double value)
void PipeDevice::SetAxis(const std::string& entry, double value)
{
value = MathUtil::Clamp(value, 0.0, 1.0);
value = std::clamp(value, 0.0, 1.0);
double hi = std::max(0.0, value - 0.5) * 2.0;
double lo = (0.5 - std::min(0.5, value)) * 2.0;
auto search_hi = m_axes.find(entry + " +");