Replace ColorRamp with HSLColor everywhere.

Fixes:
* Nuclear-purple color exploit.
* #3247.
* Removes a bunch of unnecessary color conversions every frame.

Caveats:
* The ramp range is now defined on the palette, so ramps can no longer be set per-player (may impact maps which define custom colors).
* It's no longer possible to perfectly recreate the original WW color ramps (I doubt we care).
* The old ColorRamp setting isn't migrated, so players will lose their color settings.
This commit is contained in:
Paul Chote
2013-05-10 17:14:22 +12:00
parent abcc30f0b7
commit 656476991f
41 changed files with 112 additions and 168 deletions

View File

@@ -26,7 +26,7 @@ namespace OpenRA
public int Deaths;
public WinState WinState = WinState.Undefined;
public readonly ColorRamp ColorRamp;
public readonly HSLColor Color;
public readonly string PlayerName;
public readonly string InternalName;
@@ -60,7 +60,7 @@ namespace OpenRA
if (client != null)
{
ClientIndex = client.Index;
ColorRamp = client.ColorRamp;
Color = client.Color;
PlayerName = client.Name;
botType = client.Bot;
Country = ChooseCountry(world, client.Country);
@@ -69,7 +69,7 @@ namespace OpenRA
{
// Map player
ClientIndex = 0; // Owned by the host (TODO: fix this)
ColorRamp = pr.ColorRamp;
Color = pr.Color;
PlayerName = pr.Name;
NonCombatant = pr.NonCombatant;
botType = pr.Bot;