mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-06 07:14:55 +08:00
[cocos2d-x] Closes #472, fail gracefully if file is not found
This commit is contained in:
parent
f4f4c3ee91
commit
1c192cc3fb
@ -77,6 +77,7 @@ void _spAtlasPage_disposeTexture (spAtlasPage* self) {
|
||||
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();
|
||||
char* bytes = MALLOC(char, *length);
|
||||
memcpy(bytes, data.getBytes(), *length);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user