git-svn-id: svn://svn.ijw.co.nz/svn/OpenRa@1195 993157c7-ee19-0410-b2c4-bb4e9862e678

This commit is contained in:
chrisf
2007-07-13 11:12:16 +00:00
parent 9ffe1d2845
commit d4a7e5fb9e
10 changed files with 102 additions and 100 deletions

View File

@@ -37,7 +37,7 @@ namespace OpenRa.Game
// assumption: when people fix these items, they might update the warning comment?
public void Draw(Renderer renderer)
public void Draw(Renderer renderer, Range<float> xr, Range<float> yr)
{
int sprites = 0;
List<Vertex> vertices = new List<Vertex>();
@@ -46,10 +46,18 @@ namespace OpenRa.Game
foreach (Actor a in actors)
{
if (a.CurrentImages == null)
SheetRectangle<Sheet>[] images = a.CurrentImages;
if (images == null)
continue;
foreach (SheetRectangle<Sheet> image in a.CurrentImages)
if (a.location.X > xr.End || a.location.X < xr.Start - images[0].size.Width)
continue;
if (a.location.Y > yr.End || a.location.Y < yr.Start - images[0].size.Height)
continue;
foreach (SheetRectangle<Sheet> image in images)
{
if( image.sheet != sheet && sprites > 0 && sheet != null )
{