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