Introduce initial PPos plumbing.

PPos is best thought of as a cell grid applied in
screen space.  Multiple cells with different
terrain heights may be projected to the same PPos,
or to multiple PPos if they do not align with the
screen grid.

PPos coordinates are used primarily for map edge
checks and shroud / visibility queries.
This commit is contained in:
Paul Chote
2015-06-23 19:41:34 +01:00
parent fb5bcd3889
commit e8794032e0
14 changed files with 381 additions and 63 deletions

View File

@@ -98,8 +98,8 @@ namespace OpenRA.Graphics
var cells = restrictToBounds ? viewport.VisibleCellsInsideBounds : viewport.AllVisibleCells;
// Only draw the rows that are visible.
var firstRow = cells.MapCoords.TopLeft.V;
var lastRow = Math.Min(cells.MapCoords.BottomRight.V + 1, map.MapSize.Y);
var firstRow = cells.CandidateMapCoords.TopLeft.V.Clamp(0, map.MapSize.Y);
var lastRow = (cells.CandidateMapCoords.BottomRight.V + 1).Clamp(firstRow, map.MapSize.Y);
Game.Renderer.Flush();