Use MPos indexer for CellLayer in Shroud.

This reduces us to one conversion per cell rather than two or three.
This commit is contained in:
RoosterDragon
2015-03-23 23:23:01 +00:00
parent 1584018dcd
commit 1853ddde94

View File

@@ -128,8 +128,9 @@ namespace OpenRA.Traits
foreach (var c in visible) foreach (var c in visible)
{ {
visibleCount[c]++; var uv = c.ToMPos(map);
explored[c] = true; visibleCount[uv]++;
explored[uv] = true;
} }
if (visibility.ContainsKey(a)) if (visibility.ContainsKey(a))
@@ -146,7 +147,7 @@ namespace OpenRA.Traits
return; return;
foreach (var c in visible) foreach (var c in visible)
visibleCount[c]--; visibleCount[c.ToMPos(map)]--;
visibility.Remove(a); visibility.Remove(a);
Invalidate(visible); Invalidate(visible);