From 88266eee5036d45876ccf4d9402b032fc17a03f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Tue, 10 Feb 2026 13:59:32 +0100 Subject: [PATCH] Warning fixes, comments --- Core/Screenshot.cpp | 11 +++++------ GPU/Common/VertexDecoderHandwritten.cpp | 3 +++ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Core/Screenshot.cpp b/Core/Screenshot.cpp index 282b9cc4ad..36c1461144 100644 --- a/Core/Screenshot.cpp +++ b/Core/Screenshot.cpp @@ -354,7 +354,7 @@ ScreenshotResult TakeGameScreenshot(Draw::DrawContext *draw, const Path &filenam const u8 *buffer = ConvertBufferToScreenshot(buf, false, flipbuffer, width, height); bool success; - if (width <= 480 * maxRes) { + if ((int)width <= 480 * maxRes) { success = Save888RGBScreenshot(filename, fmt, buffer, width, height); delete[] flipbuffer; } else { @@ -363,13 +363,12 @@ ScreenshotResult TakeGameScreenshot(Draw::DrawContext *draw, const Path &filenam delete[] flipbuffer; // TODO: Speed this thing up. - while (width > 480 * maxRes) { + while ((int)width > 480 * maxRes) { u8 *halfSize = new u8[(width / 2) * (height / 2) * 3]; - for (int y = 0; y < height / 2; y++) { - for (int x = 0; x < width / 2; x++) { + for (u32 y = 0; y < height / 2; y++) { + for (u32 x = 0; x < width / 2; x++) { for (int c = 0; c < 3; c++) { - halfSize[(y * (width / 2) + x) * 3 + c] = - (shrinkBuffer[((y * 2) * width + (x * 2)) * 3 + c] + + halfSize[(y * (width / 2) + x) * 3 + c] = (shrinkBuffer[((y * 2) * width + (x * 2)) * 3 + c] + shrinkBuffer[((y * 2) * width + (x * 2 + 1)) * 3 + c] + shrinkBuffer[(((y * 2) + 1) * width + (x * 2)) * 3 + c] + shrinkBuffer[(((y * 2) + 1) * width + (x * 2 + 1)) * 3 + c]) / 4; diff --git a/GPU/Common/VertexDecoderHandwritten.cpp b/GPU/Common/VertexDecoderHandwritten.cpp index 13bfe4aeb5..efa3a957c1 100644 --- a/GPU/Common/VertexDecoderHandwritten.cpp +++ b/GPU/Common/VertexDecoderHandwritten.cpp @@ -31,7 +31,9 @@ // [04000116] P: s16 C: 5551 T: u16 (12b) (7688298) // This is the first GoW one. TODO: Do two verts at a time. +// God of War. void VtxDec_Tu16_C8888_Pfloat(const u8 *srcp, u8 *dstp, int count, const UVScale *uvScaleOffset) { + // Input: 4 + 4 + 4 + 12 = 24 bytes struct GOWVTX { union { struct { @@ -47,6 +49,7 @@ void VtxDec_Tu16_C8888_Pfloat(const u8 *srcp, u8 *dstp, int count, const UVScale float z; }; // NOTE: This might be different for different vertex formats. + // Output: 8 + 4 + 4 + 12 = 28 bytes. struct OutVTX { float u; float v;