Move TmpTD sprite loading into Mods.Common.

This commit is contained in:
Paul Chote
2014-10-05 16:17:05 +13:00
parent 997c79130a
commit 37cedd88a2
7 changed files with 103 additions and 91 deletions

View File

@@ -15,21 +15,9 @@ using OpenRA.FileFormats;
namespace OpenRA.Graphics
{
// TODO: Most of this should be moved into the format parsers themselves.
public enum SpriteType { Unknown, ShpD2, TmpTD, TmpTS }
public enum SpriteType { Unknown, ShpD2, TmpTS }
public static class SpriteSource
{
static bool IsTmpTD(Stream s)
{
var start = s.Position;
s.Position += 16;
var a = s.ReadUInt32();
var b = s.ReadUInt32();
s.Position = start;
return a == 0 && b == 0x0D1AFFFF;
}
static bool IsTmpTS(Stream s)
{
var start = s.Position;
@@ -93,9 +81,6 @@ namespace OpenRA.Graphics
public static SpriteType DetectSpriteType(Stream s)
{
if (IsTmpTD(s))
return SpriteType.TmpTD;
if (IsTmpTS(s))
return SpriteType.TmpTS;
@@ -110,8 +95,6 @@ namespace OpenRA.Graphics
var type = DetectSpriteType(s);
switch (type)
{
case SpriteType.TmpTD:
return new TmpTDReader(s);
case SpriteType.TmpTS:
return new TmpTSReader(s);
case SpriteType.ShpD2: