Remove unnecessary int2 -> PPos -> int2 conversions.
This commit is contained in:
@@ -149,9 +149,8 @@ namespace OpenRA.Graphics
|
||||
return (CPos)( (1f / Game.CellSize) * (1f/Zoom*loc.ToFloat2() + Location) ).ToInt2();
|
||||
}
|
||||
|
||||
public PPos ViewToWorldPx(int2 loc) { return (PPos)(1f/Zoom*loc.ToFloat2() + Location).ToInt2(); }
|
||||
public PPos ViewToWorldPx(MouseInput mi) { return ViewToWorldPx(mi.Location); }
|
||||
public int2 WorldToViewPx(PPos loc) { return (Zoom * (loc.ToFloat2() - Location)).ToInt2(); }
|
||||
public int2 ViewToWorldPx(int2 loc) { return (1f/Zoom*loc.ToFloat2() + Location).ToInt2(); }
|
||||
public int2 WorldToViewPx(int2 loc) { return (Zoom * (loc.ToFloat2() - Location)).ToInt2(); }
|
||||
|
||||
public void Center(float2 loc)
|
||||
{
|
||||
|
||||
@@ -75,8 +75,8 @@ namespace OpenRA.Graphics
|
||||
{
|
||||
var comparer = new RenderableComparer(this);
|
||||
var vb = Game.viewport.ViewBounds(world);
|
||||
var tl = Game.viewport.ViewToWorldPx(new int2(vb.Left, vb.Top)).ToInt2();
|
||||
var br = Game.viewport.ViewToWorldPx(new int2(vb.Right, vb.Bottom)).ToInt2();
|
||||
var tl = Game.viewport.ViewToWorldPx(new int2(vb.Left, vb.Top));
|
||||
var br = Game.viewport.ViewToWorldPx(new int2(vb.Right, vb.Bottom));
|
||||
var actors = world.ScreenMap.ActorsInBox(tl, br)
|
||||
.Append(world.WorldActor)
|
||||
.ToList();
|
||||
|
||||
Reference in New Issue
Block a user