Integrate CellRegion with Map, Viewport.

This commit is contained in:
Paul Chote
2014-05-17 01:00:03 +12:00
parent 52ab8f3ca1
commit 386b71de82
3 changed files with 41 additions and 8 deletions

View File

@@ -46,9 +46,9 @@ namespace OpenRA.Graphics
public void Draw(WorldRenderer wr, Viewport viewport)
{
var verticesPerRow = 4*map.Bounds.Width;
var bounds = viewport.CellBounds;
var firstRow = bounds.Top - map.Bounds.Top;
var lastRow = bounds.Bottom - map.Bounds.Top;
var cells = viewport.VisibleCells;
var firstRow = cells.TopLeft.Y - map.Bounds.Top;
var lastRow = cells.BottomRight.Y - map.Bounds.Top + 1;
if (lastRow < 0 || firstRow > map.Bounds.Height)
return;