Skip to content

Commit

Permalink
[lua] Port of commit 8290353. Fix for hold previous on 3+ animations …
Browse files Browse the repository at this point in the history
…causing dipping. See #1738.
  • Loading branch information
badlogic committed Aug 13, 2020
1 parent c0d8f1c commit 0f8ffd6
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions spine-lua/AnimationState.lua
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,9 @@ end
local EMPTY_ANIMATION = Animation.new("<empty>", {}, 0)
local SUBSEQUENT = 0
local FIRST = 1
local HOLD = 2
local HOLD_MIX = 3
local HOLD_SUBSEQUENT = 2
local HOLD_FIRST = 3
local HOLD_MIX = 4

local SETUP = 1
local CURRENT = 2
Expand Down Expand Up @@ -466,7 +467,10 @@ function AnimationState:applyMixingFrom (to, skeleton, blend)
elseif timelineMode[i] == FIRST then
timelineBlend = MixBlend.setup
alpha = alphaMix
elseif timelineMode[i] == HOLD then
elseif timelineMode[i] == HOLD_SUBSEQUENT then
timelineBlend = blend
alpha = alphaHold
elseif timelineMode[i] == HOLD_FIRST then
timelineBlend = MixBlend.setup
alpha = alphaHold
else
Expand Down Expand Up @@ -932,8 +936,10 @@ function AnimationState:computeHold(entry)
local id = "" .. timelines[i]:getPropertyId()
if propertyIDs[id] == nil then
propertyIDs[id] = id
timelineMode[i] = HOLD_FIRST
else
timelineMode[i] = HOLD_SUBSEQUENT
end
timelineMode[i] = HOLD
end
return
end
Expand Down Expand Up @@ -966,7 +972,7 @@ function AnimationState:computeHold(entry)
end
next = next.mixingTo
end
if not skip then timelineMode[i] = HOLD end
if not skip then timelineMode[i] = HOLD_FIRST end
end
end
i = i + 1
Expand Down

0 comments on commit 0f8ffd6

Please sign in to comment.