Added sub-pixel position/vector types.

Updated Sync code to handle new sub-pixel types.
This commit is contained in:
James Dunne
2012-06-21 17:33:54 -05:00
parent 9c49143534
commit b127ae8027
16 changed files with 484 additions and 283 deletions

View File

@@ -47,6 +47,7 @@ namespace OpenRA
public float2 ToFloat2() { return new float2(X, Y); }
public int2 ToInt2() { return new int2(X, Y); }
public CPos ToCPos() { return new CPos((int)(1f / Game.CellSize * X), (int)(1f / Game.CellSize * Y)); }
public PSubPos ToPSubPos() { return new PSubPos(X * PSubPos.PerPx, Y * PSubPos.PerPx); }
public PPos Clamp(Rectangle r)
{