changed ResourceLayer to work the same as BibLayer

This commit is contained in:
Chris Forbes
2010-04-18 17:52:34 +12:00
parent 1f3f25de87
commit 9dbed9ed50
2 changed files with 12 additions and 13 deletions

View File

@@ -94,11 +94,9 @@ namespace OpenRA.Traits
var t = new int2(x, y); var t = new int2(x, y);
if (world.LocalPlayer != null && !world.LocalPlayer.Shroud.IsExplored(t) || tiles[x,y].type == 0) continue; if (world.LocalPlayer != null && !world.LocalPlayer.Shroud.IsExplored(t) || tiles[x,y].type == 0) continue;
spriteRenderer.DrawSprite(bibSprites[tiles[x,y].type- 1][tiles[x,y].image], spriteRenderer.DrawSprite(bibSprites[tiles[x, y].type - 1][tiles[x, y].image],
Game.CellSize * (float2)t, "terrain"); Game.CellSize * (float2)t, "terrain");
} }
spriteRenderer.Flush();
} }
} }

View File

@@ -47,8 +47,11 @@ namespace OpenRA.Traits
{ {
var map = world.Map; var map = world.Map;
for (int y = map.YOffset; y < map.YOffset + map.Height; y++) var tl = world.Map.TopLeft;
for (int x = map.XOffset; x < map.XOffset + map.Width; x++) var br = world.Map.BottomRight;
for (int x = tl.X; x < br.X; x++)
for (int y = tl.Y; y < br.Y; y++)
{ {
if (world.LocalPlayer != null && !world.LocalPlayer.Shroud.IsExplored(new int2(x, y))) continue; if (world.LocalPlayer != null && !world.LocalPlayer.Shroud.IsExplored(new int2(x, y))) continue;
@@ -58,8 +61,6 @@ namespace OpenRA.Traits
Game.CellSize * new int2(x, y), Game.CellSize * new int2(x, y),
c.type.info.Palette); c.type.info.Palette);
} }
sr.Flush();
} }
public void WorldLoaded(World w) public void WorldLoaded(World w)