move SheetBuilder singleton onto ModData

This commit is contained in:
Bob
2010-08-21 17:44:06 +12:00
parent c7b650d6ec
commit 0e16aa339d
7 changed files with 6 additions and 13 deletions

View File

@@ -14,12 +14,6 @@ namespace OpenRA.Graphics
{
public class SheetBuilder
{
public static SheetBuilder SharedInstance;
internal static void Initialize()
{
SharedInstance = new SheetBuilder(TextureChannel.Red);
}
internal SheetBuilder(TextureChannel ch)
{
current = null;

View File

@@ -27,7 +27,7 @@ namespace OpenRA.Graphics
static Sprite[] LoadSprites(string filename)
{
var shp = new ShpReader(FileSystem.OpenWithExts(filename, exts));
return shp.Select(a => SheetBuilder.SharedInstance.Add(a.Image, shp.Size)).ToArray();
return shp.Select(a => Game.modData.SheetBuilder.Add(a.Image, shp.Size)).ToArray();
}
public static Sprite[] LoadAllSprites(string filename) { return sprites[filename]; }

View File

@@ -33,7 +33,7 @@ namespace OpenRA.Graphics
Size tileSize = new Size( Game.CellSize, Game.CellSize );
var tileMapping = new Cache<TileReference<ushort,byte>, Sprite>(
x => SheetBuilder.SharedInstance.Add(world.TileSet.GetBytes(x), tileSize));
x => Game.modData.SheetBuilder.Add(world.TileSet.GetBytes(x), tileSize));
Vertex[] vertices = new Vertex[4 * map.Height * map.Width];
ushort[] indices = new ushort[6 * map.Height * map.Width];