Render shroud outside map bounds.

Fixes a regression from #8337.
This commit is contained in:
Paul Chote
2015-06-15 17:57:04 +01:00
parent aee951c86f
commit 2156a234db
10 changed files with 66 additions and 39 deletions

View File

@@ -25,6 +25,7 @@ namespace OpenRA.Graphics
readonly Vertex[] vertices;
readonly HashSet<int> dirtyRows = new HashSet<int>();
readonly int rowStride;
readonly bool restrictToBounds;
readonly WorldRenderer worldRenderer;
readonly Map map;
@@ -34,9 +35,10 @@ namespace OpenRA.Graphics
float paletteIndex;
public TerrainSpriteLayer(World world, WorldRenderer wr, Sheet sheet, BlendMode blendMode, PaletteReference palette)
public TerrainSpriteLayer(World world, WorldRenderer wr, Sheet sheet, BlendMode blendMode, PaletteReference palette, bool restrictToBounds)
{
worldRenderer = wr;
this.restrictToBounds = restrictToBounds;
this.sheet = sheet;
this.blendMode = blendMode;
paletteIndex = palette.TextureIndex;
@@ -92,7 +94,7 @@ namespace OpenRA.Graphics
public void Draw(Viewport viewport)
{
var cells = viewport.VisibleCells;
var cells = restrictToBounds ? viewport.VisibleCellsInsideBounds : viewport.AllVisibleCells;
// Only draw the rows that are visible.
var firstRow = cells.MapCoords.TopLeft.V;