From 70193d6e396735b50fcf47cdd8546aee2a655ed4 Mon Sep 17 00:00:00 2001 From: scape Date: Mon, 4 Nov 2013 17:49:30 +0100 Subject: [PATCH] Slot and animation - color/alpha out of range fix. Normalizing color and alpha during load as both need to be in 0-1 range in the main loop. --- spine-lua/SkeletonJson.lua | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) mode change 100644 => 100755 spine-lua/SkeletonJson.lua diff --git a/spine-lua/SkeletonJson.lua b/spine-lua/SkeletonJson.lua old mode 100644 new mode 100755 index c25611374..be2389727 --- a/spine-lua/SkeletonJson.lua +++ b/spine-lua/SkeletonJson.lua @@ -111,10 +111,10 @@ function SkeletonJson.new (attachmentLoader) local color = slotMap["color"] if color then slotData:setColor( - tonumber(color:sub(1, 2), 16), - tonumber(color:sub(3, 4), 16), - tonumber(color:sub(5, 6), 16), - tonumber(color:sub(7, 8), 16) + tonumber(color:sub(1, 2), 16)/255, + tonumber(color:sub(3, 4), 16)/255, + tonumber(color:sub(5, 6), 16)/255, + tonumber(color:sub(7, 8), 16)/255 ) end @@ -264,10 +264,10 @@ function SkeletonJson.new (attachmentLoader) local color = valueMap["color"] timeline:setFrame( keyframeIndex, time, - tonumber(color:sub(1, 2), 16), - tonumber(color:sub(3, 4), 16), - tonumber(color:sub(5, 6), 16), - tonumber(color:sub(7, 8), 16) + tonumber(color:sub(1, 2), 16)/255, + tonumber(color:sub(3, 4), 16)/255, + tonumber(color:sub(5, 6), 16)/255, + tonumber(color:sub(7, 8), 16)/255 ) readCurve(timeline, keyframeIndex, valueMap) keyframeIndex = keyframeIndex + 1