Merge pull request #6040 from pchote/more-renderables

Convert RenderAfterWorld to use Renderables.
This commit is contained in:
Matthias Mailänder
2014-07-26 07:28:53 +02:00
31 changed files with 619 additions and 298 deletions

View File

@@ -1,6 +1,6 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* Copyright 2007-2014 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,
@@ -8,8 +8,10 @@
*/
#endregion
using System.Collections.Generic;
using System.Drawing;
using OpenRA.Graphics;
using OpenRA.Mods.RA.Graphics;
using OpenRA.Traits;
namespace OpenRA.Mods.RA.Buildings
@@ -61,16 +63,16 @@ namespace OpenRA.Mods.RA.Buildings
return self.Owner == self.World.RenderPlayer || (allyBuildRadius && self.Owner.IsAlliedWith(self.World.RenderPlayer));
}
// Range circle
public void RenderAfterWorld(WorldRenderer wr)
public IEnumerable<IRenderable> RenderAfterWorld(WorldRenderer wr)
{
// Visible to player and allies
if (!ValidRenderPlayer())
return;
yield break;
wr.DrawRangeCircleWithContrast(
yield return new RangeCircleRenderable(
self.CenterPosition,
WRange.FromCells(Info.Range),
0,
Color.FromArgb(128, Ready() ? Color.White : Color.Red),
Color.FromArgb(96, Color.Black)
);