Fix screenshot pixel opacity.

This commit is contained in:
Paul Chote
2018-12-31 14:54:53 +00:00
parent 8c94f262b6
commit e23b6f8a9d

View File

@@ -134,6 +134,16 @@ namespace OpenRA.Platforms.Default
OpenGL.glPopClientAttrib();
// Reset alpha channel to fully opaque
unsafe
{
var colors = (int*)data.Scan0;
var stride = data.Stride / 4;
for (var y = 0; y < rect.Height; y++)
for (var x = 0; x < rect.Width; x++)
colors[y * stride + x] |= 0xFF << 24;
}
bitmap.UnlockBits(data);
// OpenGL standard defines the origin in the bottom left corner which is why this is upside-down by default.