Improve shroud performance

This commit is contained in:
Adam Mitchell
2021-01-18 19:34:53 +00:00
committed by reaperrr
parent 5cf622fb6e
commit 9ee7294c81
2 changed files with 18 additions and 3 deletions

View File

@@ -15,6 +15,8 @@ namespace OpenRA
{
public sealed class ProjectedCellLayer<T> : CellLayerBase<T>
{
public int MaxIndex { get { return Size.Width * Size.Height; } }
public ProjectedCellLayer(Map map)
: base(map) { }
@@ -27,6 +29,11 @@ namespace OpenRA
return uv.V * Size.Width + uv.U;
}
public PPos PPosFromIndex(int index)
{
return new PPos(index % Size.Width, index / Size.Width);
}
public T this[int index]
{
get