Fix incorrect cast in Cursor::loadFromPixels Unix implementation

This commit is contained in:
kimci86 2022-04-12 15:46:19 +02:00 committed by Lukas Dürrenberger
parent 2837b3623b
commit 28279c0686

View File

@ -80,7 +80,7 @@ bool CursorImpl::loadFromPixelsARGB(const Uint8* pixels, Vector2u size, Vector2u
const std::size_t numPixels = size.x * size.y;
for (std::size_t pixelIndex = 0; pixelIndex < numPixels; ++pixelIndex)
{
cursorImage->pixels[pixelIndex] = static_cast<Uint8>(pixels[pixelIndex * 4 + 2] +
cursorImage->pixels[pixelIndex] = static_cast<Uint32>(pixels[pixelIndex * 4 + 2] +
(pixels[pixelIndex * 4 + 1] << 8) +
(pixels[pixelIndex * 4 + 0] << 16) +
(pixels[pixelIndex * 4 + 3] << 24));