Add ShpRemastered sprite loader.

This commit is contained in:
Paul Chote
2020-10-08 22:42:06 +01:00
committed by reaperrr
parent f341c9a8a6
commit f51603e440
2 changed files with 129 additions and 0 deletions

View File

@@ -75,6 +75,11 @@ namespace OpenRA.Mods.Common.SpriteLoaders
public byte[] Data { get; private set; }
public bool DisableExportPadding { get { return false; } }
public TgaFrame()
{
Data = new byte[0];
}
public TgaFrame(Stream stream)
{
using (var tga = Targa.Create(stream, new PfimConfig()))
@@ -90,6 +95,13 @@ namespace OpenRA.Mods.Common.SpriteLoaders
}
}
}
public TgaFrame(Stream stream, Size frameSize, Rectangle frameWindow)
: this(stream)
{
FrameSize = frameSize;
Offset = 0.5f * new float2(frameWindow.Left + frameWindow.Right - FrameSize.Width, frameWindow.Top + frameWindow.Bottom - FrameSize.Height);
}
}
public IReadOnlyList<ISpriteFrame> Frames { get; private set; }