Allow world and (render-) player actors to render.

This commit is contained in:
Paul Chote
2013-08-07 13:53:32 +12:00
parent e4d1c654ed
commit 0a9d920eb6

View File

@@ -73,9 +73,15 @@ namespace OpenRA.Graphics
var bounds = Game.viewport.WorldBounds(world); var bounds = Game.viewport.WorldBounds(world);
var comparer = new RenderableComparer(this); var comparer = new RenderableComparer(this);
var actors = world.FindActorsInBox( var tl = bounds.TopLeftAsCPos();
bounds.TopLeftAsCPos(), var br = bounds.BottomRightAsCPos();
bounds.BottomRightAsCPos()); var actors = world.FindActorsInBox(tl, br)
.Append(world.WorldActor)
.ToList();
// Include player actor for the rendered player
if (world.RenderPlayer != null)
actors.Add(world.RenderPlayer.PlayerActor);
var worldRenderables = actors.SelectMany(a => a.Render(this)); var worldRenderables = actors.SelectMany(a => a.Render(this));
if (world.OrderGenerator != null) if (world.OrderGenerator != null)