Work around the undesired R8 terrain sprite offsets.

This commit is contained in:
Paul Chote
2014-10-23 20:59:18 +13:00
parent aab9ad5ac0
commit 63f5fc8613
3 changed files with 10 additions and 2 deletions

View File

@@ -42,7 +42,13 @@ namespace OpenRA.Graphics
{
var allFrames = frameCache[t.Value.Image];
var frames = t.Value.Frames != null ? t.Value.Frames.Select(f => allFrames[f]).ToArray() : allFrames;
templates.Add(t.Value.Id, frames.Select(f => sheetBuilder.Add(f)).ToArray());
var sprites = frames.Select(f => sheetBuilder.Add(f));
// Ignore the offsets baked into R8 sprites
if (tileset.IgnoreTileSpriteOffsets)
sprites = sprites.Select(s => new Sprite(s.sheet, s.bounds, float2.Zero, s.channel, s.blendMode));
templates.Add(t.Value.Id, sprites.ToArray());
}
// 1x1px transparent tile