[cocos2dx] Closes #610, closes #627

This commit is contained in:
badlogic 2016-07-18 16:03:15 +02:00
parent 6e09fb8512
commit 8ec8212c5d
2 changed files with 2 additions and 1 deletions

View File

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

View File

@ -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<int>(data.getSize());
char* bytes = MALLOC(char, *length);
memcpy(bytes, data.getBytes(), *length);
return bytes;