Remove unnecessary int2 -> PPos -> int2 conversions.

This commit is contained in:
Paul Chote
2013-09-24 18:18:44 +12:00
parent b335d67ce3
commit 0dc50c65f5
5 changed files with 12 additions and 16 deletions

View File

@@ -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)
{