mirror of https://github.com/axmolengine/axmol.git
Absolute path check for blackberry.
This commit is contained in:
parent
c7ef5a7683
commit
d5237d637d
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue