From 8ec8212c5d3f5e763a1e16411cdc931230953901 Mon Sep 17 00:00:00 2001 From: badlogic Date: Mon, 18 Jul 2016 16:03:15 +0200 Subject: [PATCH] [cocos2dx] Closes #610, closes #627 --- spine-cocos2dx/src/spine/SkeletonRenderer.cpp | 1 + spine-cocos2dx/src/spine/spine-cocos2dx.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/spine-cocos2dx/src/spine/SkeletonRenderer.cpp b/spine-cocos2dx/src/spine/SkeletonRenderer.cpp index d56a3b8de..2461f40c8 100644 --- a/spine-cocos2dx/src/spine/SkeletonRenderer.cpp +++ b/spine-cocos2dx/src/spine/SkeletonRenderer.cpp @@ -108,6 +108,7 @@ void SkeletonRenderer::initWithData (spSkeletonData* skeletonData, bool ownsSkel } void SkeletonRenderer::initWithFile (const std::string& skeletonDataFile, spAtlas* atlas, float scale) { + _atlas = atlas; _attachmentLoader = SUPER(Cocos2dAttachmentLoader_create(_atlas)); spSkeletonJson* json = spSkeletonJson_createWithLoader(_attachmentLoader); diff --git a/spine-cocos2dx/src/spine/spine-cocos2dx.cpp b/spine-cocos2dx/src/spine/spine-cocos2dx.cpp index e36a42fe8..9ca9d5ea3 100644 --- a/spine-cocos2dx/src/spine/spine-cocos2dx.cpp +++ b/spine-cocos2dx/src/spine/spine-cocos2dx.cpp @@ -78,7 +78,7 @@ char* _spUtil_readFile (const char* path, int* length) { Data data = FileUtils::getInstance()->getDataFromFile( FileUtils::getInstance()->fullPathForFilename(path).c_str()); if (data.isNull()) return 0; - *length = data.getSize(); + *length = static_cast(data.getSize()); char* bytes = MALLOC(char, *length); memcpy(bytes, data.getBytes(), *length); return bytes;