Hi guys, is there any way to check if a file exists before loading? I’ve seen you can call CCFileUtils::getFileData and it will return NULL if the file doesn’t exist, but this will also load the full file if it does exist.
This is fine for methods like CCSprite::spriteWithFile that need to load the data if the file exists. However I simply want to check if a file exists and return a filename if it does or an alternate filename if it doesn’t. Kind of how iOS’s @2x file naming for assets works.
If there is a way to do this please advise. I know how to do it for iOS and Android, but my game has to support other platforms as well which is why I chose cocos2d-x
Otherwise if I could humbly make a suggestion for a future release…