Move TileSize definition to terrain info.
This commit is contained in:
committed by
Gustas Kažukauskas
parent
0f7b24a8c0
commit
25188e849e
@@ -81,10 +81,10 @@ namespace OpenRA.Mods.Common.Traits
|
||||
cellOffset = new int2(world.Map.AllCells.Min(c => c.X), world.Map.AllCells.Min((c) => c.Y));
|
||||
var cellOffsetMax = new int2(world.Map.AllCells.Max(c => c.X), world.Map.AllCells.Max((c) => c.Y));
|
||||
var mapCellSize = cellOffsetMax - cellOffset;
|
||||
var ts = world.Map.Rules.TerrainInfo.TileSize;
|
||||
cellMap = new SpatiallyPartitioned<EditorActorPreview>(
|
||||
mapCellSize.X, mapCellSize.Y, Exts.IntegerDivisionRoundingAwayFromZero(Info.BinSize, world.Map.Grid.TileSize.Width));
|
||||
mapCellSize.X, mapCellSize.Y, Exts.IntegerDivisionRoundingAwayFromZero(Info.BinSize, ts.Width));
|
||||
|
||||
var ts = world.Map.Grid.TileSize;
|
||||
var width = world.Map.MapSize.X * ts.Width;
|
||||
var height = world.Map.MapSize.Y * ts.Height;
|
||||
screenMap = new SpatiallyPartitioned<EditorActorPreview>(width, height, Info.BinSize);
|
||||
|
||||
@@ -143,7 +143,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
if (info.ViewportHeight.HasValue)
|
||||
{
|
||||
// WPos to world pixels
|
||||
var height = info.ViewportHeight.Value.Length * w.Map.Grid.TileSize.Height / w.Map.Grid.TileScale;
|
||||
var height = info.ViewportHeight.Value.Length * w.Map.Rules.TerrainInfo.TileSize.Height / w.Map.Grid.TileScale;
|
||||
wr.Viewport.OverrideDefaultHeight(height);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -133,7 +133,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
Rectangle ITiledTerrainRenderer.TemplateBounds(TerrainTemplateInfo template)
|
||||
{
|
||||
Rectangle? templateRect = null;
|
||||
var tileSize = map.Grid.TileSize;
|
||||
var tileSize = map.Rules.TerrainInfo.TileSize;
|
||||
|
||||
var i = 0;
|
||||
for (var y = 0; y < template.Size.Y; y++)
|
||||
@@ -162,7 +162,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
if (t is not DefaultTerrainTemplateInfo template)
|
||||
yield break;
|
||||
|
||||
var ts = map.Grid.TileSize;
|
||||
var ts = map.Rules.TerrainInfo.TileSize;
|
||||
var gridType = map.Grid.Type;
|
||||
|
||||
var i = 0;
|
||||
|
||||
Reference in New Issue
Block a user