Cache cell ramps to avoid repeated tileset lookups.

This commit is contained in:
Paul Chote
2020-05-04 00:20:48 +01:00
committed by atlimit8
parent 1354ffc32e
commit 4614f6febe
9 changed files with 37 additions and 56 deletions

View File

@@ -63,11 +63,7 @@ namespace OpenRA.Mods.Common.Traits
continue;
var height = (int)map.Height[uv];
var tile = map.Tiles[uv];
var ti = tileSet.GetTileInfo(tile);
var ramp = ti != null ? ti.RampType : 0;
var corners = map.Grid.CellCorners[ramp];
var corners = map.Grid.CellCorners[map.Ramp[uv]];
var pos = map.CenterOfCell(uv.ToCPos(map));
var width = uv == mouseCell ? 3 : 1;