Ore.cs is dead. Long live ResourceLayer.cs.

This commit is contained in:
Chris Forbes
2010-03-03 21:15:44 +13:00
parent 6c229f3273
commit 15b82830a2
8 changed files with 14 additions and 74 deletions

View File

@@ -120,11 +120,13 @@ namespace OpenRA.Graphics
if (oreLayer == null)
{
var res = world.WorldActor.traits.Get<ResourceLayer>();
var colors = terrainTypeColors[world.Map.Theater.ToLowerInvariant()];
oreLayer = new Bitmap(terrain);
for (var y = world.Map.YOffset; y < world.Map.YOffset + world.Map.Height; y++)
for (var x = world.Map.XOffset; x < world.Map.XOffset + world.Map.Width; x++)
if (world.Map.ContainsResource(new int2(x, y)))
if (res.GetResource(new int2(x,y)) != null)
oreLayer.SetPixel(x, y, colors[(int)TerrainMovementType.Ore]);
}