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 Harald Csaszar
parent 5cb54bdf9c
commit fb3ca1702e
4 changed files with 6 additions and 6 deletions

View File

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

View File

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

View File

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

View File

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