mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
[cocos2d-x] Reverted takeBuffer PR so we are compatible with both 3.12 and < 3.12 cocos2d-x.
This commit is contained in:
parent
0983d42c3d
commit
e3e122b3fc
@ -80,5 +80,8 @@ char* _spUtil_readFile (const char* path, int* length) {
|
|||||||
Data data = FileUtils::getInstance()->getDataFromFile(
|
Data data = FileUtils::getInstance()->getDataFromFile(
|
||||||
FileUtils::getInstance()->fullPathForFilename(path));
|
FileUtils::getInstance()->fullPathForFilename(path));
|
||||||
if (data.isNull()) return 0;
|
if (data.isNull()) return 0;
|
||||||
return (char*)(data.takeBuffer((ssize_t*)length));
|
*length = static_cast<int>(data.getSize());
|
||||||
|
char* bytes = MALLOC(char, *length);
|
||||||
|
memcpy(bytes, data.getBytes(), *length);
|
||||||
|
return bytes;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user