Convert to 32bbp internally in FastCopyIntoSprite.
This avoids the need for callers to ensure the pixel format is correct, but ensures that the copying succeeds when the format is different.
This commit is contained in:
@@ -392,16 +392,8 @@ namespace OpenRA
|
||||
DefaultSubCell = (SubCell)Game.ModData.Manifest.SubCellDefaultIndex;
|
||||
|
||||
if (Container.Exists("map.png"))
|
||||
{
|
||||
using (var dataStream = Container.GetContent("map.png"))
|
||||
CustomPreview = new Bitmap(dataStream);
|
||||
if (CustomPreview.PixelFormat != PixelFormat.Format32bppArgb)
|
||||
{
|
||||
var original = CustomPreview;
|
||||
CustomPreview = original.CloneWith32bbpArgbPixelFormat();
|
||||
original.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
PostInit();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user