Move TileSize definition to terrain info.

This commit is contained in:
Paul Chote
2025-03-29 19:15:56 +00:00
committed by Gustas Kažukauskas
parent 0f7b24a8c0
commit 25188e849e
24 changed files with 48 additions and 45 deletions

View File

@@ -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);