Replace IOrderGenerator.RenderBeforeWorld with world-sorted .Render.

Range circles have been moved to RenderAfterWorld for now.
This commit is contained in:
Paul Chote
2013-08-10 21:28:39 +12:00
parent b02fd0d002
commit 4754cbb768
21 changed files with 86 additions and 67 deletions

View File

@@ -68,8 +68,8 @@ namespace OpenRA.Mods.RA.Orders
}
public void Tick(World world) {}
public void RenderAfterWorld(WorldRenderer wr, World world) {}
public void RenderBeforeWorld(WorldRenderer wr, World world)
public IEnumerable<IRenderable> Render(WorldRenderer wr, World world) { yield break; }
public void RenderAfterWorld(WorldRenderer wr, World world)
{
var position = Game.viewport.ViewToWorld(Viewport.LastMousePos);
var topLeft = position - FootprintUtils.AdjustForBuildingSize(BuildingInfo);
@@ -110,7 +110,10 @@ namespace OpenRA.Mods.RA.Orders
var pal = wr.Palette("terrain");
foreach (var c in cells)
(c.Value ? buildOk : buildBlocked).DrawAt(c.Key.ToPPos().ToFloat2(), pal);
{
var tile = c.Value ? buildOk : buildBlocked;
tile.DrawAt(wr.ScreenPxPosition(c.Key.CenterPosition) - 0.5f * tile.size, pal);
}
}
public string GetCursor(World world, CPos xy, MouseInput mi) { return "default"; }