From eb956a158c76a0b7ebf19423d31ac91a31dc394e Mon Sep 17 00:00:00 2001 From: "Dr. Dystopia" Date: Fri, 31 Jul 2026 23:16:34 +0200 Subject: Replace manual calculations with std::lerp and std::midpoint --- Source/Core/VideoCommon/TextureDecoder_x64.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'Source/Core/VideoCommon/TextureDecoder_x64.cpp') diff --git a/Source/Core/VideoCommon/TextureDecoder_x64.cpp b/Source/Core/VideoCommon/TextureDecoder_x64.cpp index 3918361561..a3bbcd8020 100644 --- a/Source/Core/VideoCommon/TextureDecoder_x64.cpp +++ b/Source/Core/VideoCommon/TextureDecoder_x64.cpp @@ -3,6 +3,8 @@ #include "VideoCommon/TextureDecoder.h" +#include + #ifdef CHECK #include "Common/Assert.h" #endif @@ -188,8 +190,10 @@ static void DecodeDXTBlock(u32* dst, const DXTBlock* src, int pitch) { // color[3] is the same as color[2] (average of both colors), but transparent. // This differs from DXT1 where color[3] is transparent black. - colors[2] = MakeRGBA((red1 + red2) / 2, (green1 + green2) / 2, (blue1 + blue2) / 2, 255); - colors[3] = MakeRGBA((red1 + red2) / 2, (green1 + green2) / 2, (blue1 + blue2) / 2, 0); + colors[2] = MakeRGBA(std::midpoint(red1 + red2), std::midpoint(green1, green2), + std::midpoint(blue1, blue2), 255); + colors[3] = MakeRGBA(std::midpoint(red1 + red2), std::midpoint(green1, green2), + std::midpoint(blue1, blue2), 0); } for (int y = 0; y < 4; y++) -- cgit v1.2.3