Rewrite TS minimap rendering:

* Rename LeftColor and RightColor to MinColor and MaxColor
  These are mapped from LowRadarColor and HighRadarColor in
  the original inis, and appear to be used to set the bounding
  values for selecting a random colour, NOT for left/right
  pixels (which caused noticeably wrong banding).

* Adjust brightness based on terrain height.
  MinHeightColorBrightness and MaxHeightColorBrightness
  were chosen by trial/error to match the original
  map preview rendering.
This commit is contained in:
Paul Chote
2020-06-18 21:48:59 +01:00
committed by Oliver Brakmann
parent 83c53e17e0
commit 5f588561b6
29 changed files with 11931 additions and 11843 deletions

View File

@@ -24,9 +24,8 @@ namespace OpenRA
public readonly byte TerrainType = byte.MaxValue;
public readonly byte Height;
public readonly byte RampType;
public readonly Color LeftColor;
public readonly Color RightColor;
public readonly Color MinColor;
public readonly Color MaxColor;
public readonly float ZOffset = 0.0f;
public readonly float ZRamp = 1.0f;
}
@@ -106,11 +105,11 @@ namespace OpenRA
// Fall back to the terrain-type color if necessary
var overrideColor = tileSet.TerrainInfo[tile.TerrainType].Color;
if (tile.LeftColor == default(Color))
tile.GetType().GetField("LeftColor").SetValue(tile, overrideColor);
if (tile.MinColor == default(Color))
tile.GetType().GetField("MinColor").SetValue(tile, overrideColor);
if (tile.RightColor == default(Color))
tile.GetType().GetField("RightColor").SetValue(tile, overrideColor);
if (tile.MaxColor == default(Color))
tile.GetType().GetField("MaxColor").SetValue(tile, overrideColor);
return tile;
}
@@ -139,6 +138,8 @@ namespace OpenRA
public readonly string[] EditorTemplateOrder;
public readonly bool IgnoreTileSpriteOffsets;
public readonly bool EnableDepth = false;
public readonly float MinHeightColorBrightness = 1.0f;
public readonly float MaxHeightColorBrightness = 1.0f;
[FieldLoader.Ignore]
public readonly IReadOnlyDictionary<ushort, TerrainTemplateInfo> Templates;