shroud-based scissor. eliminates a lot of shroud render

This commit is contained in:
Chris Forbes
2010-02-01 20:22:17 +13:00
parent 6ea1745094
commit d3c5f56d52
4 changed files with 55 additions and 7 deletions

View File

@@ -66,6 +66,16 @@ namespace OpenRa.Graphics
if (firstRow < 0) firstRow = 0;
if (lastRow > map.Height) lastRow = map.Height;
if (!Game.world.LocalPlayer.Shroud.HasGPS && Game.world.LocalPlayer.Shroud.bounds.HasValue)
{
var r = Game.world.LocalPlayer.Shroud.bounds.Value;
if (firstRow < r.Top - map.YOffset)
firstRow = r.Top - map.YOffset;
if (firstRow > r.Bottom - map.YOffset)
firstRow = r.Bottom - map.YOffset;
}
renderer.SpriteShader.Quality = ShaderQuality.Low;
renderer.SpriteShader.Render(() =>
renderer.DrawBatch(vertexBuffer, indexBuffer,