From 6a72e87028d9fc29c2dee19d94b221bde7285758 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Sun, 5 Oct 2014 16:37:07 +1300 Subject: [PATCH] Remove the remaining legacy sprite plumbing. --- OpenRA.Game/Graphics/SpriteLoader.cs | 9 +------ OpenRA.Game/Graphics/SpriteSource.cs | 37 ---------------------------- OpenRA.Game/OpenRA.Game.csproj | 1 - 3 files changed, 1 insertion(+), 46 deletions(-) delete mode 100644 OpenRA.Game/Graphics/SpriteSource.cs diff --git a/OpenRA.Game/Graphics/SpriteLoader.cs b/OpenRA.Game/Graphics/SpriteLoader.cs index 4e53960f44..d542a1ea89 100644 --- a/OpenRA.Game/Graphics/SpriteLoader.cs +++ b/OpenRA.Game/Graphics/SpriteLoader.cs @@ -30,11 +30,6 @@ namespace OpenRA.Graphics bool DisableExportPadding { get; } } - public interface ISpriteSource - { - IReadOnlyList Frames { get; } - } - public class SpriteLoader { public readonly SheetBuilder SheetBuilder; @@ -69,9 +64,7 @@ namespace OpenRA.Graphics if (loader.TryParseSprite(stream, out frames)) return frames; - // Fall back to the hardcoded types (for now). - return SpriteSource.LoadSpriteSource(stream, filename).Frames - .ToArray(); + throw new InvalidDataException(filename + " is not a valid sprite file"); } } diff --git a/OpenRA.Game/Graphics/SpriteSource.cs b/OpenRA.Game/Graphics/SpriteSource.cs deleted file mode 100644 index ee5ae9249a..0000000000 --- a/OpenRA.Game/Graphics/SpriteSource.cs +++ /dev/null @@ -1,37 +0,0 @@ -#region Copyright & License Information -/* - * Copyright 2007-2014 The OpenRA Developers (see AUTHORS) - * This file is part of OpenRA, which is free software. It is made - * available to you under the terms of the GNU General Public License - * as published by the Free Software Foundation. For more information, - * see COPYING. - */ -#endregion - -using System.Drawing; -using System.IO; -using OpenRA.FileFormats; - -namespace OpenRA.Graphics -{ - // TODO: Most of this should be moved into the format parsers themselves. - public enum SpriteType { Unknown } - public static class SpriteSource - { - public static SpriteType DetectSpriteType(Stream s) - { - return SpriteType.Unknown; - } - - public static ISpriteSource LoadSpriteSource(Stream s, string filename) - { - var type = DetectSpriteType(s); - switch (type) - { - case SpriteType.Unknown: - default: - throw new InvalidDataException(filename + " is not a valid sprite file"); - } - } - } -} diff --git a/OpenRA.Game/OpenRA.Game.csproj b/OpenRA.Game/OpenRA.Game.csproj index d44495ed83..6eb94aca68 100644 --- a/OpenRA.Game/OpenRA.Game.csproj +++ b/OpenRA.Game/OpenRA.Game.csproj @@ -313,7 +313,6 @@ -