added units to minimap

This commit is contained in:
Chris Forbes
2010-01-04 00:16:48 +13:00
parent fa873662fa
commit 5f5a0a8e72

View File

@@ -1,4 +1,6 @@
using System.Drawing;
using System.Linq;
using OpenRa.Game.Traits;
namespace OpenRa.Game.Graphics
{
@@ -48,13 +50,14 @@ namespace OpenRa.Game.Graphics
for( var y = 0; y < 128; y++ )
for (var x = 0; x < 128; x++)
{
// todo: units, perf.
var b = Game.BuildingInfluence.GetBuildingAt(new int2(x, y));
if (b != null)
bitmap.SetPixel(x, y, b.Owner != null ? Chat.paletteColors[(int)b.Owner.Palette] : Color.Gray);
}
foreach (var a in Game.world.Actors.Where(a => a.traits.Contains<Unit>()))
bitmap.SetPixel(a.Location.X, a.Location.Y, Chat.paletteColors[(int)a.Owner.Palette]);
sheet.Texture.SetData(bitmap);
}