mirror of https://github.com/axmolengine/axmol.git
fixed a bug in CCFileUtils.cpp of blackberry port.
This commit is contained in:
parent
5e5b71a396
commit
e011be88d8
|
@ -62,6 +62,7 @@ static std::string fullPathFromRelativePathThreadSafe(const char* pszRelativePat
|
||||||
CCAssert(pszRootPath != NULL, "The resource root path must be set in the main.cpp");
|
CCAssert(pszRootPath != NULL, "The resource root path must be set in the main.cpp");
|
||||||
|
|
||||||
std::string pstrRelativePath = pszRelativePath;
|
std::string pstrRelativePath = pszRelativePath;
|
||||||
|
// if the relative path contains root path, skip it.
|
||||||
if (pstrRelativePath.find(pszRootPath) == std::string::npos)
|
if (pstrRelativePath.find(pszRootPath) == std::string::npos)
|
||||||
{
|
{
|
||||||
ret += pszRootPath;
|
ret += pszRootPath;
|
||||||
|
@ -70,9 +71,15 @@ static std::string fullPathFromRelativePathThreadSafe(const char* pszRelativePat
|
||||||
const char* resDir = CCFileUtils::sharedFileUtils()->getResourceDirectory();
|
const char* resDir = CCFileUtils::sharedFileUtils()->getResourceDirectory();
|
||||||
|
|
||||||
if (resDir != NULL)
|
if (resDir != NULL)
|
||||||
|
{
|
||||||
|
std::string pstrRootPath = pszRootPath;
|
||||||
|
std::string pstrResourceFullPath = pstrRootPath + resDir;
|
||||||
|
// if the relative path contains root path and resource directory, skip it.
|
||||||
|
if (pstrRelativePath.find(pstrResourceFullPath.c_str()) == std::string::npos)
|
||||||
{
|
{
|
||||||
ret += resDir;
|
ret += resDir;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (pszRelativePath != NULL)
|
if (pszRelativePath != NULL)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue