Allow SkeletonBinary and SkeletonJson to own externally created AttachmentLoader (#1846)

This commit is contained in:
RH 2021-04-29 22:07:16 +10:00 committed by GitHub
parent 25d7f8266f
commit 63ef1938b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 6 deletions

View File

@ -68,7 +68,7 @@ namespace spine {
explicit SkeletonBinary(Atlas* atlasArray);
explicit SkeletonBinary(AttachmentLoader* attachmentLoader);
explicit SkeletonBinary(AttachmentLoader* attachmentLoader, bool ownsLoader = false);
~SkeletonBinary();

View File

@ -57,7 +57,7 @@ class SP_API SkeletonJson : public SpineObject {
public:
explicit SkeletonJson(Atlas *atlas);
explicit SkeletonJson(AttachmentLoader *attachmentLoader);
explicit SkeletonJson(AttachmentLoader *attachmentLoader, bool ownsLoader = false);
~SkeletonJson();

View File

@ -98,8 +98,8 @@ SkeletonBinary::SkeletonBinary(Atlas *atlasArray) : _attachmentLoader(
}
SkeletonBinary::SkeletonBinary(AttachmentLoader *attachmentLoader) : _attachmentLoader(attachmentLoader), _error(),
_scale(1), _ownsLoader(false)
SkeletonBinary::SkeletonBinary(AttachmentLoader* attachmentLoader, bool ownsLoader) : _attachmentLoader(attachmentLoader), _error(),
_scale(1), _ownsLoader(ownsLoader)
{
assert(_attachmentLoader != NULL);
}

View File

@ -84,8 +84,8 @@ SkeletonJson::SkeletonJson(Atlas *atlas) : _attachmentLoader(new(__FILE__, __LIN
_scale(1), _ownsLoader(true)
{}
SkeletonJson::SkeletonJson(AttachmentLoader *attachmentLoader) : _attachmentLoader(attachmentLoader), _scale(1),
_ownsLoader(false)
SkeletonJson::SkeletonJson(AttachmentLoader *attachmentLoader, bool ownsLoader) : _attachmentLoader(attachmentLoader), _scale(1),
_ownsLoader(ownsLoader)
{
assert(_attachmentLoader != NULL);
}