From ab9ece9bcab8a6d55dbe6f3a904d49231e5f73e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lam?= Date: Tue, 26 Dec 2017 00:38:44 +0100 Subject: Replace MathUtil::Clamp with std::clamp --- Source/Core/VideoCommon/BPFunctions.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'Source/Core/VideoCommon/BPFunctions.cpp') diff --git a/Source/Core/VideoCommon/BPFunctions.cpp b/Source/Core/VideoCommon/BPFunctions.cpp index 2aa325f8f7..e725927860 100644 --- a/Source/Core/VideoCommon/BPFunctions.cpp +++ b/Source/Core/VideoCommon/BPFunctions.cpp @@ -2,6 +2,8 @@ // Licensed under GPLv2+ // Refer to the license.txt file included. +#include + #include "Common/CommonTypes.h" #include "Common/Logging/Log.h" @@ -90,8 +92,8 @@ void SetViewport() { // There's no way to support oversized depth ranges in this situation. Let's just clamp the // range to the maximum value supported by the console GPU and hope for the best. - min_depth = MathUtil::Clamp(min_depth, 0.0f, GX_MAX_DEPTH); - max_depth = MathUtil::Clamp(max_depth, 0.0f, GX_MAX_DEPTH); + min_depth = std::clamp(min_depth, 0.0f, GX_MAX_DEPTH); + max_depth = std::clamp(max_depth, 0.0f, GX_MAX_DEPTH); } if (g_renderer->UseVertexDepthRange()) @@ -131,10 +133,10 @@ void SetViewport() { const float max_width = static_cast(g_renderer->GetCurrentFramebuffer()->GetWidth()); const float max_height = static_cast(g_renderer->GetCurrentFramebuffer()->GetHeight()); - x = MathUtil::Clamp(x, 0.0f, max_width - 1.0f); - y = MathUtil::Clamp(y, 0.0f, max_height - 1.0f); - width = MathUtil::Clamp(width, 1.0f, max_width - x); - height = MathUtil::Clamp(height, 1.0f, max_height - y); + x = std::clamp(x, 0.0f, max_width - 1.0f); + y = std::clamp(y, 0.0f, max_height - 1.0f); + width = std::clamp(width, 1.0f, max_width - x); + height = std::clamp(height, 1.0f, max_height - y); } // Lower-left flip. -- cgit v1.2.3