mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-21 01:36:02 +08:00
Less odd control flow.
End result is the same.
This commit is contained in:
parent
256db33d11
commit
1a92702456
@ -930,10 +930,19 @@ public class Animation {
|
|||||||
float[] frames = this.frames;
|
float[] frames = this.frames;
|
||||||
if (time < frames[0]) { // Time is before first frame.
|
if (time < frames[0]) { // Time is before first frame.
|
||||||
VertexAttachment vertexAttachment = (VertexAttachment)slotAttachment;
|
VertexAttachment vertexAttachment = (VertexAttachment)slotAttachment;
|
||||||
|
|
||||||
switch (pose) {
|
switch (pose) {
|
||||||
case setup:
|
case setup:
|
||||||
break;
|
float[] zeroVertices;
|
||||||
|
if (vertexAttachment.getBones() == null) {
|
||||||
|
// Unweighted vertex positions (setup pose).
|
||||||
|
zeroVertices = vertexAttachment.getVertices();
|
||||||
|
} else {
|
||||||
|
// Weighted deform offsets (zeros).
|
||||||
|
zeroVertices = zeros;
|
||||||
|
if (zeroVertices.length < vertexCount) zeros = zeroVertices = new float[vertexCount];
|
||||||
|
}
|
||||||
|
System.arraycopy(zeroVertices, 0, vertices, 0, vertexCount);
|
||||||
|
return;
|
||||||
case current:
|
case current:
|
||||||
if (alpha == 1) break;
|
if (alpha == 1) break;
|
||||||
if (vertexAttachment.getBones() == null) {
|
if (vertexAttachment.getBones() == null) {
|
||||||
@ -947,21 +956,7 @@ public class Animation {
|
|||||||
for (int i = 0; i < vertexCount; i++)
|
for (int i = 0; i < vertexCount; i++)
|
||||||
vertices[i] *= alpha;
|
vertices[i] *= alpha;
|
||||||
}
|
}
|
||||||
// Fall thru.
|
|
||||||
default:
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
float[] zeroVertices;
|
|
||||||
if (vertexAttachment.getBones() == null) {
|
|
||||||
// Unweighted vertex positions (setup pose).
|
|
||||||
zeroVertices = vertexAttachment.getVertices();
|
|
||||||
} else {
|
|
||||||
// Weighted deform offsets (zeros).
|
|
||||||
zeroVertices = zeros;
|
|
||||||
if (zeroVertices.length < vertexCount) zeros = zeroVertices = new float[vertexCount];
|
|
||||||
}
|
|
||||||
System.arraycopy(zeroVertices, 0, vertices, 0, vertexCount);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user