ridiculous perf win in SmudgeLayer
This commit is contained in:
@@ -82,12 +82,18 @@ namespace OpenRA.Traits
|
||||
}
|
||||
|
||||
public void Render()
|
||||
{
|
||||
var tl = world.Map.TopLeft;
|
||||
var br = world.Map.BottomRight;
|
||||
|
||||
for (int x = tl.X; x < br.X; x++)
|
||||
for (int y = tl.Y; y < br.Y; y++)
|
||||
{
|
||||
var cliprect = Game.viewport.ShroudBounds().HasValue
|
||||
? Rectangle.Intersect(Game.viewport.ShroudBounds().Value, world.Map.Bounds) : world.Map.Bounds;
|
||||
|
||||
var minx = cliprect.Left;
|
||||
var maxx = cliprect.Right;
|
||||
|
||||
var miny = cliprect.Top;
|
||||
var maxy = cliprect.Bottom;
|
||||
|
||||
for (int x = minx; x < maxx; x++)
|
||||
for (int y = miny; y < maxy; y++)
|
||||
{
|
||||
var t = new int2(x, y);
|
||||
if (world.LocalPlayer != null && !world.LocalPlayer.Shroud.IsExplored(t) || tiles[x,y].type == 0) continue;
|
||||
|
||||
Reference in New Issue
Block a user