mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
Added Skin_getAttachmentName to enumerate skin attachments for a slot. Thanks James Poag!
This commit is contained in:
parent
53662aac09
commit
27d6766289
@ -46,6 +46,9 @@ void Skin_addAttachment (Skin* self, int slotIndex, const char* name, Attachment
|
|||||||
/* Returns 0 if the attachment was not found. */
|
/* Returns 0 if the attachment was not found. */
|
||||||
Attachment* Skin_getAttachment (const Skin* self, int slotIndex, const char* name);
|
Attachment* Skin_getAttachment (const Skin* self, int slotIndex, const char* name);
|
||||||
|
|
||||||
|
/* Returns 0 if the slot or attachment was not found. */
|
||||||
|
const char* Skin_getAttachmentName (const Skin* self, int slotIndex, int attachmentIndex);
|
||||||
|
|
||||||
/** Attach each attachment in this skin if the corresponding attachment in oldSkin is currently attached. */
|
/** Attach each attachment in this skin if the corresponding attachment in oldSkin is currently attached. */
|
||||||
void Skin_attachAll (const Skin* self, struct Skeleton* skeleton, const Skin* oldSkin);
|
void Skin_attachAll (const Skin* self, struct Skeleton* skeleton, const Skin* oldSkin);
|
||||||
|
|
||||||
|
|||||||
@ -88,6 +88,19 @@ Attachment* Skin_getAttachment (const Skin* self, int slotIndex, const char* nam
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char* Skin_getAttachmentName (const Skin* self, int slotIndex, int attachmentIndex) {
|
||||||
|
const _Entry* entry = SUB_CAST(_Internal, self) ->entries;
|
||||||
|
int i = 0;
|
||||||
|
while (entry) {
|
||||||
|
if (entry->slotIndex == slotIndex) {
|
||||||
|
if (i == attachmentIndex) return entry->name;
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
entry = entry->next;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
void Skin_attachAll (const Skin* self, Skeleton* skeleton, const Skin* oldSkin) {
|
void Skin_attachAll (const Skin* self, Skeleton* skeleton, const Skin* oldSkin) {
|
||||||
const _Entry *entry = SUB_CAST(_Internal, oldSkin) ->entries;
|
const _Entry *entry = SUB_CAST(_Internal, oldSkin) ->entries;
|
||||||
while (entry) {
|
while (entry) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user