Sequence clean up.

* Removed unused generics.
* Sequence missing from copy constructors.
* Renamed stop->hold.
This commit is contained in:
Nathan Sweet 2021-10-05 18:00:22 -10:00
parent b1305cf9b0
commit 34870fd759
4 changed files with 5 additions and 3 deletions

View File

@ -2432,7 +2432,7 @@ public class Animation {
final int slotIndex;
final HasTextureRegion attachment;
public <T extends Attachment & HasTextureRegion> SequenceTimeline (int frameCount, int slotIndex, Attachment attachment) {
public SequenceTimeline (int frameCount, int slotIndex, Attachment attachment) {
super(frameCount,
Property.sequence.ordinal() + "|" + slotIndex + "|" + ((HasTextureRegion)attachment).getSequence().getId());
this.slotIndex = slotIndex;
@ -2485,7 +2485,7 @@ public class Animation {
int index = modeAndIndex >> 4, count = attachment.getSequence().getRegions().length;
SequenceMode mode = SequenceMode.values[modeAndIndex & 0xf];
if (mode != SequenceMode.stop) {
if (mode != SequenceMode.hold) {
index += (time - before) / delay + 0.00001f;
switch (mode) {
case once:

View File

@ -80,6 +80,7 @@ public class MeshAttachment extends VertexAttachment implements HasTextureRegion
arraycopy(other.triangles, 0, triangles, 0, triangles.length);
hullLength = other.hullLength;
sequence = new Sequence(sequence);
// Nonessential.
if (other.edges != null) {

View File

@ -75,6 +75,7 @@ public class RegionAttachment extends Attachment implements HasTextureRegion {
arraycopy(other.uvs, 0, uvs, 0, 8);
arraycopy(other.offset, 0, offset, 0, 8);
color.set(other.color);
sequence = new Sequence(sequence);
}
/** Calculates the {@link #offset} and {@link #uvs} using the {@link #region} and the attachment's transform. Must be called if

View File

@ -115,7 +115,7 @@ public class Sequence {
}
static public enum SequenceMode {
stop, once, loop, pingpong, onceReverse, loopReverse, pingpongReverse;
hold, once, loop, pingpong, onceReverse, loopReverse, pingpongReverse;
static public final SequenceMode[] values = values();
}