mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-06 07:14:55 +08:00
Merged with origin
This commit is contained in:
commit
241c7980f8
@ -411,9 +411,12 @@ public class SkeletonJson {
|
||||
ClippingAttachment clip = attachmentLoader.newClippingAttachment(skin, name);
|
||||
if (clip == null) return null;
|
||||
|
||||
SlotData slot = skeletonData.findSlot(map.getString("end"));
|
||||
if (slot == null) throw new SerializationException("Slot not found: " + map.getString("end"));
|
||||
clip.setEndSlot(slot.index);
|
||||
String end = map.getString("end", null);
|
||||
if (end != null) {
|
||||
SlotData slot = skeletonData.findSlot(end);
|
||||
if (slot == null) throw new SerializationException("Slot not found: " + end);
|
||||
clip.setEndSlot(slot.index);
|
||||
}
|
||||
|
||||
readVertices(map, clip, map.getInt("vertexCount") << 1);
|
||||
|
||||
|
||||
@ -52,7 +52,6 @@ public class SkeletonRenderer implements Disposable {
|
||||
|
||||
private boolean premultipliedAlpha;
|
||||
private final FloatArray vertices = new FloatArray(32);
|
||||
|
||||
private ImmediateModeRenderer renderer;
|
||||
private final SkeletonClipping clipper = new SkeletonClipping();
|
||||
|
||||
@ -122,6 +121,7 @@ public class SkeletonRenderer implements Disposable {
|
||||
|
||||
if (clipper.isClipping() && clipper.getClippingAttachment().getEndSlot() == i) clipper.clipEnd();
|
||||
}
|
||||
if (clipper.isClipping()) clipper.clipEnd();
|
||||
}
|
||||
|
||||
@SuppressWarnings("null")
|
||||
@ -223,6 +223,7 @@ public class SkeletonRenderer implements Disposable {
|
||||
|
||||
if (clipper.isClipping() && clipper.getClippingAttachment().getEndSlot() == i) clipper.clipEnd();
|
||||
}
|
||||
if (clipper.isClipping()) clipper.clipEnd();
|
||||
}
|
||||
|
||||
@SuppressWarnings("null")
|
||||
@ -331,6 +332,7 @@ public class SkeletonRenderer implements Disposable {
|
||||
|
||||
if (clipper.isClipping() && clipper.getClippingAttachment().getEndSlot() == i) clipper.clipEnd();
|
||||
}
|
||||
if (clipper.isClipping()) clipper.clipEnd();
|
||||
}
|
||||
|
||||
public void setPremultipliedAlpha (boolean premultipliedAlpha) {
|
||||
|
||||
@ -34,7 +34,7 @@ import com.badlogic.gdx.graphics.Color;
|
||||
|
||||
/** An attachment with vertices that make up a polygon used for clipping the rendering of other attachments. */
|
||||
public class ClippingAttachment extends VertexAttachment {
|
||||
int endSlot;
|
||||
int endSlot = -1;
|
||||
|
||||
// Nonessential.
|
||||
final Color color = new Color(0.2275f, 0.2275f, 0.8078f, 1); // ce3a3aff
|
||||
@ -43,7 +43,8 @@ public class ClippingAttachment extends VertexAttachment {
|
||||
super(name);
|
||||
}
|
||||
|
||||
/** Clipping is performed between the clipping polygon's slot and the end slot. */
|
||||
/** Clipping is performed between the clipping polygon's slot and the end slot. Returns -1 if clipping is done until the end of
|
||||
* the skeleton's rendering. */
|
||||
public int getEndSlot () {
|
||||
return endSlot;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user