forked from OpenRA/OpenRA
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add PlayerPaletteFromCurrentTileset and desert tileset for RA
some things left to do: ore, walls and silo/hbox need some work
- Loading branch information
1 parent
a2f5ffd
commit f3dc31b
Showing
8 changed files
with
2,427 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#region Copyright & License Information | ||
/* | ||
* Copyright 2007-2012 The OpenRA Developers (see AUTHORS) | ||
* This file is part of OpenRA, which is free software. It is made | ||
* available to you under the terms of the GNU General Public License | ||
* as published by the Free Software Foundation. For more information, | ||
* see COPYING. | ||
*/ | ||
#endregion | ||
|
||
using OpenRA.FileFormats; | ||
using OpenRA.Traits; | ||
|
||
namespace OpenRA.Mods.RA | ||
{ | ||
class PlayerPaletteFromCurrentTilesetInfo : ITraitInfo | ||
{ | ||
public readonly string Name = null; | ||
public readonly int[] ShadowIndex = { }; | ||
|
||
public object Create(ActorInitializer init) { return new PlayerPaletteFromCurrentTileset(init.world, this); } | ||
} | ||
|
||
class PlayerPaletteFromCurrentTileset : IPalette | ||
{ | ||
readonly World world; | ||
readonly PlayerPaletteFromCurrentTilesetInfo info; | ||
|
||
public PlayerPaletteFromCurrentTileset(World world, PlayerPaletteFromCurrentTilesetInfo info) | ||
{ | ||
this.world = world; | ||
this.info = info; | ||
} | ||
|
||
public void InitPalette (OpenRA.Graphics.WorldRenderer wr) | ||
{ | ||
string Filename = world.TileSet.PlayerPalette == null ? world.TileSet.Palette : world.TileSet.PlayerPalette; | ||
wr.AddPalette(info.Name, new Palette(FileSystem.Open(Filename), info.ShadowIndex)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.