From a1bc91c9060704da9c358dedfc34aa708bf80a8e Mon Sep 17 00:00:00 2001 From: Vincent Pelletier Date: Wed, 3 May 2017 16:14:41 +0000 Subject: [PATCH] GRAPHICS: Preserve alpha component in PixelBuffer::copyBuffer --- graphics/pixelbuffer.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/graphics/pixelbuffer.cpp b/graphics/pixelbuffer.cpp index 2b0e5eec9ec..d9e059cf677 100644 --- a/graphics/pixelbuffer.cpp +++ b/graphics/pixelbuffer.cpp @@ -90,10 +90,10 @@ void PixelBuffer::copyBuffer(int thisFrom, int otherFrom, int length, const Pixe if (buf._format == _format) { memcpy(_buffer + thisFrom * _format.bytesPerPixel, buf._buffer + otherFrom * _format.bytesPerPixel, length * _format.bytesPerPixel); } else { - uint8 r, g, b; + uint8 r, g, b, a; for (int i = 0; i < length; ++i) { - buf.getRGBAt(i + otherFrom, r, g, b); - setPixelAt(i + thisFrom, r, g, b); + buf.getARGBAt(i + otherFrom, a, r, g, b); + setPixelAt(i + thisFrom, a, r, g, b); } } }