mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-21 01:36:02 +08:00
[lua] Fixed bug in AnimationState, indexing of timelines was incorrect. Fixed but in AttachmentTimeline, called wrong setAttachment
This commit is contained in:
parent
65982c7eca
commit
2e252783a7
@ -581,7 +581,7 @@ function Animation.AttachmentTimeline.new (frameCount)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function self:getPropertyId ()
|
function self:getPropertyId ()
|
||||||
return Timeline.attachment * SHL_24 + self.slotIndex
|
return TimelineType.attachment * SHL_24 + self.slotIndex
|
||||||
end
|
end
|
||||||
|
|
||||||
function self:apply (skeleton, lastTime, time, firedEvents, alpha, setupPose, mixingOut)
|
function self:apply (skeleton, lastTime, time, firedEvents, alpha, setupPose, mixingOut)
|
||||||
@ -592,7 +592,7 @@ function Animation.AttachmentTimeline.new (frameCount)
|
|||||||
if not attachmentName then
|
if not attachmentName then
|
||||||
slot:setAttachment(nil)
|
slot:setAttachment(nil)
|
||||||
else
|
else
|
||||||
skeleton:setAttachment(skeleton:getAttachmentByIndex(self.slotIndex, attachmentName))
|
slot:setAttachment(skeleton:getAttachmentByIndex(self.slotIndex, attachmentName))
|
||||||
end
|
end
|
||||||
return;
|
return;
|
||||||
end
|
end
|
||||||
@ -767,7 +767,7 @@ function Animation.EventTimeline.new (frameCount)
|
|||||||
}
|
}
|
||||||
|
|
||||||
function self:getPropertyId ()
|
function self:getPropertyId ()
|
||||||
return Timeline.event * SHL_24
|
return TimelineType.event * SHL_24
|
||||||
end
|
end
|
||||||
|
|
||||||
function self:getFrameCount ()
|
function self:getFrameCount ()
|
||||||
@ -824,7 +824,7 @@ function Animation.DrawOrderTimeline.new (frameCount)
|
|||||||
}
|
}
|
||||||
|
|
||||||
function self:getPropertyId ()
|
function self:getPropertyId ()
|
||||||
return Timeline.drawOrder * SHL_24
|
return TimelineType.drawOrder * SHL_24
|
||||||
end
|
end
|
||||||
|
|
||||||
function self:getFrameCount ()
|
function self:getFrameCount ()
|
||||||
|
|||||||
@ -232,18 +232,18 @@ function AnimationState:update (delta)
|
|||||||
end
|
end
|
||||||
|
|
||||||
if not skip then
|
if not skip then
|
||||||
local next = current.next
|
local _next = current.next
|
||||||
if next then
|
if _next then
|
||||||
-- When the next entry's delay is passed, change to the next entry, preserving leftover time.
|
-- When the next entry's delay is passed, change to the next entry, preserving leftover time.
|
||||||
local nextTime = current.trackLast - next.delay
|
local nextTime = current.trackLast - _next.delay
|
||||||
if nextTime >= 0 then
|
if nextTime >= 0 then
|
||||||
next.delay = 0
|
_next.delay = 0
|
||||||
next.trackTime = nextTime + delta * next.timeScale
|
_next.trackTime = nextTime + delta * _next.timeScale
|
||||||
current.trackTime = current.trackTime + currentDelta
|
current.trackTime = current.trackTime + currentDelta
|
||||||
self:setCurrent(i, next)
|
self:setCurrent(i, _next)
|
||||||
while next.mixingFrom do
|
while _next.mixingFrom do
|
||||||
next.mixTime = next.mixTime + currentDelta
|
_next.mixTime = _next.mixTime + currentDelta
|
||||||
next = next.mixingFrom
|
_next = _next.mixingFrom
|
||||||
end
|
end
|
||||||
skip = true
|
skip = true
|
||||||
end
|
end
|
||||||
@ -708,9 +708,9 @@ function AnimationState:_animationsChanged ()
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- Set timelinesFirst for all entries, from lowest track to highest.
|
-- Set timelinesFirst for all entries, from lowest track to highest.
|
||||||
local i = 1
|
local i = 0
|
||||||
local n = highest
|
local n = highest + 1
|
||||||
while i <= n do
|
while i < n do
|
||||||
local entry = tracks[i]
|
local entry = tracks[i]
|
||||||
if entry then
|
if entry then
|
||||||
self:setTimelinesFirst(entry);
|
self:setTimelinesFirst(entry);
|
||||||
@ -719,7 +719,7 @@ function AnimationState:_animationsChanged ()
|
|||||||
end
|
end
|
||||||
i = i + 1
|
i = i + 1
|
||||||
end
|
end
|
||||||
while i <= n do
|
while i < n do
|
||||||
local entry = tracks[i]
|
local entry = tracks[i]
|
||||||
if entry then self:checkTimelinesFirst(entry) end
|
if entry then self:checkTimelinesFirst(entry) end
|
||||||
i = i + 1
|
i = i + 1
|
||||||
@ -756,6 +756,7 @@ function AnimationState:checkTimelinesUsage (entry, usageArray)
|
|||||||
local n = #entry.animation.timelines
|
local n = #entry.animation.timelines
|
||||||
local timelines = entry.animation.timelines
|
local timelines = entry.animation.timelines
|
||||||
local usage = usageArray
|
local usage = usageArray
|
||||||
|
local i = 1
|
||||||
while i <= n do
|
while i <= n do
|
||||||
local id = "" .. timelines[i]:getPropertyId()
|
local id = "" .. timelines[i]:getPropertyId()
|
||||||
local contained = propertyIDs[id] == id
|
local contained = propertyIDs[id] == id
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user