Remove System.Bitmap from map preview loading.

This commit is contained in:
Paul Chote
2018-12-22 18:58:33 +13:00
parent 4f10d4a302
commit f65a777366
2 changed files with 14 additions and 4 deletions

View File

@@ -12,6 +12,7 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using OpenRA.FileFormats;
namespace OpenRA.Graphics
{
@@ -83,6 +84,14 @@ namespace OpenRA.Graphics
return rect;
}
public Sprite Add(Png src)
{
var rect = Allocate(new Size(src.Width, src.Height));
Util.FastCopyIntoSprite(rect, src);
current.CommitBufferedData();
return rect;
}
public Sprite Add(Size size, byte paletteIndex)
{
var data = new byte[size.Width * size.Height];