add alpha channel to every possible blend mode
This commit is contained in:
@@ -17,6 +17,7 @@ namespace OpenRA.Graphics
|
||||
public readonly Rectangle Bounds;
|
||||
public readonly Sheet Sheet;
|
||||
public readonly BlendMode BlendMode;
|
||||
public readonly float Alpha;
|
||||
public readonly TextureChannel Channel;
|
||||
public readonly float2 Size;
|
||||
public readonly float2 Offset;
|
||||
@@ -24,12 +25,9 @@ namespace OpenRA.Graphics
|
||||
public readonly float Top, Left, Bottom, Right;
|
||||
|
||||
public Sprite(Sheet sheet, Rectangle bounds, TextureChannel channel)
|
||||
: this(sheet, bounds, float2.Zero, channel, BlendMode.Alpha) { }
|
||||
: this(sheet, bounds, float2.Zero, 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)
|
||||
public Sprite(Sheet sheet, Rectangle bounds, float2 offset, TextureChannel channel, BlendMode blendMode = BlendMode.Alpha, float alpha = 1f)
|
||||
{
|
||||
Sheet = sheet;
|
||||
Bounds = bounds;
|
||||
@@ -37,6 +35,7 @@ namespace OpenRA.Graphics
|
||||
Channel = channel;
|
||||
Size = new float2(bounds.Size);
|
||||
BlendMode = blendMode;
|
||||
Alpha = alpha;
|
||||
|
||||
FractionalOffset = offset / Size;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user