add alpha channel to every possible blend mode

This commit is contained in:
Matthias Mailänder
2015-04-19 08:18:31 +02:00
parent 1b31001661
commit 63e4d40770
8 changed files with 25 additions and 34 deletions

View File

@@ -119,12 +119,13 @@ namespace OpenRA.Mods.Common.Graphics
var offset = LoadField<float2>(d, "Offset", float2.Zero);
var blendMode = LoadField<BlendMode>(d, "BlendMode", BlendMode.Alpha);
var alpha = LoadField<float>(d, "Alpha", 1f);
// Apply offset to each sprite in the sequence
// Different sequences may apply different offsets to the same frame
var src = GetSpriteSrc(modData, tileSet, sequence, animation, info.Value, d);
sprites = cache[src].Select(
s => new Sprite(s.Sheet, s.Bounds, s.Offset + offset, s.Channel, blendMode)).ToArray();
s => new Sprite(s.Sheet, s.Bounds, s.Offset + offset, s.Channel, blendMode, alpha)).ToArray();
MiniYaml length;
if (d.TryGetValue("Length", out length) && length.Value == "*")