Tidy PathfinderDebugOverlay.
This commit is contained in:
@@ -1,4 +1,14 @@
|
|||||||
using System;
|
#region Copyright & License Information
|
||||||
|
/*
|
||||||
|
* Copyright 2007-2013 The OpenRA Developers (see AUTHORS)
|
||||||
|
* This file is part of OpenRA, which is free software. It is made
|
||||||
|
* available to you under the terms of the GNU General Public License
|
||||||
|
* as published by the Free Software Foundation. For more information,
|
||||||
|
* see COPYING.
|
||||||
|
*/
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
@@ -19,11 +29,12 @@ namespace OpenRA.Mods.RA
|
|||||||
|
|
||||||
public void WorldLoaded(World w, WorldRenderer wr)
|
public void WorldLoaded(World w, WorldRenderer wr)
|
||||||
{
|
{
|
||||||
this.world = w;
|
world = w;
|
||||||
this.refreshTick = 0;
|
refreshTick = 0;
|
||||||
this.layers = new Dictionary<Player, int[,]>(8);
|
layers = new Dictionary<Player, int[,]>(8);
|
||||||
|
|
||||||
// Enabled via Cheats menu
|
// Enabled via Cheats menu
|
||||||
this.Visible = false;
|
Visible = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddLayer(IEnumerable<Pair<CPos, int>> cellWeights, int maxWeight, Player pl)
|
public void AddLayer(IEnumerable<Pair<CPos, int>> cellWeights, int maxWeight, Player pl)
|
||||||
@@ -38,7 +49,7 @@ namespace OpenRA.Mods.RA
|
|||||||
}
|
}
|
||||||
|
|
||||||
foreach (var p in cellWeights)
|
foreach (var p in cellWeights)
|
||||||
layer[p.First.X, p.First.Y] = Math.Min(128, (layer[p.First.X, p.First.Y]) + ((maxWeight - p.Second) * 64 / maxWeight));
|
layer[p.First.X, p.First.Y] = Math.Min(128, layer[p.First.X, p.First.Y] + (maxWeight - p.Second) * 64 / maxWeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Render(WorldRenderer wr)
|
public void Render(WorldRenderer wr)
|
||||||
|
|||||||
Reference in New Issue
Block a user