Support loading sprites with non-zero offsets.

This commit is contained in:
Paul Chote
2013-07-16 19:38:19 +12:00
parent fc458d191d
commit da4a2f548b

View File

@@ -51,9 +51,10 @@ namespace OpenRA.Graphics
this.allocateSheet = allocateSheet;
}
public Sprite Add(byte[] src, Size size)
public Sprite Add(byte[] src, Size size) { return Add(src, size, float2.Zero); }
public Sprite Add(byte[] src, Size size, float2 spriteOffset)
{
var rect = Allocate(size);
var rect = Allocate(size, spriteOffset);
Util.FastCopyIntoChannel(rect, src);
current.CommitData();
return rect;