Clean up.

This commit is contained in:
Nathan Sweet 2017-04-01 22:53:26 +09:00
parent 1254b06a91
commit c5cf1155a0
3 changed files with 8 additions and 7 deletions

View File

@ -53,8 +53,8 @@ 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 final SkeletonClipping clipper = new SkeletonClipping(); private final SkeletonClipping clipper = new SkeletonClipping();
private ImmediateModeRenderer renderer;
public void draw (Batch batch, Skeleton skeleton) { public void draw (Batch batch, Skeleton skeleton) {
boolean premultipliedAlpha = this.premultipliedAlpha; boolean premultipliedAlpha = this.premultipliedAlpha;
@ -136,7 +136,7 @@ public class SkeletonRenderer implements Disposable {
float r = skeletonColor.r, g = skeletonColor.g, b = skeletonColor.b, a = skeletonColor.a; float r = skeletonColor.r, g = skeletonColor.g, b = skeletonColor.b, a = skeletonColor.a;
Array<Slot> drawOrder = skeleton.drawOrder; Array<Slot> drawOrder = skeleton.drawOrder;
for (int i = 0, n = drawOrder.size; i < n; i++) { for (int i = 0, n = drawOrder.size; i < n; i++) {
final int vertexSize = clipper.isClipping() ? 2 : 5; int vertexSize = clipper.isClipping() ? 2 : 5;
Slot slot = drawOrder.get(i); Slot slot = drawOrder.get(i);
Attachment attachment = slot.attachment; Attachment attachment = slot.attachment;
if (attachment instanceof RegionAttachment) { if (attachment instanceof RegionAttachment) {
@ -238,8 +238,8 @@ public class SkeletonRenderer implements Disposable {
float r = skeletonColor.r, g = skeletonColor.g, b = skeletonColor.b, a = skeletonColor.a; float r = skeletonColor.r, g = skeletonColor.g, b = skeletonColor.b, a = skeletonColor.a;
Array<Slot> drawOrder = skeleton.drawOrder; Array<Slot> drawOrder = skeleton.drawOrder;
for (int i = 0, n = drawOrder.size; i < n; i++) { for (int i = 0, n = drawOrder.size; i < n; i++) {
final int vertexSize = clipper.isClipping() ? 2 : 6;
Slot slot = drawOrder.get(i); Slot slot = drawOrder.get(i);
int vertexSize = clipper.isClipping() ? 2 : 6;
Attachment attachment = slot.attachment; Attachment attachment = slot.attachment;
if (attachment instanceof RegionAttachment) { if (attachment instanceof RegionAttachment) {
RegionAttachment region = (RegionAttachment)attachment; RegionAttachment region = (RegionAttachment)attachment;

View File

@ -53,7 +53,8 @@ public class VertexAttachment extends Attachment {
* Runtimes Guide. * Runtimes Guide.
* @param start The index of the first {@link #getVertices()} value to transform. Each vertex has 2 values, x and y. * @param start The index of the first {@link #getVertices()} value to transform. Each vertex has 2 values, x and y.
* @param count The number of world vertex values to output. Must be <= {@link #getWorldVerticesLength()} - <code>start</code>. * @param count The number of world vertex values to output. Must be <= {@link #getWorldVerticesLength()} - <code>start</code>.
* @param worldVertices The output world vertices. Must have a length >= <code>offset</code> + <code>count</code>. * @param worldVertices The output world vertices. Must have a length >= <code>offset</code> + <code>count</code> *
* <code>stride</code> / 2.
* @param offset The <code>worldVertices</code> index to begin writing values. * @param offset The <code>worldVertices</code> index to begin writing values.
* @param stride The number of <code>worldVertices</code> entries between the value pairs written. */ * @param stride The number of <code>worldVertices</code> entries between the value pairs written. */
public void computeWorldVertices (Slot slot, int start, int count, float[] worldVertices, int offset, int stride) { public void computeWorldVertices (Slot slot, int start, int count, float[] worldVertices, int offset, int stride) {
@ -142,8 +143,8 @@ public class VertexAttachment extends Attachment {
this.vertices = vertices; this.vertices = vertices;
} }
/** The maximum length required of the <code>worldVertices</code> passed to /** The maximum number of world vertex values that can be output by
* {@link #computeWorldVertices(Slot, int, int, float[], int, int)}. */ * {@link #computeWorldVertices(Slot, int, int, float[], int, int)} using the <code>count</code> parameter. */
public int getWorldVerticesLength () { public int getWorldVerticesLength () {
return worldVerticesLength; return worldVerticesLength;
} }

View File

@ -75,7 +75,7 @@ public class SkeletonClipping {
return clipAttachment != null; return clipAttachment != null;
} }
public void clipTriangles (float[] vertices, int verticesLength, short[] triangles, int trianglesLength, float uvs[], public void clipTriangles (float[] vertices, int verticesLength, short[] triangles, int trianglesLength, float[] uvs,
float light, float dark, boolean twoColor) { float light, float dark, boolean twoColor) {
Clipper clipper = this.clipper; Clipper clipper = this.clipper;