Skip to content

Commit

Permalink
[cpp] Added Skin::removeAttachment.
Browse files Browse the repository at this point in the history
  • Loading branch information
badlogic committed Jul 25, 2019
1 parent 3f412f1 commit 3e84da4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions spine-cpp/spine-cpp/include/spine/Skin.h
Expand Up @@ -119,6 +119,9 @@ class SP_API Skin : public SpineObject {
/// If the name already exists for the slot, the previous value is replaced.
void addAttachment(size_t slotIndex, const String &name, Attachment *attachment);

// Removes the attachment from the skin.
void removeAttachment(size_t slotIndex, const String& name);

/// Returns the attachment for the specified slot index and name, or NULL.
Attachment *getAttachment(size_t slotIndex, const String &name);

Expand Down
4 changes: 4 additions & 0 deletions spine-cpp/spine-cpp/src/spine/Skin.cpp
Expand Up @@ -95,6 +95,10 @@ void Skin::addAttachment(size_t slotIndex, const String &name, Attachment *attac
_attachments.put(slotIndex, name, attachment);
}

void Skin::removeAttachment(size_t slotIndex, const String& name) {
_attachments.remove(slotIndex, name);
}

Attachment *Skin::getAttachment(size_t slotIndex, const String &name) {
return _attachments.get(slotIndex, name);
}
Expand Down

0 comments on commit 3e84da4

Please sign in to comment.