don't look up resource type every cell for ore, too
This commit is contained in:
@@ -37,6 +37,9 @@ namespace OpenRA.Traits
|
|||||||
var miny = cliprect.Top;
|
var miny = cliprect.Top;
|
||||||
var maxy = cliprect.Bottom;
|
var maxy = cliprect.Bottom;
|
||||||
|
|
||||||
|
foreach( var rt in world.WorldActor.TraitsImplementing<ResourceType>() )
|
||||||
|
rt.info.PaletteIndex = world.WorldRenderer.GetPaletteIndex(rt.info.Palette);
|
||||||
|
|
||||||
for (int x = minx; x < maxx; x++)
|
for (int x = minx; x < maxx; x++)
|
||||||
for (int y = miny; y < maxy; y++)
|
for (int y = miny; y < maxy; y++)
|
||||||
{
|
{
|
||||||
@@ -48,7 +51,7 @@ namespace OpenRA.Traits
|
|||||||
if (c.image != null)
|
if (c.image != null)
|
||||||
c.image[c.density].DrawAt(
|
c.image[c.density].DrawAt(
|
||||||
Game.CellSize * new int2(x, y),
|
Game.CellSize * new int2(x, y),
|
||||||
c.type.info.Palette);
|
c.type.info.PaletteIndex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ namespace OpenRA.Traits
|
|||||||
public readonly string TerrainType = "Ore";
|
public readonly string TerrainType = "Ore";
|
||||||
|
|
||||||
public Sprite[][] Sprites;
|
public Sprite[][] Sprites;
|
||||||
|
public int PaletteIndex;
|
||||||
|
|
||||||
public object Create(ActorInitializer init) { return new ResourceType(this); }
|
public object Create(ActorInitializer init) { return new ResourceType(this); }
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user