mirror of
https://github.com/scummvm/scummvm.git
synced 2026-06-20 05:45:29 +00:00
GRAPHICS: Preserve alpha component in PixelBuffer::copyBuffer
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user