[cpp] Added Skin::removeAttachment.

This commit is contained in:
badlogic 2019-07-25 15:23:48 +02:00
parent 08c7c566f3
commit a578557934
2 changed files with 7 additions and 0 deletions

View File

@ -124,6 +124,9 @@ public:
/// Returns the attachment for the specified slot index and name, or NULL.
Attachment *getAttachment(size_t slotIndex, const String &name);
// Removes the attachment from the skin.
void removeAttachment(size_t slotIndex, const String& name);
/// Finds the skin keys for a given slot. The results are added to the passed array of names.
/// @param slotIndex The target slotIndex. To find the slot index, use Skeleton::findSlotIndex or SkeletonData::findSlotIndex
/// @param names Found skin key names will be added to this array.

View File

@ -112,6 +112,10 @@ Attachment *Skin::getAttachment(size_t slotIndex, const String &name) {
return _attachments.get(slotIndex, name);
}
void Skin::removeAttachment(size_t slotIndex, const String& name) {
_attachments.remove(slotIndex, name);
}
void Skin::findNamesForSlot(size_t slotIndex, Vector<String> &names) {
Skin::AttachmentMap::Entries entries = _attachments.getEntries();
while (entries.hasNext()) {