clean up some old BS in SpriteSheetBuilder

This commit is contained in:
Chris Forbes
2010-05-21 12:37:22 +12:00
parent 630aee7b98
commit b662cebfb8

View File

@@ -20,19 +20,20 @@
using System.Linq; using System.Linq;
using OpenRA.FileFormats; using OpenRA.FileFormats;
using OpenRA.Traits;
namespace OpenRA.Graphics namespace OpenRA.Graphics
{ {
static class SpriteSheetBuilder static class SpriteSheetBuilder
{ {
static TheaterInfo GetTheater(Map map)
{ // todo: move this somewhere else
return Rules.Info["world"].Traits.WithInterface<TheaterInfo>().FirstOrDefault(t => t.Theater == map.Theater);
}
public static void Initialize( Map map ) public static void Initialize( Map map )
{ {
exts = new[] { exts = new[] { "." + GetTheater(map).Suffix, ".shp" };
"." + map.Theater.Substring( 0, 3 ).ToLowerInvariant(),
".shp",
".tem",
".sno",
".int" };
sprites = new Cache<string, Sprite[]>( LoadSprites ); sprites = new Cache<string, Sprite[]>( LoadSprites );
} }