Add MapGrid class

MapGrid is a mod Manifest field which includes (and thus makes redundant) TileSize, TileShape, SubCells info and MaximumTerrainHeight.
This commit is contained in:
Pavel Penev
2015-09-14 01:55:00 +03:00
parent 699a7f8227
commit 642468ce0c
28 changed files with 164 additions and 157 deletions

View File

@@ -48,7 +48,8 @@ namespace OpenRA.Mods.Common.Widgets
preview.IsVisible = () => editorWidget.CurrentBrush == this;
preview.Template = world.TileSet.Templates.First(t => t.Value.Id == template).Value;
bounds = worldRenderer.Theater.TemplateBounds(preview.Template, Game.ModData.Manifest.TileSize, world.Map.TileShape);
var grid = world.Map.Grid;
bounds = worldRenderer.Theater.TemplateBounds(preview.Template, grid.TileSize, grid.Type);
// The preview widget may be rendered by the higher-level code before it is ticked.
// Force a manual tick to ensure the bounds are set correctly for this first draw.
@@ -106,7 +107,7 @@ namespace OpenRA.Mods.Common.Widgets
continue;
mapTiles[c] = new TerrainTile(Template, index);
mapHeight[c] = (byte)(baseHeight + template[index].Height).Clamp(0, map.MaximumTerrainHeight);
mapHeight[c] = (byte)(baseHeight + template[index].Height).Clamp(0, map.Grid.MaximumTerrainHeight);
}
}
}