Merge pull request #478 from aismann/dev

64bit debug error fix: CCASSERT(_skeletonData, (json->getError().isEmpty() ? json->getError().buffer() : "Error reading skeleton data file."));
This commit is contained in:
halx99 2021-08-27 15:11:30 +08:00 committed by GitHub
commit 0a334fb406
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -188,7 +188,7 @@ void SkeletonRenderer::initWithJsonFile (const std::string& skeletonDataFile, At
SkeletonJson json(_attachmentLoader);
json.setScale(scale);
SkeletonData* skeletonData = json.readSkeletonDataFile(skeletonDataFile.c_str());
CCASSERT(skeletonData, !json.getError().isEmpty() ? json.getError().buffer() : "Error reading skeleton data.");
CCASSERT(skeletonData, (!json.getError().isEmpty() ? json.getError().buffer() : "Error reading skeleton data."));
_ownsSkeleton = true;
setSkeletonData(skeletonData, true);
@ -205,7 +205,7 @@ void SkeletonRenderer::initWithJsonFile (const std::string& skeletonDataFile, co
SkeletonJson json(_attachmentLoader);
json.setScale(scale);
SkeletonData* skeletonData = json.readSkeletonDataFile(skeletonDataFile.c_str());
CCASSERT(skeletonData, !json.getError().isEmpty() ? json.getError().buffer() : "Error reading skeleton data.");
CCASSERT(skeletonData, (!json.getError().isEmpty() ? json.getError().buffer() : "Error reading skeleton data."));
_ownsSkeleton = true;
_ownsAtlas = true;
@ -221,7 +221,7 @@ void SkeletonRenderer::initWithBinaryFile (const std::string& skeletonDataFile,
SkeletonBinary binary(_attachmentLoader);
binary.setScale(scale);
SkeletonData* skeletonData = binary.readSkeletonDataFile(skeletonDataFile.c_str());
CCASSERT(skeletonData, !binary.getError().isEmpty() ? binary.getError().buffer() : "Error reading skeleton data.");
CCASSERT(skeletonData, (!binary.getError().isEmpty() ? binary.getError().buffer() : "Error reading skeleton data."));
_ownsSkeleton = true;
setSkeletonData(skeletonData, true);
@ -237,7 +237,7 @@ void SkeletonRenderer::initWithBinaryFile (const std::string& skeletonDataFile,
SkeletonBinary binary(_attachmentLoader);
binary.setScale(scale);
SkeletonData* skeletonData = binary.readSkeletonDataFile(skeletonDataFile.c_str());
CCASSERT(skeletonData, !binary.getError().isEmpty() ? binary.getError().buffer() : "Error reading skeleton data.");
CCASSERT(skeletonData, (!binary.getError().isEmpty() ? binary.getError().buffer() : "Error reading skeleton data."));
_ownsSkeleton = true;
_ownsAtlas = true;
setSkeletonData(skeletonData, true);

View File

@ -150,7 +150,7 @@ bool BatchingExample::init () {
SkeletonJson* json = new (__FILE__, __LINE__) SkeletonJson(_attachmentLoader);
json->setScale(0.6f); // Resizes skeleton data to 60% of the size it was in Spine.
_skeletonData = json->readSkeletonDataFile("spineboy-pro.json");
CCASSERT(_skeletonData, json->getError().isEmpty() ? json->getError().buffer() : "Error reading skeleton data file.");
CCASSERT(_skeletonData, (json->getError().isEmpty() ? json->getError().buffer() : "Error reading skeleton data file."));
delete json;
// Setup mix times.