remove FP sillyness from FindUnits & friends

This commit is contained in:
Chris Forbes
2011-05-04 22:25:35 +12:00
parent ccc245ded4
commit 9b3e6c5c4a
10 changed files with 48 additions and 40 deletions

View File

@@ -110,6 +110,9 @@ namespace OpenRA.Graphics
return ViewToWorld(mi.Location);
}
public int2 ViewToWorldPx(int2 loc) { return loc + Location.ToInt2(); }
public int2 ViewToWorldPx(MouseInput mi) { return ViewToWorldPx(mi.Location); }
public void Center(float2 loc)
{
scrollPosition = this.NormalizeScrollPosition((Game.CellSize*loc - screenSize / 2).ToInt2());

View File

@@ -58,8 +58,8 @@ namespace OpenRA.Graphics
bounds.Offset((int)Game.viewport.Location.X, (int)Game.viewport.Location.Y);
var actors = world.FindUnits(
new float2(bounds.Left, bounds.Top),
new float2(bounds.Right, bounds.Bottom));
new int2(bounds.Left, bounds.Top),
new int2(bounds.Right, bounds.Bottom));
var renderables = actors.SelectMany(a => a.Render())
.OrderBy(r => r, comparer);