Nate Here is permalink to code, but not sure how it will help, without long and deep digging in the rest of project.
This is already modified code. And looks like it should be just worldVerticesLength
, because verteces are also 2 floats - x+y, as well as UV itself.
Also I found couple lines in c code, which pushed to this assumpton. Lines from MeshAttachment.c
uvs = self->uvs = MALLOC(float, verticesLength);
memcpy(copy->uvs, self->uvs, SUPER(self)->worldVerticesLength * sizeof(float));
I need to create buffer on UV, because it is simpler to work with typed buffer, and because I need to copy a lot of data for rendering. I'm collecting data for whole skeleton to single render command.(aka combining all bones in 1 draw call)
Also address sanitizer in xcode confirmed that SpineC allocated sizeof(Float) * worldVerticesLength
, and not 2 * sizeof(Float) * worldVerticesLength
. Not sure why I dind't use it in the first place... it even says where memory was allocated and how many bytes were allocated... π