Absolute path check for blackberry.

This commit is contained in:
James Chen 2013-01-29 00:42:21 +08:00
parent c7ef5a7683
commit d5237d637d
2 changed files with 3 additions and 2 deletions

View File

@ -92,7 +92,7 @@ std::string CCFileUtils::fullPathForFilename(const char* pszFileName)
// 2) Files not in APK, e.g. /data/data/org.cocos2dx.hellocpp/cache/path/path/file.png, or /sdcard/path/path/file.png.
// So these two situations need to be checked on Android.
std::string strFileName = pszFileName;
if (pszFileName[0] == '/' || strFileName.find("assets/") == 0)
if (pszFileName[0] == '/' || strFileName.find(m_strDefaultResRootPath) == 0)
{
CCLOG("Return absolute path( %s ) directly.", pszFileName);
return pszFileName;

View File

@ -104,8 +104,9 @@ std::string CCFileUtils::fullPathForFilename(const char* pszFileName)
CCAssert(pszFileName != NULL, "CCFileUtils: Invalid path");
// Return directly if it's absolute path.
if (pszFileName[0] == '/')
if (pszFileName[0] == '/' || strFileName.find(m_strDefaultResRootPath) == 0)
{
CCLOG("Return absolute path( %s ) directly.", pszFileName);
return pszFileName;
}