|
@@ -51,6 +51,7 @@ void spSlot_dispose (spSlot* self) {
|
|
}
|
|
}
|
|
|
|
|
|
void spSlot_setAttachment (spSlot* self, spAttachment* attachment) {
|
|
void spSlot_setAttachment (spSlot* self, spAttachment* attachment) {
|
|
|
|
+ if (attachment == self->attachment) return;
|
|
CONST_CAST(spAttachment*, self->attachment) = attachment;
|
|
CONST_CAST(spAttachment*, self->attachment) = attachment;
|
|
SUB_CAST(_spSlot, self)->attachmentTime = self->bone->skeleton->time;
|
|
SUB_CAST(_spSlot, self)->attachmentTime = self->bone->skeleton->time;
|
|
self->attachmentVerticesCount = 0;
|
|
self->attachmentVerticesCount = 0;
|
|
@@ -72,7 +73,9 @@ void spSlot_setToSetupPose (spSlot* self) {
|
|
self->b = self->data->b;
|
|
self->b = self->data->b;
|
|
self->a = self->data->a;
|
|
self->a = self->data->a;
|
|
|
|
|
|
- if (self->data->attachmentName) {
|
|
|
|
|
|
+ if (!self->data->attachmentName)
|
|
|
|
+ spSlot_setAttachment(self, 0);
|
|
|
|
+ else {
|
|
/* Find slot index. */
|
|
/* Find slot index. */
|
|
int i;
|
|
int i;
|
|
for (i = 0; i < self->bone->skeleton->data->slotsCount; ++i) {
|
|
for (i = 0; i < self->bone->skeleton->data->slotsCount; ++i) {
|
|
@@ -81,6 +84,7 @@ void spSlot_setToSetupPose (spSlot* self) {
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ CONST_CAST(spAttachment*, self->attachment) = 0;
|
|
|
|
+ spSlot_setAttachment(self, attachment);
|
|
}
|
|
}
|
|
- spSlot_setAttachment(self, attachment);
|
|
|
|
}
|
|
}
|