mirror of https://github.com/axmolengine/axmol.git
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:
commit
3f3bb7a444
|
@ -382,6 +382,7 @@ std::string CCFileUtils::getNewFilename(const char* pszFileName)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
pszNewFileName = fileNameFound->getCString();
|
pszNewFileName = fileNameFound->getCString();
|
||||||
|
CCLOG("FOUND NEW FILE NAME: %s.", pszNewFileName);
|
||||||
}
|
}
|
||||||
return 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);
|
CCLOG("cocos2d: ERROR: Invalid filenameLookup dictionary version: %ld. Filename: %s", (long)version, filename);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
CCLOG("Found file lookup plist.");
|
||||||
setFilenameLookupDictionary((CCDictionary*)pDict->objectForKey("filenames"));
|
setFilenameLookupDictionary((CCDictionary*)pDict->objectForKey("filenames"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -117,8 +117,8 @@ std::string CCFileUtils::fullPathForFilename(const char* pszFileName)
|
||||||
{
|
{
|
||||||
CCString* pResourceDirectory = (CCString*)pResourceDirObj;
|
CCString* pResourceDirectory = (CCString*)pResourceDirObj;
|
||||||
|
|
||||||
CCLOG("\n\nSEARCHING: %s, %s, %s", pszFileName, pResourceDirectory->getCString(), pSearchPath->getCString());
|
CCLOG("\n\nSEARCHING: %s, %s, %s", newFilename.c_str(), pResourceDirectory->getCString(), pSearchPath->getCString());
|
||||||
fullpath = this->getPathForFilename(pszFileName, pResourceDirectory->getCString(), pSearchPath->getCString());
|
fullpath = this->getPathForFilename(newFilename, pResourceDirectory->getCString(), pSearchPath->getCString());
|
||||||
|
|
||||||
// Check whether file exists in apk.
|
// Check whether file exists in apk.
|
||||||
if (s_pZipFile->fileExists(fullpath))
|
if (s_pZipFile->fileExists(fullpath))
|
||||||
|
@ -136,14 +136,14 @@ std::string CCFileUtils::fullPathForFilename(const char* pszFileName)
|
||||||
}
|
}
|
||||||
if (bFound)
|
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());
|
CCLOG("Returning path: %s", fullpath.c_str());
|
||||||
return fullpath;
|
return fullpath;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return pszFileName;
|
return newFilename;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* CCFileUtils::fullPathFromRelativeFile(const char *pszFilename, const char *pszRelativeFile)
|
const char* CCFileUtils::fullPathFromRelativeFile(const char *pszFilename, const char *pszRelativeFile)
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit d6d3008895018fa22b4ea73974bcd9e499b8b1fb
|
Subproject commit 781803f41e2b68a25cd7ad993c9cd70da8b9c05e
|
Loading…
Reference in New Issue