mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-21 01:36:02 +08:00
Merge branch '3.8' into 3.9-beta
This commit is contained in:
commit
c90ca1b08c
@ -766,10 +766,14 @@ namespace spine {
|
|||||||
return _skeleton->getAttachment(slotName.c_str(), attachmentName.c_str());
|
return _skeleton->getAttachment(slotName.c_str(), attachmentName.c_str());
|
||||||
}
|
}
|
||||||
bool SkeletonRenderer::setAttachment (const std::string& slotName, const std::string& attachmentName) {
|
bool SkeletonRenderer::setAttachment (const std::string& slotName, const std::string& attachmentName) {
|
||||||
return _skeleton->getAttachment(slotName.c_str(), attachmentName.empty() ? 0 : attachmentName.c_str()) ? true : false;
|
bool result = _skeleton->getAttachment(slotName.c_str(), attachmentName.empty() ? 0 : attachmentName.c_str()) ? true : false;
|
||||||
|
_skeleton->setAttachment(slotName.c_str(), attachmentName.empty() ? 0 : attachmentName.c_str());
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
bool SkeletonRenderer::setAttachment (const std::string& slotName, const char* attachmentName) {
|
bool SkeletonRenderer::setAttachment (const std::string& slotName, const char* attachmentName) {
|
||||||
return _skeleton->getAttachment(slotName.c_str(), attachmentName) ? true : false;
|
bool result = _skeleton->getAttachment(slotName.c_str(), attachmentName) ? true : false;
|
||||||
|
_skeleton->setAttachment(slotName.c_str(), attachmentName);
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SkeletonRenderer::setTwoColorTint(bool enabled) {
|
void SkeletonRenderer::setTwoColorTint(bool enabled) {
|
||||||
|
|||||||
@ -303,10 +303,7 @@ int Skeleton::findSlotIndex(const String &slotName) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Skeleton::setSkin(const String &skinName) {
|
void Skeleton::setSkin(const String &skinName) {
|
||||||
Skin *foundSkin = _data->findSkin(skinName);
|
Skin *foundSkin = skinName.isEmpty() ? NULL : _data->findSkin(skinName);
|
||||||
|
|
||||||
assert(foundSkin != NULL);
|
|
||||||
|
|
||||||
setSkin(foundSkin);
|
setSkin(foundSkin);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -340,7 +337,7 @@ Attachment *Skeleton::getAttachment(const String &slotName, const String &attach
|
|||||||
}
|
}
|
||||||
|
|
||||||
Attachment *Skeleton::getAttachment(int slotIndex, const String &attachmentName) {
|
Attachment *Skeleton::getAttachment(int slotIndex, const String &attachmentName) {
|
||||||
assert(attachmentName.length() > 0);
|
if (attachmentName.isEmpty()) return NULL;
|
||||||
|
|
||||||
if (_skin != NULL) {
|
if (_skin != NULL) {
|
||||||
Attachment *attachment = _skin->getAttachment(slotIndex, attachmentName);
|
Attachment *attachment = _skin->getAttachment(slotIndex, attachmentName);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user