Update spine-3.8 runtime to latest

Maybe no further update until upgrade to spine-4.x
This commit is contained in:
halx99 2021-08-07 00:59:58 +08:00
parent 50c270e8f5
commit 5254edc733
6 changed files with 8 additions and 18 deletions

View File

@ -56,15 +56,10 @@ SpineSkeletonDataCache::SkeletonData* SpineSkeletonDataCache::addData(const char
** Cache, we just need SkeletonData & atlas.
*/
if (fileExtension == ".skel") {
/*auto binary = new (__FILE__, __LINE__) spine::SkeletonBinary(loader);
if (nullptr == binary) {
delete (atlas);
break;
}*/
spine::SkeletonBinary binary(loader);
binary.setScale(scale);
skeletonData = binary.readSkeletonDataFile(dataFile); // spSkeletonBinary_readSkeletonDataFile(binary, dataFile);
skeletonData = binary.readSkeletonDataFile(dataFile);
if ((!binary.getError().isEmpty())) {
++failed;
_reportError("#parse spine .skel data file failed, error:%s", binary.getError().buffer());
@ -80,11 +75,6 @@ SpineSkeletonDataCache::SkeletonData* SpineSkeletonDataCache::addData(const char
_reportError("#parse spine .json data file failed, error:%s", json.getError().buffer());
}
}
/*if ((loader->error1 != nullptr)) {
++failed;
_reportError("#parse spine attachment failed, error:%s%s", loader->error1, loader->error2);
}*/
if (failed > 0) {
if (skeletonData != nullptr)

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

@ -120,7 +120,7 @@ Json::Json(const char *value) :
}
Json::~Json() {
spine::Json* curr = nullptr;
spine::Json* curr = NULL;
spine::Json* next = _child;
do {
curr = next;

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);
}