Support additive blending for D2K explosions.
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
#endregion
|
||||
|
||||
using System.Drawing;
|
||||
using OpenRA.FileFormats.Graphics;
|
||||
|
||||
namespace OpenRA.Graphics
|
||||
{
|
||||
@@ -16,21 +17,26 @@ namespace OpenRA.Graphics
|
||||
{
|
||||
public readonly Rectangle bounds;
|
||||
public readonly Sheet sheet;
|
||||
public readonly BlendMode blendMode;
|
||||
public readonly TextureChannel channel;
|
||||
public readonly float2 size;
|
||||
public readonly float2 offset;
|
||||
readonly float2[] textureCoords;
|
||||
|
||||
public Sprite(Sheet sheet, Rectangle bounds, TextureChannel channel)
|
||||
: this(sheet, bounds, float2.Zero, channel) {}
|
||||
: this(sheet, bounds, float2.Zero, channel, BlendMode.Alpha) {}
|
||||
|
||||
public Sprite(Sheet sheet, Rectangle bounds, float2 offset, TextureChannel channel)
|
||||
public Sprite(Sheet sheet, Rectangle bounds, TextureChannel channel, BlendMode blendMode)
|
||||
: this(sheet, bounds, float2.Zero, channel, blendMode) {}
|
||||
|
||||
public Sprite(Sheet sheet, Rectangle bounds, float2 offset, TextureChannel channel, BlendMode blendMode)
|
||||
{
|
||||
this.sheet = sheet;
|
||||
this.bounds = bounds;
|
||||
this.offset = offset;
|
||||
this.channel = channel;
|
||||
this.size = new float2(bounds.Size);
|
||||
this.blendMode = blendMode;
|
||||
|
||||
var left = (float)(bounds.Left) / sheet.Size.Width;
|
||||
var top = (float)(bounds.Top) / sheet.Size.Height;
|
||||
|
||||
Reference in New Issue
Block a user