diff --git a/OpenRA.Game/Graphics/CursorSequence.cs b/OpenRA.Game/Graphics/CursorSequence.cs index d662d528e3..fce809310d 100644 --- a/OpenRA.Game/Graphics/CursorSequence.cs +++ b/OpenRA.Game/Graphics/CursorSequence.cs @@ -28,7 +28,7 @@ namespace OpenRA.Graphics public CursorSequence(string cursorSrc, string palette, MiniYaml info) { - sprites = Game.modData.CursorSheetBuilder.LoadAllSprites(cursorSrc); + sprites = Game.modData.SpriteLoader.LoadAllSprites(cursorSrc); var d = info.NodesDict; start = int.Parse(d["start"].Value); diff --git a/OpenRA.Game/Graphics/CursorSheetBuilder.cs b/OpenRA.Game/Graphics/CursorSheetBuilder.cs deleted file mode 100644 index ff60b6eda2..0000000000 --- a/OpenRA.Game/Graphics/CursorSheetBuilder.cs +++ /dev/null @@ -1,37 +0,0 @@ -#region Copyright & License Information -/* - * Copyright 2007-2011 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; -using System.Linq; -using OpenRA.FileFormats; - -namespace OpenRA.Graphics -{ - public class CursorSheetBuilder - { - ModData modData; - Cache cursors; - readonly string[] exts = { ".shp" }; - - public CursorSheetBuilder( ModData modData ) - { - this.modData = modData; - this.cursors = new Cache( LoadCursors ); - } - - Sprite[] LoadCursors(string filename) - { - var shp = new ShpReader(FileSystem.OpenWithExts(filename, exts)); - return shp.Select(a => modData.SheetBuilder.Add(a.Image, shp.Size)).ToArray(); - } - - public Sprite[] LoadAllSprites(string filename) { return cursors[filename]; } - } -} diff --git a/OpenRA.Game/ModData.cs b/OpenRA.Game/ModData.cs index 03b41b326a..a864ba81a9 100755 --- a/OpenRA.Game/ModData.cs +++ b/OpenRA.Game/ModData.cs @@ -26,7 +26,6 @@ namespace OpenRA public readonly WidgetLoader WidgetLoader; public ILoadScreen LoadScreen = null; public SheetBuilder SheetBuilder; - public CursorSheetBuilder CursorSheetBuilder; public SpriteLoader SpriteLoader; public HardwarePalette Palette { get; private set; } IFolder previousMapMount = null; @@ -59,7 +58,7 @@ namespace OpenRA ChromeMetrics.Initialize(Manifest.ChromeMetrics); ChromeProvider.Initialize(Manifest.Chrome); SheetBuilder = new SheetBuilder(TextureChannel.Red); - CursorSheetBuilder = new CursorSheetBuilder(this); + SpriteLoader = new SpriteLoader(new string[] { ".shp" }, SheetBuilder); CursorProvider.Initialize(Manifest.Cursors); Palette.Update(new IPaletteModifier[] { }); } diff --git a/OpenRA.Game/OpenRA.Game.csproj b/OpenRA.Game/OpenRA.Game.csproj index c9c034fc8a..9d38df3298 100755 --- a/OpenRA.Game/OpenRA.Game.csproj +++ b/OpenRA.Game/OpenRA.Game.csproj @@ -112,7 +112,6 @@ -