drop CursorSheetBuilder; use normal SheetBuilder for cursors now.

This commit is contained in:
Chris Forbes
2011-07-17 19:15:55 +12:00
parent 5609c8d041
commit 3d2635fca5
4 changed files with 2 additions and 41 deletions

View File

@@ -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);

View File

@@ -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<string, Sprite[]> cursors;
readonly string[] exts = { ".shp" };
public CursorSheetBuilder( ModData modData )
{
this.modData = modData;
this.cursors = new Cache<string, Sprite[]>( 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]; }
}
}