Skip to content

Commit

Permalink
add PlayerPaletteFromCurrentTileset and desert tileset for RA
Browse files Browse the repository at this point in the history
some things left to do:
ore, walls and silo/hbox need some work
  • Loading branch information
Mailaender committed Nov 17, 2012
1 parent a2f5ffd commit f3dc31b
Show file tree
Hide file tree
Showing 8 changed files with 2,427 additions and 4 deletions.
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ mods/*/*.dll
# ReSharper crap
_ReSharper.*/

# Red Alert binary files
mods/*/packages/*.[mM][iI][xX]

#binary stuff
/*.dll
*.pdb
Expand Down
1 change: 1 addition & 0 deletions OpenRA.FileFormats/Map/TileSet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ public class TileSet
public string Name;
public string Id;
public string Palette;
public string PlayerPalette;
public int TileSize = 24;
public string[] Extensions;
public int WaterPaletteRotationBase = 0x60;
Expand Down
41 changes: 41 additions & 0 deletions OpenRA.Mods.RA/PlayerPaletteFromCurrentTileset.cs
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));
}
}
}
3 changes: 3 additions & 0 deletions mods/ra/mod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Folders:
.
./mods/ra
./mods/ra/bits
./mods/ra/packages
./mods/ra/uibits
~^/Content/ra

Expand All @@ -24,6 +25,7 @@ Packages:
temperat.mix
snow.mix
interior.mix
desert.mix
~scores.mix
~movies1.mix
~movies2.mix
Expand Down Expand Up @@ -79,6 +81,7 @@ TileSets:
mods/ra/tilesets/snow.yaml
mods/ra/tilesets/interior.yaml
mods/ra/tilesets/temperat.yaml
mods/ra/tilesets/desert.yaml

Music:
mods/ra/music.yaml
Expand Down
Binary file added mods/ra/packages/desert.mix
Binary file not shown.
Binary file added mods/ra/packages/desertt.mix
Binary file not shown.
5 changes: 4 additions & 1 deletion mods/ra/rules/system.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ Player:
harv: 10%
SquadSize: 7
PlayerColorPalette:
BasePalette: terrain
BasePalette: player
RemapIndex: 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95
DebugResourceCash:
DebugResourceOre:
Expand All @@ -208,6 +208,9 @@ World:
Maximum: 3
SpawnInterval: 120
WaterChance: .2
PlayerPaletteFromCurrentTileset:
Name: player
ShadowIndex: 4
PaletteFromCurrentTileset:
Name: terrain
ShadowIndex: 3,4
Expand Down
Loading

0 comments on commit f3dc31b

Please sign in to comment.