Allow SheetBuilder to throw an exception on sheet overflow.

This removes unnecessary checks from TerrainRenderer
and will be used in the voxel renderer.
This commit is contained in:
Paul Chote
2013-05-06 19:46:00 +12:00
parent c13c989fe8
commit 891158ca44
5 changed files with 44 additions and 47 deletions

View File

@@ -99,9 +99,9 @@ namespace OpenRA.Mods.RA
if (cachedTileset != self.World.Map.Tileset)
{
cachedTileset = self.World.Map.Tileset;
var tileSize = new Size(Game.CellSize, Game.CellSize);
sprites = new Cache<TileReference<ushort,byte>, Sprite>(
x => Game.modData.SheetBuilder.Add(self.World.TileSet.GetBytes(x),
new Size(Game.CellSize, Game.CellSize)));
x => Game.modData.SheetBuilder.Add(self.World.TileSet.GetBytes(x), tileSize, true));
}
// Cache templates and tiles for the different states