Fix terrain being drawn using the cursor palette.
This commit is contained in:
@@ -48,7 +48,7 @@ namespace OpenRA.Graphics
|
|||||||
Sprite tile = tileMapping[map.MapTiles[i, j]];
|
Sprite tile = tileMapping[map.MapTiles[i, j]];
|
||||||
// TODO: The zero below should explicitly refer to the terrain palette, but this code is called
|
// TODO: The zero below should explicitly refer to the terrain palette, but this code is called
|
||||||
// before the palettes are created. Therefore assumes that "terrain" is the first palette to be defined
|
// before the palettes are created. Therefore assumes that "terrain" is the first palette to be defined
|
||||||
Util.FastCreateQuad(vertices, indices, Game.CellSize * new float2(i, j), tile, 0, nv, ni, tile.size);
|
Util.FastCreateQuad(vertices, indices, Game.CellSize * new float2(i, j), tile, Game.modData.Palette.GetPaletteIndex("terrain"), nv, ni, tile.size);
|
||||||
nv += 4;
|
nv += 4;
|
||||||
ni += 6;
|
ni += 6;
|
||||||
|
|
||||||
|
|||||||
@@ -29,14 +29,13 @@ namespace OpenRA.Graphics
|
|||||||
internal WorldRenderer(World world)
|
internal WorldRenderer(World world)
|
||||||
{
|
{
|
||||||
this.world = world;
|
this.world = world;
|
||||||
|
this.palette = Game.modData.Palette;
|
||||||
|
foreach( var pal in world.traitDict.ActorsWithTraitMultiple<IPalette>( world ) )
|
||||||
|
pal.Trait.InitPalette( this );
|
||||||
|
|
||||||
terrainRenderer = new TerrainRenderer(world, this);
|
terrainRenderer = new TerrainRenderer(world, this);
|
||||||
shroudRenderer = new ShroudRenderer(world);
|
shroudRenderer = new ShroudRenderer(world);
|
||||||
uiOverlay = new UiOverlay();
|
uiOverlay = new UiOverlay();
|
||||||
this.palette = Game.modData.Palette;
|
|
||||||
|
|
||||||
foreach( var pal in world.traitDict.ActorsWithTraitMultiple<IPalette>( world ) )
|
|
||||||
pal.Trait.InitPalette( this );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public int GetPaletteIndex(string name) { return palette.GetPaletteIndex(name); }
|
public int GetPaletteIndex(string name) { return palette.GetPaletteIndex(name); }
|
||||||
|
|||||||
Reference in New Issue
Block a user