Allow tilesets to specify their sheet size.
Decreased the default size from 4096 to 512.
This commit is contained in:
@@ -77,6 +77,7 @@ namespace OpenRA.FileFormats
|
||||
{
|
||||
public string Name;
|
||||
public string Id;
|
||||
public int SheetSize = 512;
|
||||
public string Palette;
|
||||
public string PlayerPalette;
|
||||
public string[] Extensions;
|
||||
@@ -85,7 +86,7 @@ namespace OpenRA.FileFormats
|
||||
public Dictionary<ushort, TileTemplate> Templates = new Dictionary<ushort, TileTemplate>();
|
||||
public string[] EditorTemplateOrder;
|
||||
|
||||
static readonly string[] fields = {"Name", "TileSize", "Id", "Palette", "Extensions"};
|
||||
static readonly string[] fields = {"Name", "TileSize", "Id", "SheetSize", "Palette", "Extensions"};
|
||||
|
||||
public TileSet() {}
|
||||
|
||||
|
||||
@@ -42,11 +42,10 @@ namespace OpenRA.Graphics
|
||||
Func<Sheet> allocate = () =>
|
||||
{
|
||||
if (allocated)
|
||||
throw new SheetOverflowException("Terrain sheet overflow");
|
||||
throw new SheetOverflowException("Terrain sheet overflow. Try increasing the tileset SheetSize parameter.");
|
||||
allocated = true;
|
||||
|
||||
// TODO: Use a fixed sheet size specified in the tileset yaml
|
||||
return SheetBuilder.AllocateSheet();
|
||||
return new Sheet(new Size(tileset.SheetSize, tileset.SheetSize));
|
||||
};
|
||||
|
||||
templates = new Dictionary<ushort, Sprite[]>();
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
General:
|
||||
Name: Arrakis
|
||||
Id: ARRAKIS
|
||||
SheetSize: 1024
|
||||
Palette: d2k.pal
|
||||
Extensions: .bas,.bat,.bgb,.ice,.tre,.was,.ext,.shp
|
||||
|
||||
|
||||
Reference in New Issue
Block a user