Added support for per-layer shadow flag

Added support for per-layer shadow flag
Set automatically for now based on blendMode
This commit is contained in:
Collin Smith
2020-09-13 13:15:50 -07:00
parent c98c3dc2c8
commit add2ea22b5

View File

@ -459,7 +459,7 @@ public class Animation extends BaseDrawable implements Pool.Poolable {
if (handleBlends) batch.setBlendMode(BlendMode.SOLID, SHADOW_TINT); if (handleBlends) batch.setBlendMode(BlendMode.SOLID, SHADOW_TINT);
if (cof == null) { if (cof == null) {
for (Layer layer : layers) { for (Layer layer : layers) {
if (layer == null) continue; if (layer == null || !layer.shadow) continue;
drawShadow(batch, layer, x, y); drawShadow(batch, layer, x, y);
} }
} else if (frame < numFrames) { } else if (frame < numFrames) {
@ -558,6 +558,7 @@ public class Animation extends BaseDrawable implements Pool.Poolable {
Color tint; Color tint;
Index transform; Index transform;
int transformColor; int transformColor;
boolean shadow;
TextureRegion regions[][]; TextureRegion regions[][];
@ -588,6 +589,7 @@ public class Animation extends BaseDrawable implements Pool.Poolable {
numFrames = dc.getNumFramesPerDir(); numFrames = dc.getNumFramesPerDir();
transform = null; transform = null;
transformColor = 0; transformColor = 0;
shadow = (blendMode != BlendMode.LUMINOSITY && blendMode != BlendMode.LUMINOSITY_TINT);
return this; return this;
} }