Support tmp(ts) templates with empty tiles.
This commit is contained in:
@@ -29,6 +29,8 @@ namespace OpenRA.Mods.TS.SpriteLoaders
|
|||||||
public bool DisableExportPadding { get { return false; } }
|
public bool DisableExportPadding { get { return false; } }
|
||||||
|
|
||||||
public TmpTSFrame(Stream s, Size size)
|
public TmpTSFrame(Stream s, Size size)
|
||||||
|
{
|
||||||
|
if (s.Position != 0)
|
||||||
{
|
{
|
||||||
Size = size;
|
Size = size;
|
||||||
|
|
||||||
@@ -51,6 +53,9 @@ namespace OpenRA.Mods.TS.SpriteLoaders
|
|||||||
// Ignore Z-data for now
|
// Ignore Z-data for now
|
||||||
// Ignore extra data for now
|
// Ignore extra data for now
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
Data = new byte[0];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsTmpTS(Stream s)
|
bool IsTmpTS(Stream s)
|
||||||
@@ -60,8 +65,10 @@ namespace OpenRA.Mods.TS.SpriteLoaders
|
|||||||
var sx = s.ReadUInt32();
|
var sx = s.ReadUInt32();
|
||||||
var sy = s.ReadUInt32();
|
var sy = s.ReadUInt32();
|
||||||
|
|
||||||
// Find the first frame
|
// Find the first non-empty frame
|
||||||
var offset = s.ReadUInt32();
|
var offset = s.ReadUInt32();
|
||||||
|
while (offset == 0)
|
||||||
|
offset = s.ReadUInt32();
|
||||||
|
|
||||||
if (offset > s.Length - 52)
|
if (offset > s.Length - 52)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user