Support loading sprites with non-zero offsets.
This commit is contained in:
@@ -51,9 +51,10 @@ namespace OpenRA.Graphics
|
|||||||
this.allocateSheet = allocateSheet;
|
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);
|
Util.FastCopyIntoChannel(rect, src);
|
||||||
current.CommitData();
|
current.CommitData();
|
||||||
return rect;
|
return rect;
|
||||||
|
|||||||
Reference in New Issue
Block a user