Skip to content

Commit

Permalink
USB: Fix CaptureEye corruption on dark images
Browse files Browse the repository at this point in the history
  • Loading branch information
Florin9doi authored and lightningterror committed Aug 24, 2024
1 parent 64e17fc commit 517fba3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pcsx2/USB/usb-eyetoy/cam-windows.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ namespace usb_eyetoy
float r = src[2];
float g = src[1];
float b = src[0];
comprBuf[in_pos++] = 0.299f * r + 0.587f * g + 0.114f * b;
comprBuf[in_pos++] = std::clamp<u8>(0.299f * r + 0.587f * g + 0.114f * b, 1, 255);
}
}
comprBuf.resize(80 * 64);
Expand Down Expand Up @@ -498,7 +498,7 @@ namespace usb_eyetoy
{
for (int x = 0; x < 80; x++)
{
comprBuf[80 * y + x] = 255 * y / 80;
comprBuf[80 * y + x] = std::clamp<u8>(255 * y / 80, 1, 255);
}
}
}
Expand Down

0 comments on commit 517fba3

Please sign in to comment.