mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-06 07:14:55 +08:00
[libgdx] Avoid AtomicInteger for GWT.
This commit is contained in:
parent
4e5e82502b
commit
2fc374fd6b
@ -30,19 +30,18 @@
|
||||
|
||||
package com.esotericsoftware.spine.attachments;
|
||||
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import com.badlogic.gdx.utils.FloatArray;
|
||||
import com.esotericsoftware.spine.Bone;
|
||||
import com.esotericsoftware.spine.Skeleton;
|
||||
import com.esotericsoftware.spine.Slot;
|
||||
|
||||
import com.badlogic.gdx.utils.FloatArray;
|
||||
|
||||
/** Base class for an attachment with vertices that are transformed by one or more bones and can be deformed by a slot's
|
||||
* {@link Slot#getAttachmentVertices()}. */
|
||||
public class VertexAttachment extends Attachment {
|
||||
static private final AtomicInteger nextID = new AtomicInteger();
|
||||
static private int nextID;
|
||||
|
||||
private final int id = (nextID.getAndIncrement() & 65535) << 11;
|
||||
private final int id = (nextID() & 65535) << 11;
|
||||
int[] bones;
|
||||
float[] vertices;
|
||||
int worldVerticesLength;
|
||||
@ -162,4 +161,8 @@ public class VertexAttachment extends Attachment {
|
||||
public int getId () {
|
||||
return id;
|
||||
}
|
||||
|
||||
static private synchronized int nextID () {
|
||||
return nextID++;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user