mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-06 02:36:56 +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);
|
ClippingAttachment clip = attachmentLoader.newClippingAttachment(skin, name);
|
||||||
if (clip == null) return null;
|
if (clip == null) return null;
|
||||||
|
|
||||||
SlotData slot = skeletonData.findSlot(map.getString("end"));
|
String end = map.getString("end", null);
|
||||||
if (slot == null) throw new SerializationException("Slot not found: " + map.getString("end"));
|
if (end != null) {
|
||||||
clip.setEndSlot(slot.index);
|
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);
|
readVertices(map, clip, map.getInt("vertexCount") << 1);
|
||||||
|
|
||||||
|
|||||||
@ -52,7 +52,6 @@ public class SkeletonRenderer implements Disposable {
|
|||||||
|
|
||||||
private boolean premultipliedAlpha;
|
private boolean premultipliedAlpha;
|
||||||
private final FloatArray vertices = new FloatArray(32);
|
private final FloatArray vertices = new FloatArray(32);
|
||||||
|
|
||||||
private ImmediateModeRenderer renderer;
|
private ImmediateModeRenderer renderer;
|
||||||
private final SkeletonClipping clipper = new SkeletonClipping();
|
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.getClippingAttachment().getEndSlot() == i) clipper.clipEnd();
|
||||||
}
|
}
|
||||||
|
if (clipper.isClipping()) clipper.clipEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("null")
|
@SuppressWarnings("null")
|
||||||
@ -223,6 +223,7 @@ public class SkeletonRenderer implements Disposable {
|
|||||||
|
|
||||||
if (clipper.isClipping() && clipper.getClippingAttachment().getEndSlot() == i) clipper.clipEnd();
|
if (clipper.isClipping() && clipper.getClippingAttachment().getEndSlot() == i) clipper.clipEnd();
|
||||||
}
|
}
|
||||||
|
if (clipper.isClipping()) clipper.clipEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("null")
|
@SuppressWarnings("null")
|
||||||
@ -331,6 +332,7 @@ public class SkeletonRenderer implements Disposable {
|
|||||||
|
|
||||||
if (clipper.isClipping() && clipper.getClippingAttachment().getEndSlot() == i) clipper.clipEnd();
|
if (clipper.isClipping() && clipper.getClippingAttachment().getEndSlot() == i) clipper.clipEnd();
|
||||||
}
|
}
|
||||||
|
if (clipper.isClipping()) clipper.clipEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPremultipliedAlpha (boolean premultipliedAlpha) {
|
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. */
|
/** An attachment with vertices that make up a polygon used for clipping the rendering of other attachments. */
|
||||||
public class ClippingAttachment extends VertexAttachment {
|
public class ClippingAttachment extends VertexAttachment {
|
||||||
int endSlot;
|
int endSlot = -1;
|
||||||
|
|
||||||
// Nonessential.
|
// Nonessential.
|
||||||
final Color color = new Color(0.2275f, 0.2275f, 0.8078f, 1); // ce3a3aff
|
final Color color = new Color(0.2275f, 0.2275f, 0.8078f, 1); // ce3a3aff
|
||||||
@ -43,7 +43,8 @@ public class ClippingAttachment extends VertexAttachment {
|
|||||||
super(name);
|
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 () {
|
public int getEndSlot () {
|
||||||
return endSlot;
|
return endSlot;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user