Cleaner TileSet init

This commit is contained in:
Paul Chote
2010-06-26 13:33:46 +12:00
parent 08ee425415
commit d275c72cb8
13 changed files with 65 additions and 71 deletions

View File

@@ -26,15 +26,10 @@ namespace OpenRA.Graphics
{
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( TileSet tileset )
{
/* .tem: hack to allow incomplete theaters (interior) to work, falling back to temperate for the missing art */
exts = new[] { "." + GetTheater(map).Suffix, ".shp", ".tem" };
exts = new[] { "." + tileset.TileSuffix, ".shp", ".tem" };
sprites = new Cache<string, Sprite[]>( LoadSprites );
}