Merge pull request #1900 from dumganhar/master

issue #1683: Fixed a bug in file lookup for Android and updated JS Tests.
This commit is contained in:
James Chen 2013-01-25 20:13:46 -08:00
commit 3f3bb7a444
3 changed files with 7 additions and 6 deletions

View File

@ -382,6 +382,7 @@ std::string CCFileUtils::getNewFilename(const char* pszFileName)
}
else {
pszNewFileName = fileNameFound->getCString();
CCLOG("FOUND NEW FILE NAME: %s.", pszNewFileName);
}
return pszNewFileName;
}
@ -437,7 +438,7 @@ void CCFileUtils::loadFilenameLookupDictionaryFromFile(const char* filename)
CCLOG("cocos2d: ERROR: Invalid filenameLookup dictionary version: %ld. Filename: %s", (long)version, filename);
return;
}
CCLOG("Found file lookup plist.");
setFilenameLookupDictionary((CCDictionary*)pDict->objectForKey("filenames"));
}
}

View File

@ -117,8 +117,8 @@ std::string CCFileUtils::fullPathForFilename(const char* pszFileName)
{
CCString* pResourceDirectory = (CCString*)pResourceDirObj;
CCLOG("\n\nSEARCHING: %s, %s, %s", pszFileName, pResourceDirectory->getCString(), pSearchPath->getCString());
fullpath = this->getPathForFilename(pszFileName, pResourceDirectory->getCString(), pSearchPath->getCString());
CCLOG("\n\nSEARCHING: %s, %s, %s", newFilename.c_str(), pResourceDirectory->getCString(), pSearchPath->getCString());
fullpath = this->getPathForFilename(newFilename, pResourceDirectory->getCString(), pSearchPath->getCString());
// Check whether file exists in apk.
if (s_pZipFile->fileExists(fullpath))
@ -136,14 +136,14 @@ std::string CCFileUtils::fullPathForFilename(const char* pszFileName)
}
if (bFound)
{
s_fullPathCache.insert(std::pair<std::string, std::string>(pszFileName, fullpath));
s_fullPathCache.insert(std::pair<std::string, std::string>(newFilename, fullpath));
CCLOG("Returning path: %s", fullpath.c_str());
return fullpath;
}
}
}
return pszFileName;
return newFilename;
}
const char* CCFileUtils::fullPathFromRelativeFile(const char *pszFilename, const char *pszRelativeFile)

@ -1 +1 @@
Subproject commit d6d3008895018fa22b4ea73974bcd9e499b8b1fb
Subproject commit 781803f41e2b68a25cd7ad993c9cd70da8b9c05e