diff --git a/spine-corona/main.lua b/spine-corona/main.lua index 24c332476..eea3a3bfa 100644 --- a/spine-corona/main.lua +++ b/spine-corona/main.lua @@ -75,13 +75,13 @@ function loadSkeleton(atlasFile, jsonFile, x, y, scale, animation, skin) return { skeleton = skeleton, state = animationState } end -table.insert(skeletons, loadSkeleton("coin.atlas", "coin-pro.json", 240, 300, 0.4, "rotate")) -table.insert(skeletons, loadSkeleton("spineboy.atlas", "spineboy-ess.json", 240, 300, 0.4, "walk")) -table.insert(skeletons, loadSkeleton("raptor.atlas", "raptor-pro.json", 200, 300, 0.25, "walk")) -table.insert(skeletons, loadSkeleton("goblins.atlas", "goblins-pro.json", 240, 300, 0.8, "walk", "goblin")) -table.insert(skeletons, loadSkeleton("stretchyman.atlas", "stretchyman-pro.json", 40, 300, 0.5, "sneak")) +-- table.insert(skeletons, loadSkeleton("coin.atlas", "coin-pro.json", 240, 300, 0.4, "rotate")) +-- table.insert(skeletons, loadSkeleton("spineboy.atlas", "spineboy-ess.json", 240, 300, 0.4, "walk")) +-- table.insert(skeletons, loadSkeleton("raptor.atlas", "raptor-pro.json", 200, 300, 0.25, "walk")) +-- table.insert(skeletons, loadSkeleton("goblins.atlas", "goblins-pro.json", 240, 300, 0.8, "walk", "goblin")) +-- table.insert(skeletons, loadSkeleton("stretchyman.atlas", "stretchyman-pro.json", 40, 300, 0.5, "sneak")) table.insert(skeletons, loadSkeleton("tank.atlas", "tank-pro.json", 400, 300, 0.2, "drive")) -table.insert(skeletons, loadSkeleton("vine.atlas", "vine-pro.json", 240, 300, 0.3, "grow")) +-- table.insert(skeletons, loadSkeleton("vine.atlas", "vine-pro.json", 240, 300, 0.3, "grow")) local triangulator = spine.Triangulator.new() local polygon = { 411, 219, 199, 230, 161, 362, 534, 407, 346, 305, 596, 265 } diff --git a/spine-corona/spine-corona/spine.lua b/spine-corona/spine-corona/spine.lua index 5a0b2aa01..4ce6e9dcc 100644 --- a/spine-corona/spine-corona/spine.lua +++ b/spine-corona/spine-corona/spine.lua @@ -169,20 +169,20 @@ function spine.Skeleton:updateWorldTransform() elseif attachment.type == spine.AttachmentType.clipping then self.clipper:clipStart(slot, attachment) end - - local skeleton = slot.bone.skeleton - local skeletonColor = skeleton.color - local slotColor = slot.color - local attachmentColor = attachment.color - local alpha = skeletonColor.a * slotColor.a * attachmentColor.a - local multiplier = alpha - if premultipliedAlpha then multiplier = 1 end - color:set(skeletonColor.r * slotColor.r * attachmentColor.r * multiplier, - skeletonColor.g * slotColor.g * attachmentColor.g * multiplier, - skeletonColor.b * slotColor.b * attachmentColor.b * multiplier, - alpha) if texture and vertices and indices then + local skeleton = slot.bone.skeleton + local skeletonColor = skeleton.color + local slotColor = slot.color + local attachmentColor = attachment.color + local alpha = skeletonColor.a * slotColor.a * attachmentColor.a + local multiplier = alpha + if premultipliedAlpha then multiplier = 1 end + color:set(skeletonColor.r * slotColor.r * attachmentColor.r * multiplier, + skeletonColor.g * slotColor.g * attachmentColor.g * multiplier, + skeletonColor.b * slotColor.b * attachmentColor.b * multiplier, + alpha) + if not lastTexture then lastTexture = texture end if lastColor.r == -1 then lastColor:setFrom(color) end if not lastBlendMode then lastBlendMode = blendMode end