From d769c3223ccdac35cf9e7cda6a57d10921f1be69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sun, 5 May 2024 11:20:29 +0200 Subject: [PATCH] Fix camera mirroring color issue, fix warning --- Core/HLE/sceKernelInterrupt.cpp | 4 ++-- Windows/CaptureDevice.cpp | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Core/HLE/sceKernelInterrupt.cpp b/Core/HLE/sceKernelInterrupt.cpp index 3554e2c878..85e2bf425c 100644 --- a/Core/HLE/sceKernelInterrupt.cpp +++ b/Core/HLE/sceKernelInterrupt.cpp @@ -888,8 +888,8 @@ static int sysclib_sprintf(u32 dst, u32 fmt) { ERROR_LOG(SCEKERNEL, "sysclib_sprintf result string is too long or dst is invalid"); return 0; } - memcpy((char *)Memory::GetPointerUnchecked(dst), result.c_str(), result.length() + 1); - return result.length(); + memcpy((char *)Memory::GetPointerUnchecked(dst), result.c_str(), (int)result.length() + 1); + return (int)result.length(); } static u32 sysclib_memset(u32 destAddr, int data, int size) { diff --git a/Windows/CaptureDevice.cpp b/Windows/CaptureDevice.cpp index 924e147cbe..9b6683f614 100644 --- a/Windows/CaptureDevice.cpp +++ b/Windows/CaptureDevice.cpp @@ -205,10 +205,10 @@ HRESULT ReaderCallback::OnReadSample( for (int y = 0; y < dstH; y++) { uint8_t *line = device->imageRGB + y * device->imgRGBLineSizes[0]; for (int x = 0; x < dstW / 2; x++) { - const uint8_t r = line[x * 3]; + const int invX = dstW - 1 - x; + const uint8_t r = line[x * 3 + 0]; const uint8_t g = line[x * 3 + 1]; - const uint8_t b = line[x * 3 + 1]; - const int invX = (dstW - 1 - x); + const uint8_t b = line[x * 3 + 2]; line[x * 3 + 0] = line[invX * 3 + 0]; line[x * 3 + 1] = line[invX * 3 + 1]; line[x * 3 + 2] = line[invX * 3 + 2];