Hello there.
I saw that method fullPathFromRelativePath was removed.
It would be nice to have a back compatibility from current stable version ;/.
Hello there.
I saw that method fullPathFromRelativePath was removed.
It would be nice to have a back compatibility from current stable version ;/.
Where did you find that it was removed? It was just marked as deprecated in 2.1.1.
Please look at https://github.com/cocos2d/cocos2d-x/blob/cocos2d-2.1beta3-x-2.1.1/cocos2dx/platform/CCFileUtils.h#L103 .
After we refactored CCFileUtils, we did remove it in the latest codes on github. PLZ use fullPathForFilename instead. Thanks.
Oh sorry i didn’t see that was deprecated.
James Chen wrote:
Where did you find that it was removed? It was just marked as deprecated in 2.1.1.
Please look at https://github.com/cocos2d/cocos2d-x/blob/cocos2d-2.1beta3-x-2.1.1/cocos2dx/platform/CCFileUtils.h#L103 .
After we refactored CCFileUtils, we did remove it in the latest codes on github. PLZ use fullPathForFilename instead. Thanks.
But how to use it?
Tried like this:
const char *fileName = cocos2d::CCFileUtils::sharedFileUtils()->fullPathForFilename( "test.txt" );
and get error: No viable conversion from ‘std::string (aka ’basic_string’) to ‘const char *’
Try this:
std::string fullPath = CCFileUtils::sharedFileUtils()->fullPathForFilename(filename);
FILE* fp = fopen( fullPath.c_str(), “r” );