Remove requirement for depth sprites to share color sheet.

This commit is contained in:
Paul Chote
2018-05-31 23:36:14 +00:00
committed by reaperrr
parent 2f2a7724d5
commit 8461a82577
5 changed files with 35 additions and 47 deletions

View File

@@ -50,13 +50,15 @@ namespace OpenRA.Graphics
public class SpriteWithSecondaryData : Sprite
{
public readonly Sheet SecondarySheet;
public readonly Rectangle SecondaryBounds;
public readonly TextureChannel SecondaryChannel;
public readonly float SecondaryTop, SecondaryLeft, SecondaryBottom, SecondaryRight;
public SpriteWithSecondaryData(Sprite s, Rectangle secondaryBounds, TextureChannel secondaryChannel)
public SpriteWithSecondaryData(Sprite s, Sheet secondarySheet, Rectangle secondaryBounds, TextureChannel secondaryChannel)
: base(s.Sheet, s.Bounds, s.ZRamp, s.Offset, s.Channel, s.BlendMode)
{
SecondarySheet = secondarySheet;
SecondaryBounds = secondaryBounds;
SecondaryChannel = secondaryChannel;
SecondaryLeft = (float)Math.Min(secondaryBounds.Left, secondaryBounds.Right) / s.Sheet.Size.Width;