Hello there!
I've inherited a project so I'm new to Spine / libGDX.
spine-runtimes-2.1.25 ( the editor is the same version )
In PolygonSpriteBatch line 348:
public void draw (Texture texture, float[] polygonVertices, int verticesOffset, int verticesCount, short[] polygonTriangles,
int trianglesOffset, int trianglesCount) {
if (!drawing) throw new IllegalStateException("PolygonSpriteBatch.begin must be called before draw.");
final short[] triangles = this.triangles; // Size = 600
final float[] vertices = this.vertices;
if (texture != lastTexture)
switchTexture(texture);
else if (triangleIndex + trianglesCount > triangles.length || vertexIndex + verticesCount > vertices.length) //
flush();
int triangleIndex = this.triangleIndex;
final int vertexIndex = this.vertexIndex;
final int startVertex = vertexIndex / VERTEX_SIZE;
for (int i = trianglesOffset, n = i + trianglesCount; i < n; i++)
triangles[triangleIndex++] = (short)(polygonTriangles[i] + startVertex); // This is line 348
this.triangleIndex = triangleIndex;
System.arraycopy(polygonVertices, verticesOffset, vertices, vertexIndex, verticesCount);
this.vertexIndex += verticesCount;
}
The size of the passed in array, polygonTriangles is 897. However, the size of this.triangles is only 600. Any idea what could be causing this?
Up to this point, the only change I made was to this:
CustomShaderTextureSpriteBatch extends PolygonSpriteBatch ( previously extends SpriteBatch ). As I recall, this was needed because "PolygonSpriteBatch is required to render meshes."
Thanks for reading!