Fix camera mirroring color issue, fix warning

This commit is contained in:
Henrik Rydgård 2024-05-05 11:20:29 +02:00
parent 906da3d194
commit d769c3223c
2 changed files with 5 additions and 5 deletions

View File

@ -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) {

View File

@ -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];