From d93c96de83b986fc9c552166a982fd97dcd62567 Mon Sep 17 00:00:00 2001 From: Billy Laws Date: Mon, 13 Feb 2023 11:51:18 +0000 Subject: [PATCH] Fix sign error when decoding bc5s images Using an unsigned loop counter caused an implicit conversion breaking the decoder logic. --- app/src/main/cpp/skyline/gpu/texture/bc_decoder.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/cpp/skyline/gpu/texture/bc_decoder.cpp b/app/src/main/cpp/skyline/gpu/texture/bc_decoder.cpp index 7990173d..a736a1f7 100644 --- a/app/src/main/cpp/skyline/gpu/texture/bc_decoder.cpp +++ b/app/src/main/cpp/skyline/gpu/texture/bc_decoder.cpp @@ -131,11 +131,11 @@ namespace { } if (c[0] > c[1]) { - for (size_t i = 2; i < 8; ++i) { + for (int i = 2; i < 8; ++i) { c[i] = ((8 - i) * c[0] + (i - 1) * c[1]) / 7; } } else { - for (size_t i = 2; i < 6; ++i) { + for (int i = 2; i < 6; ++i) { c[i] = ((6 - i) * c[0] + (i - 1) * c[1]) / 5; } c[6] = isSigned ? -128 : 0;