mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
parent
6e09fb8512
commit
8ec8212c5d
@ -108,6 +108,7 @@ void SkeletonRenderer::initWithData (spSkeletonData* skeletonData, bool ownsSkel
|
|||||||
}
|
}
|
||||||
|
|
||||||
void SkeletonRenderer::initWithFile (const std::string& skeletonDataFile, spAtlas* atlas, float scale) {
|
void SkeletonRenderer::initWithFile (const std::string& skeletonDataFile, spAtlas* atlas, float scale) {
|
||||||
|
_atlas = atlas;
|
||||||
_attachmentLoader = SUPER(Cocos2dAttachmentLoader_create(_atlas));
|
_attachmentLoader = SUPER(Cocos2dAttachmentLoader_create(_atlas));
|
||||||
|
|
||||||
spSkeletonJson* json = spSkeletonJson_createWithLoader(_attachmentLoader);
|
spSkeletonJson* json = spSkeletonJson_createWithLoader(_attachmentLoader);
|
||||||
|
|||||||
@ -78,7 +78,7 @@ char* _spUtil_readFile (const char* path, int* length) {
|
|||||||
Data data = FileUtils::getInstance()->getDataFromFile(
|
Data data = FileUtils::getInstance()->getDataFromFile(
|
||||||
FileUtils::getInstance()->fullPathForFilename(path).c_str());
|
FileUtils::getInstance()->fullPathForFilename(path).c_str());
|
||||||
if (data.isNull()) return 0;
|
if (data.isNull()) return 0;
|
||||||
*length = data.getSize();
|
*length = static_cast<int>(data.getSize());
|
||||||
char* bytes = MALLOC(char, *length);
|
char* bytes = MALLOC(char, *length);
|
||||||
memcpy(bytes, data.getBytes(), *length);
|
memcpy(bytes, data.getBytes(), *length);
|
||||||
return bytes;
|
return bytes;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user