Scissor to map edge.

This commit is contained in:
Paul Chote
2010-11-26 12:29:57 +13:00
parent dd6a431af2
commit 84fd45ad69

View File

@@ -50,9 +50,8 @@ namespace OpenRA.Graphics
Rectangle GetBoundsRect() Rectangle GetBoundsRect()
{ {
if (world.LocalPlayer != null && !world.LocalPlayer.Shroud.Disabled && world.LocalPlayer.Shroud.Bounds.HasValue) var r = (world.LocalPlayer != null && !world.LocalPlayer.Shroud.Disabled && world.LocalPlayer.Shroud.Bounds.HasValue)?
{ world.LocalPlayer.Shroud.Bounds.Value : world.Map.Bounds;
var r = world.LocalPlayer.Shroud.Bounds.Value;
var left = (int)(Game.CellSize * r.Left - Game.viewport.Location.X); var left = (int)(Game.CellSize * r.Left - Game.viewport.Location.X);
var top = (int)(Game.CellSize * r.Top - Game.viewport.Location.Y); var top = (int)(Game.CellSize * r.Top - Game.viewport.Location.Y);
@@ -66,9 +65,6 @@ namespace OpenRA.Graphics
return new Rectangle(left, top, right - left, bottom - top); return new Rectangle(left, top, right - left, bottom - top);
} }
else
return new Rectangle(0, 0, Game.viewport.Width, Game.viewport.Height);
}
IEnumerable<Renderable> SpritesToRender() IEnumerable<Renderable> SpritesToRender()
{ {