Support additive blending for D2K explosions.
This commit is contained in:
@@ -12,6 +12,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using OpenRA.FileFormats;
|
||||
using OpenRA.FileFormats.Graphics;
|
||||
|
||||
namespace OpenRA.Graphics
|
||||
{
|
||||
@@ -36,16 +37,20 @@ namespace OpenRA.Graphics
|
||||
Name = name;
|
||||
var d = info.NodesDict;
|
||||
var offset = float2.Zero;
|
||||
var blendMode = BlendMode.Alpha;
|
||||
|
||||
Start = int.Parse(d["Start"].Value);
|
||||
|
||||
if (d.ContainsKey("Offset"))
|
||||
offset = FieldLoader.GetValue<float2>("Offset", d["Offset"].Value);
|
||||
|
||||
if (d.ContainsKey("BlendMode"))
|
||||
blendMode = FieldLoader.GetValue<BlendMode>("BlendMode", d["BlendMode"].Value);
|
||||
|
||||
// Apply offset to each sprite in the sequence
|
||||
// Different sequences may apply different offsets to the same frame
|
||||
sprites = Game.modData.SpriteLoader.LoadAllSprites(srcOverride ?? unit).Select(
|
||||
s => new Sprite(s.sheet, s.bounds, s.offset + offset, s.channel)).ToArray();
|
||||
s => new Sprite(s.sheet, s.bounds, s.offset + offset, s.channel, blendMode)).ToArray();
|
||||
|
||||
if (!d.ContainsKey("Length"))
|
||||
Length = 1;
|
||||
|
||||
Reference in New Issue
Block a user