Fixed an issue in CCFileUtils::setResourceDirectory for android.

This commit is contained in:
James Chen 2013-01-25 23:01:47 +08:00
parent 2c399de28e
commit f71df5a873
1 changed files with 7 additions and 1 deletions

View File

@ -236,12 +236,18 @@ unsigned char* CCFileUtils::getFileData(const char* pszFileName, const char* psz
void CCFileUtils::setResourceDirectory(const char* pszResourceDirectory)
{
if (pszResourceDirectory == NULL) return;
m_obDirectory = pszResourceDirectory;
if (m_obDirectory.size() > 0 && m_obDirectory[m_obDirectory.size() - 1] != '/')
{
m_obDirectory.append("/");
}
m_obDirectory += "assets/";
if (pszResourceDirectory[0] != '/')
{
m_obDirectory.insert(0, "assets/");
}
m_pSearchPathArray->insertObject(CCString::create(m_obDirectory.c_str()), 0);
}