Support custom zoom levels

This commit is contained in:
Paul Chote
2011-06-03 20:23:21 +12:00
parent 926b396605
commit fc783ddf80
12 changed files with 55 additions and 55 deletions

View File

@@ -52,14 +52,12 @@ namespace OpenRA.Graphics
IEnumerable<Renderable> SpritesToRender()
{
var bounds = Game.viewport.ViewBounds(world);
var bounds = Game.viewport.WorldBounds(world);
var comparer = new SpriteComparer();
bounds.Offset((int)Game.viewport.Location.X, (int)Game.viewport.Location.Y);
var actors = world.FindUnits(
new int2(bounds.Left, bounds.Top),
new int2(bounds.Right, bounds.Bottom));
new int2(Game.CellSize*bounds.Left, Game.CellSize*bounds.Top),
new int2(Game.CellSize*bounds.Right, Game.CellSize*bounds.Bottom));
var renderables = actors.SelectMany(a => a.Render())
.OrderBy(r => r, comparer);