From 49b0eef393f4d321928fb0b6093d58a7637cf1da Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 2 May 2014 22:47:04 -0400 Subject: Remove the min/max functions in CommonFuncs. The algorithm header has the same functions. --- Source/Core/VideoBackends/Software/SWRenderer.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'Source/Core/VideoBackends/Software/SWRenderer.cpp') diff --git a/Source/Core/VideoBackends/Software/SWRenderer.cpp b/Source/Core/VideoBackends/Software/SWRenderer.cpp index e78aae5e4c..ea26a94139 100644 --- a/Source/Core/VideoBackends/Software/SWRenderer.cpp +++ b/Source/Core/VideoBackends/Software/SWRenderer.cpp @@ -2,6 +2,8 @@ // Licensed under GPLv2 // Refer to the license.txt file included. +#include + #include "Common/Common.h" #include "Core/Core.h" #include "VideoBackends/OGL/GLUtil.h" @@ -180,14 +182,14 @@ void SWRenderer::UpdateColorTexture(EfbInterface::yuv422_packed *xfb, u32 fbWidt // We do the inverse BT.601 conversion for YCbCr to RGB // http://www.equasys.de/colorconversion.html#YCbCr-RGBColorFormatConversion - TexturePointer[offset++] = (u8)min(255.0f, max(0.0f, 1.164f * Y1 + 1.596f * V)); - TexturePointer[offset++] = (u8)min(255.0f, max(0.0f, 1.164f * Y1 - 0.392f * U - 0.813f * V)); - TexturePointer[offset++] = (u8)min(255.0f, max(0.0f, 1.164f * Y1 + 2.017f * U )); + TexturePointer[offset++] = std::min(255.0f, std::max(0.0f, 1.164f * Y1 + 1.596f * V)); + TexturePointer[offset++] = std::min(255.0f, std::max(0.0f, 1.164f * Y1 - 0.392f * U - 0.813f * V)); + TexturePointer[offset++] = std::min(255.0f, std::max(0.0f, 1.164f * Y1 + 2.017f * U )); TexturePointer[offset++] = 255; - TexturePointer[offset++] = (u8)min(255.0f, max(0.0f, 1.164f * Y2 + 1.596f * V)); - TexturePointer[offset++] = (u8)min(255.0f, max(0.0f, 1.164f * Y2 - 0.392f * U - 0.813f * V)); - TexturePointer[offset++] = (u8)min(255.0f, max(0.0f, 1.164f * Y2 + 2.017f * U )); + TexturePointer[offset++] = std::min(255.0f, std::max(0.0f, 1.164f * Y2 + 1.596f * V)); + TexturePointer[offset++] = std::min(255.0f, std::max(0.0f, 1.164f * Y2 - 0.392f * U - 0.813f * V)); + TexturePointer[offset++] = std::min(255.0f, std::max(0.0f, 1.164f * Y2 + 2.017f * U )); TexturePointer[offset++] = 255; } xfb += fbWidth; -- cgit v1.2.3