Fix renderer crash

This commit is contained in:
Denis Andrasec 2024-07-11 14:02:20 +02:00
parent 241d563489
commit 63fc9555d7

View File

@ -203,6 +203,11 @@ public class SkeletonRenderer {
}
clipper.clipEnd();
if (commandList.size == 1 && commandList.get(0).vertices.size == 0) {
commandPool.freeAll(commandList);
commandList.clear();
}
return commandList;
}
@ -210,11 +215,6 @@ public class SkeletonRenderer {
for (int i = 0; i < commands.size; i++) {
RenderCommand command = commands.get(i);
// TODO: Happens when deselecting last skin in DressUp sample
if (command.texture == null) {
break;
}
canvas.drawVertices(Canvas.VertexMode.TRIANGLES, command.vertices.size, command.vertices.items, 0, command.uvs.items, 0,
command.colors.items, 0, command.indices.items, 0, command.indices.size, command.texture.getPaint(command.blendMode));
}