mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-20 17:26:01 +08:00
Docs, accept empty string for std::string refs that can be null in the C API.
This commit is contained in:
parent
91e7d4e973
commit
fae952d73c
@ -117,7 +117,8 @@ int spSkeleton_setSkinByName (spSkeleton* self, const char* skinName);
|
|||||||
spAttachment* spSkeleton_getAttachmentForSlotName (const spSkeleton* self, const char* slotName, const char* attachmentName);
|
spAttachment* spSkeleton_getAttachmentForSlotName (const spSkeleton* self, const char* slotName, const char* attachmentName);
|
||||||
/* Returns 0 if the slot or attachment was not found. */
|
/* Returns 0 if the slot or attachment was not found. */
|
||||||
spAttachment* spSkeleton_getAttachmentForSlotIndex (const spSkeleton* self, int slotIndex, const char* attachmentName);
|
spAttachment* spSkeleton_getAttachmentForSlotIndex (const spSkeleton* self, int slotIndex, const char* attachmentName);
|
||||||
/* Returns 0 if the slot or attachment was not found. */
|
/* Returns 0 if the slot or attachment was not found.
|
||||||
|
* @param attachmentName May be 0. */
|
||||||
int spSkeleton_setAttachment (spSkeleton* self, const char* slotName, const char* attachmentName);
|
int spSkeleton_setAttachment (spSkeleton* self, const char* slotName, const char* attachmentName);
|
||||||
|
|
||||||
/* Returns 0 if the IK constraint was not found. */
|
/* Returns 0 if the IK constraint was not found. */
|
||||||
|
|||||||
@ -346,14 +346,14 @@ spSlot* SkeletonRenderer::findSlot (const std::string& slotName) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool SkeletonRenderer::setSkin (const std::string& skinName) {
|
bool SkeletonRenderer::setSkin (const std::string& skinName) {
|
||||||
return spSkeleton_setSkinByName(_skeleton, skinName.c_str()) ? true : false;
|
return spSkeleton_setSkinByName(_skeleton, skinName.empty() ? 0 : skinName.c_str()) ? true : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
spAttachment* SkeletonRenderer::getAttachment (const std::string& slotName, const std::string& attachmentName) const {
|
spAttachment* SkeletonRenderer::getAttachment (const std::string& slotName, const std::string& attachmentName) const {
|
||||||
return spSkeleton_getAttachmentForSlotName(_skeleton, slotName.c_str(), attachmentName.c_str());
|
return spSkeleton_getAttachmentForSlotName(_skeleton, 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 spSkeleton_setAttachment(_skeleton, slotName.c_str(), attachmentName.c_str()) ? true : false;
|
return spSkeleton_setAttachment(_skeleton, slotName.c_str(), attachmentName.empty() ? 0 : attachmentName.c_str()) ? true : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
spSkeleton* SkeletonRenderer::getSkeleton () {
|
spSkeleton* SkeletonRenderer::getSkeleton () {
|
||||||
|
|||||||
@ -77,12 +77,13 @@ public:
|
|||||||
|
|
||||||
/* Sets the skin used to look up attachments not found in the SkeletonData defaultSkin. Attachments from the new skin are
|
/* Sets the skin used to look up attachments not found in the SkeletonData defaultSkin. Attachments from the new skin are
|
||||||
* attached if the corresponding attachment from the old skin was attached. Returns false if the skin was not found.
|
* attached if the corresponding attachment from the old skin was attached. Returns false if the skin was not found.
|
||||||
* @param skin May be 0.*/
|
* @param skin May be empty string ("") for no skin.*/
|
||||||
bool setSkin (const std::string& skinName);
|
bool setSkin (const std::string& skinName);
|
||||||
|
|
||||||
/* Returns 0 if the slot or attachment was not found. */
|
/* Returns 0 if the slot or attachment was not found. */
|
||||||
spAttachment* getAttachment (const std::string& slotName, const std::string& attachmentName) const;
|
spAttachment* getAttachment (const std::string& slotName, const std::string& attachmentName) const;
|
||||||
/* Returns false if the slot or attachment was not found. */
|
/* Returns false if the slot or attachment was not found.
|
||||||
|
* @param attachmentName May be empty string ("") for no attachment. */
|
||||||
bool setAttachment (const std::string& slotName, const std::string& attachmentName);
|
bool setAttachment (const std::string& slotName, const std::string& attachmentName);
|
||||||
|
|
||||||
// --- BlendProtocol
|
// --- BlendProtocol
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user