浏览代码

Fixed tinting for non-PMA textures.

closes #489
NathanSweet 9 年之前
父节点
当前提交
56abccb508
共有 1 个文件被更改,包括 9 次插入3 次删除
  1. 9 3
      spine-starling/spine-starling/src/spine/starling/SkeletonSprite.as

+ 9 - 3
spine-starling/spine-starling/src/spine/starling/SkeletonSprite.as

@@ -162,9 +162,15 @@ public class SkeletonSprite extends DisplayObject {
 			}
 			if (image) {
 				a *= skeletonA * slot.a;
-				r *= skeletonR * slot.r * a;
-				g *= skeletonG * slot.g * a;
-				b *= skeletonB * slot.b * a;
+				if (image.texture.premultipliedAlpha) {
+					r *= skeletonR * slot.r * a;
+					g *= skeletonG * slot.g * a;
+					b *= skeletonB * slot.b * a;
+				} else {
+					r *= skeletonR * slot.r;
+					g *= skeletonG * slot.g;
+					b *= skeletonB * slot.b;
+				}
 				polygonBatch.add(image.texture, worldVertices, verticesLength, uvs, triangles, r, g, b, a, slot.data.blendMode, matrix);
 			}
 		}