fix perf in ShroudRenderer

This commit is contained in:
Bob
2010-09-24 17:14:34 +12:00
parent 6dd03bb339
commit 7bf4cb85fa
3 changed files with 9 additions and 4 deletions

View File

@@ -52,7 +52,12 @@ namespace OpenRA.Graphics
public void DrawAt( float2 location, string palette )
{
Game.Renderer.SpriteRenderer.DrawSprite( this, location, palette );
Game.Renderer.SpriteRenderer.DrawSprite( this, location, palette, this.size );
}
public void DrawAt( float2 location, int paletteIndex )
{
Game.Renderer.SpriteRenderer.DrawSprite( this, location, paletteIndex, this.size );
}
public void DrawAt(float2 location, string palette, float2 size)

View File

@@ -151,7 +151,7 @@ namespace OpenRA
var minx = clipRect.Left;
var maxx = clipRect.Right;
var shroudPalette = "fog";
var shroudPalette = Game.world.WorldRenderer.GetPaletteIndex("fog");
for (var j = miny; j < maxy; j++)
{
@@ -183,7 +183,7 @@ namespace OpenRA
new float2(Game.CellSize * (maxx - starti), Game.CellSize));
}
shroudPalette = "shroud";
shroudPalette = Game.world.WorldRenderer.GetPaletteIndex("shroud");
for (var j = miny; j < maxy; j++)
{

View File

@@ -18,7 +18,7 @@ namespace OpenRA.Traits
public class ResourceLayerInfo : TraitInfo<ResourceLayer> { }
public class ResourceLayer: IRenderOverlay, IWorldLoaded
{
{
World world;
public ResourceType[] resourceTypes;