#include <spine/PathAttachment.h>
#include <spine/extension.h>
void _spPathAttachment_dispose (spAttachment* attachment) {
spPathAttachment* self = SUB_CAST(spPathAttachment, attachment);
_spVertexAttachment_deinit(SUPER(self));
FREE(self->lengths);
FREE(self);
}
spAttachment* _spPathAttachment_copy (spAttachment* attachment) {
spPathAttachment* copy = spPathAttachment_create(attachment->name);
spPathAttachment* self = SUB_CAST(spPathAttachment, attachment);
spVertexAttachment_copyTo(SUPER(self), SUPER(copy));
copy->lengthsLength = self->lengthsLength;
copy->lengths = MALLOC(float, self->lengthsLength);
memcpy(copy->lengths, self->lengths, self->lengthsLength * sizeof(float));
copy->closed = self->closed;
copy->constantSpeed = self->constantSpeed;
return SUPER(SUPER(copy));
}
spPathAttachment* spPathAttachment_create (const char* name) {
spPathAttachment* self = NEW(spPathAttachment);
_spVertexAttachment_init(SUPER(self));
_spAttachment_init(SUPER(SUPER(self)), name, SP_ATTACHMENT_PATH, _spPathAttachment_dispose, _spPathAttachment_copy);
return self;
}