mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-04 14:24:53 +08:00
Fixed AnimationState#clearNext.
This commit is contained in:
parent
5ac9ed372e
commit
d4271ccae9
@ -106,7 +106,7 @@ package spine.animation {
|
|||||||
if (current.trackLast >= current.trackEnd && current.mixingFrom == null) {
|
if (current.trackLast >= current.trackEnd && current.mixingFrom == null) {
|
||||||
tracks[i] = null;
|
tracks[i] = null;
|
||||||
queue.end(current);
|
queue.end(current);
|
||||||
disposeNext(current);
|
clearNext(current);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -445,7 +445,7 @@ package spine.animation {
|
|||||||
|
|
||||||
queue.end(current);
|
queue.end(current);
|
||||||
|
|
||||||
disposeNext(current);
|
clearNext(current);
|
||||||
|
|
||||||
var entry : TrackEntry = current;
|
var entry : TrackEntry = current;
|
||||||
while (true) {
|
while (true) {
|
||||||
@ -462,11 +462,6 @@ package spine.animation {
|
|||||||
queue.drain();
|
queue.drain();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Removes the {@link TrackEntry#getNext() next entry} and all entries after it for the specified entry. */
|
|
||||||
private function clearNext(entry : TrackEntry) : void {
|
|
||||||
disposeNext(entry.next);
|
|
||||||
}
|
|
||||||
|
|
||||||
private function setCurrent(index : int, current : TrackEntry, interrupt : Boolean) : void {
|
private function setCurrent(index : int, current : TrackEntry, interrupt : Boolean) : void {
|
||||||
var from : TrackEntry = expandToIndex(index);
|
var from : TrackEntry = expandToIndex(index);
|
||||||
tracks[index] = current;
|
tracks[index] = current;
|
||||||
@ -504,11 +499,11 @@ package spine.animation {
|
|||||||
tracks[trackIndex] = current.mixingFrom;
|
tracks[trackIndex] = current.mixingFrom;
|
||||||
queue.interrupt(current);
|
queue.interrupt(current);
|
||||||
queue.end(current);
|
queue.end(current);
|
||||||
disposeNext(current);
|
clearNext(current);
|
||||||
current = current.mixingFrom;
|
current = current.mixingFrom;
|
||||||
interrupt = false;
|
interrupt = false;
|
||||||
} else
|
} else
|
||||||
disposeNext(current);
|
clearNext(current);
|
||||||
}
|
}
|
||||||
var entry : TrackEntry = trackEntry(trackIndex, animation, loop, current);
|
var entry : TrackEntry = trackEntry(trackIndex, animation, loop, current);
|
||||||
setCurrent(trackIndex, entry, interrupt);
|
setCurrent(trackIndex, entry, interrupt);
|
||||||
@ -609,7 +604,8 @@ package spine.animation {
|
|||||||
return entry;
|
return entry;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function disposeNext(entry : TrackEntry) : void {
|
/** Removes the {@link TrackEntry#getNext() next entry} and all entries after it for the specified entry. */
|
||||||
|
public function clearNext(entry : TrackEntry) : void {
|
||||||
var next : TrackEntry = entry.next;
|
var next : TrackEntry = entry.next;
|
||||||
while (next != null) {
|
while (next != null) {
|
||||||
queue.dispose(next);
|
queue.dispose(next);
|
||||||
|
|||||||
@ -170,7 +170,7 @@ namespace Spine {
|
|||||||
// Clear the track when there is no next entry, the track end time is reached, and there is no mixingFrom.
|
// Clear the track when there is no next entry, the track end time is reached, and there is no mixingFrom.
|
||||||
tracksItems[i] = null;
|
tracksItems[i] = null;
|
||||||
queue.End(current);
|
queue.End(current);
|
||||||
DisposeNext(current);
|
ClearNext(current);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (current.mixingFrom != null && UpdateMixingFrom(current, delta)) {
|
if (current.mixingFrom != null && UpdateMixingFrom(current, delta)) {
|
||||||
@ -615,7 +615,7 @@ namespace Spine {
|
|||||||
|
|
||||||
queue.End(current);
|
queue.End(current);
|
||||||
|
|
||||||
DisposeNext(current);
|
ClearNext(current);
|
||||||
|
|
||||||
TrackEntry entry = current;
|
TrackEntry entry = current;
|
||||||
while (true) {
|
while (true) {
|
||||||
@ -632,12 +632,6 @@ namespace Spine {
|
|||||||
queue.Drain();
|
queue.Drain();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Removes the <see cref="TrackEntry.Next">next entry</see> and all entries after it for the specified entry.</summary>
|
|
||||||
public void ClearNext (TrackEntry entry) {
|
|
||||||
DisposeNext(entry.next);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>Sets the active TrackEntry for a given track number.</summary>
|
/// <summary>Sets the active TrackEntry for a given track number.</summary>
|
||||||
private void SetCurrent (int index, TrackEntry current, bool interrupt) {
|
private void SetCurrent (int index, TrackEntry current, bool interrupt) {
|
||||||
TrackEntry from = ExpandToIndex(index);
|
TrackEntry from = ExpandToIndex(index);
|
||||||
@ -683,11 +677,11 @@ namespace Spine {
|
|||||||
tracks.Items[trackIndex] = current.mixingFrom;
|
tracks.Items[trackIndex] = current.mixingFrom;
|
||||||
queue.Interrupt(current);
|
queue.Interrupt(current);
|
||||||
queue.End(current);
|
queue.End(current);
|
||||||
DisposeNext(current);
|
ClearNext(current);
|
||||||
current = current.mixingFrom;
|
current = current.mixingFrom;
|
||||||
interrupt = false; // mixingFrom is current again, but don't interrupt it twice.
|
interrupt = false; // mixingFrom is current again, but don't interrupt it twice.
|
||||||
} else
|
} else
|
||||||
DisposeNext(current);
|
ClearNext(current);
|
||||||
}
|
}
|
||||||
TrackEntry entry = NewTrackEntry(trackIndex, animation, loop, current);
|
TrackEntry entry = NewTrackEntry(trackIndex, animation, loop, current);
|
||||||
SetCurrent(trackIndex, entry, interrupt);
|
SetCurrent(trackIndex, entry, interrupt);
|
||||||
@ -836,8 +830,8 @@ namespace Spine {
|
|||||||
return entry;
|
return entry;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>Dispose all track entries queued after the given TrackEntry.</summary>
|
/// <summary>Removes the <see cref="TrackEntry.Next">next entry</see> and all entries after it for the specified entry.</summary>
|
||||||
private void DisposeNext (TrackEntry entry) {
|
public void ClearNext (TrackEntry entry) {
|
||||||
TrackEntry next = entry.next;
|
TrackEntry next = entry.next;
|
||||||
while (next != null) {
|
while (next != null) {
|
||||||
queue.Dispose(next);
|
queue.Dispose(next);
|
||||||
|
|||||||
@ -150,7 +150,7 @@ public class AnimationState {
|
|||||||
// Clear the track when there is no next entry, the track end time is reached, and there is no mixingFrom.
|
// Clear the track when there is no next entry, the track end time is reached, and there is no mixingFrom.
|
||||||
tracks[i] = null;
|
tracks[i] = null;
|
||||||
queue.end(current);
|
queue.end(current);
|
||||||
disposeNext(current);
|
clearNext(current);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (current.mixingFrom != null && updateMixingFrom(current, delta)) {
|
if (current.mixingFrom != null && updateMixingFrom(current, delta)) {
|
||||||
@ -514,7 +514,7 @@ public class AnimationState {
|
|||||||
|
|
||||||
queue.end(current);
|
queue.end(current);
|
||||||
|
|
||||||
disposeNext(current);
|
clearNext(current);
|
||||||
|
|
||||||
TrackEntry entry = current;
|
TrackEntry entry = current;
|
||||||
while (true) {
|
while (true) {
|
||||||
@ -531,11 +531,6 @@ public class AnimationState {
|
|||||||
queue.drain();
|
queue.drain();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Removes the {@link TrackEntry#getNext() next entry} and all entries after it for the specified entry. */
|
|
||||||
public void clearNext (TrackEntry entry) {
|
|
||||||
disposeNext(entry.next);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setCurrent (int index, TrackEntry current, boolean interrupt) {
|
private void setCurrent (int index, TrackEntry current, boolean interrupt) {
|
||||||
TrackEntry from = expandToIndex(index);
|
TrackEntry from = expandToIndex(index);
|
||||||
tracks.set(index, current);
|
tracks.set(index, current);
|
||||||
@ -583,11 +578,11 @@ public class AnimationState {
|
|||||||
tracks.set(trackIndex, current.mixingFrom);
|
tracks.set(trackIndex, current.mixingFrom);
|
||||||
queue.interrupt(current);
|
queue.interrupt(current);
|
||||||
queue.end(current);
|
queue.end(current);
|
||||||
disposeNext(current);
|
clearNext(current);
|
||||||
current = current.mixingFrom;
|
current = current.mixingFrom;
|
||||||
interrupt = false; // mixingFrom is current again, but don't interrupt it twice.
|
interrupt = false; // mixingFrom is current again, but don't interrupt it twice.
|
||||||
} else
|
} else
|
||||||
disposeNext(current);
|
clearNext(current);
|
||||||
}
|
}
|
||||||
TrackEntry entry = trackEntry(trackIndex, animation, loop, current);
|
TrackEntry entry = trackEntry(trackIndex, animation, loop, current);
|
||||||
setCurrent(trackIndex, entry, interrupt);
|
setCurrent(trackIndex, entry, interrupt);
|
||||||
@ -730,7 +725,8 @@ public class AnimationState {
|
|||||||
return entry;
|
return entry;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void disposeNext (TrackEntry entry) {
|
/** Removes the {@link TrackEntry#getNext() next entry} and all entries after it for the specified entry. */
|
||||||
|
public void clearNext (TrackEntry entry) {
|
||||||
TrackEntry next = entry.next;
|
TrackEntry next = entry.next;
|
||||||
while (next != null) {
|
while (next != null) {
|
||||||
queue.dispose(next);
|
queue.dispose(next);
|
||||||
|
|||||||
@ -284,7 +284,7 @@ function AnimationState:update (delta)
|
|||||||
if current.trackLast >= current.trackEnd and current.mixingFrom == nil then
|
if current.trackLast >= current.trackEnd and current.mixingFrom == nil then
|
||||||
tracks[i] = nil
|
tracks[i] = nil
|
||||||
queue:_end(current)
|
queue:_end(current)
|
||||||
self:disposeNext(current)
|
self:clearNext(current)
|
||||||
skip = true
|
skip = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -679,7 +679,7 @@ function AnimationState:clearTrack (trackIndex)
|
|||||||
|
|
||||||
queue:_end(current)
|
queue:_end(current)
|
||||||
|
|
||||||
self:disposeNext(current)
|
self:clearNext(current)
|
||||||
|
|
||||||
local entry = current
|
local entry = current
|
||||||
while (true) do
|
while (true) do
|
||||||
@ -696,10 +696,6 @@ function AnimationState:clearTrack (trackIndex)
|
|||||||
queue:drain()
|
queue:drain()
|
||||||
end
|
end
|
||||||
|
|
||||||
function AnimationState:clearNext (entry)
|
|
||||||
self:disposeNext(entry.next)
|
|
||||||
end
|
|
||||||
|
|
||||||
function AnimationState:setCurrent (index, current, interrupt)
|
function AnimationState:setCurrent (index, current, interrupt)
|
||||||
local from = self:expandToIndex(index)
|
local from = self:expandToIndex(index)
|
||||||
self.tracks[index] = current
|
self.tracks[index] = current
|
||||||
@ -739,11 +735,11 @@ function AnimationState:setAnimation (trackIndex, animation, loop)
|
|||||||
tracks[trackIndex] = current.mixingFrom
|
tracks[trackIndex] = current.mixingFrom
|
||||||
queue:interrupt(current)
|
queue:interrupt(current)
|
||||||
queue:_end(current)
|
queue:_end(current)
|
||||||
self:disposeNext(current)
|
self:clearNext(current)
|
||||||
current = current.mixingFrom
|
current = current.mixingFrom
|
||||||
interrupt = false
|
interrupt = false
|
||||||
else
|
else
|
||||||
self:disposeNext(current)
|
self:clearNext(current)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
local entry = self:trackEntry(trackIndex, animation, loop, current)
|
local entry = self:trackEntry(trackIndex, animation, loop, current)
|
||||||
@ -860,7 +856,7 @@ function AnimationState:trackEntry (trackIndex, animation, loop, last)
|
|||||||
return entry
|
return entry
|
||||||
end
|
end
|
||||||
|
|
||||||
function AnimationState:disposeNext (entry)
|
function AnimationState:clearNext (entry)
|
||||||
local _next = entry.next
|
local _next = entry.next
|
||||||
local queue = self.queue
|
local queue = self.queue
|
||||||
while _next do
|
while _next do
|
||||||
|
|||||||
@ -102,7 +102,7 @@ module spine {
|
|||||||
} else if (current.trackLast >= current.trackEnd && !current.mixingFrom) {
|
} else if (current.trackLast >= current.trackEnd && !current.mixingFrom) {
|
||||||
tracks[i] = null;
|
tracks[i] = null;
|
||||||
this.queue.end(current);
|
this.queue.end(current);
|
||||||
this.disposeNext(current);
|
this.clearNext(current);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (current.mixingFrom && this.updateMixingFrom(current, delta)) {
|
if (current.mixingFrom && this.updateMixingFrom(current, delta)) {
|
||||||
@ -460,7 +460,7 @@ module spine {
|
|||||||
|
|
||||||
this.queue.end(current);
|
this.queue.end(current);
|
||||||
|
|
||||||
this.disposeNext(current);
|
this.clearNext(current);
|
||||||
|
|
||||||
let entry = current;
|
let entry = current;
|
||||||
while (true) {
|
while (true) {
|
||||||
@ -477,11 +477,6 @@ module spine {
|
|||||||
this.queue.drain();
|
this.queue.drain();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Removes the {@link TrackEntry#getNext() next entry} and all entries after it for the specified entry. */
|
|
||||||
clearNext(entry: TrackEntry) {
|
|
||||||
this.disposeNext(entry.next);
|
|
||||||
}
|
|
||||||
|
|
||||||
setCurrent (index: number, current: TrackEntry, interrupt: boolean) {
|
setCurrent (index: number, current: TrackEntry, interrupt: boolean) {
|
||||||
let from = this.expandToIndex(index);
|
let from = this.expandToIndex(index);
|
||||||
this.tracks[index] = current;
|
this.tracks[index] = current;
|
||||||
@ -528,11 +523,11 @@ module spine {
|
|||||||
this.tracks[trackIndex] = current.mixingFrom;
|
this.tracks[trackIndex] = current.mixingFrom;
|
||||||
this.queue.interrupt(current);
|
this.queue.interrupt(current);
|
||||||
this.queue.end(current);
|
this.queue.end(current);
|
||||||
this.disposeNext(current);
|
this.clearNext(current);
|
||||||
current = current.mixingFrom;
|
current = current.mixingFrom;
|
||||||
interrupt = false;
|
interrupt = false;
|
||||||
} else
|
} else
|
||||||
this.disposeNext(current);
|
this.clearNext(current);
|
||||||
}
|
}
|
||||||
let entry = this.trackEntry(trackIndex, animation, loop, current);
|
let entry = this.trackEntry(trackIndex, animation, loop, current);
|
||||||
this.setCurrent(trackIndex, entry, interrupt);
|
this.setCurrent(trackIndex, entry, interrupt);
|
||||||
@ -673,7 +668,8 @@ module spine {
|
|||||||
return entry;
|
return entry;
|
||||||
}
|
}
|
||||||
|
|
||||||
disposeNext (entry: TrackEntry) {
|
/** Removes the {@link TrackEntry#getNext() next entry} and all entries after it for the specified entry. */
|
||||||
|
clearNext (entry: TrackEntry) {
|
||||||
let next = entry.next;
|
let next = entry.next;
|
||||||
while (next) {
|
while (next) {
|
||||||
this.queue.dispose(next);
|
this.queue.dispose(next);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user