From 61906bcf1fe8e02b068bdc0d704372f0d67e4d2f Mon Sep 17 00:00:00 2001 From: NathanSweet Date: Thu, 11 Dec 2014 03:14:48 +0100 Subject: [PATCH] Fixed premultiplied alpha. --- .../src/com/esotericsoftware/spine/SkeletonRenderer.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SkeletonRenderer.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SkeletonRenderer.java index 81936d836..e0c58a241 100644 --- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SkeletonRenderer.java +++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SkeletonRenderer.java @@ -71,14 +71,14 @@ public class SkeletonRenderer { } else if (attachment instanceof MeshAttachment) { MeshAttachment mesh = (MeshAttachment)attachment; - mesh.updateWorldVertices(slot, true); + mesh.updateWorldVertices(slot, premultipliedAlpha); vertices = mesh.getWorldVertices(); triangles = mesh.getTriangles(); texture = mesh.getRegion().getTexture(); } else if (attachment instanceof SkinnedMeshAttachment) { SkinnedMeshAttachment mesh = (SkinnedMeshAttachment)attachment; - mesh.updateWorldVertices(slot, true); + mesh.updateWorldVertices(slot, premultipliedAlpha); vertices = mesh.getWorldVertices(); triangles = mesh.getTriangles(); texture = mesh.getRegion().getTexture(); @@ -141,8 +141,10 @@ public class SkeletonRenderer { batch.setBlendFunction(srcFunc, GL20.GL_ONE_MINUS_SRC_ALPHA); } batch.draw(regionAttachment.getRegion().getTexture(), vertices, 0, 20); + } else if (attachment instanceof MeshAttachment || attachment instanceof SkinnedMeshAttachment) { throw new RuntimeException("PolygonSpriteBatch is required to render meshes."); + } else if (attachment instanceof SkeletonAttachment) { Skeleton attachmentSkeleton = ((SkeletonAttachment)attachment).getSkeleton(); if (attachmentSkeleton == null) continue;