mirror of https://github.com/axmolengine/axmol.git
Merge pull request #1927 from dumganhar/master
Comments some logs in CCFileUtils.
This commit is contained in:
commit
67a2ff5199
|
@ -382,7 +382,7 @@ std::string CCFileUtils::getNewFilename(const char* pszFileName)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
pszNewFileName = fileNameFound->getCString();
|
pszNewFileName = fileNameFound->getCString();
|
||||||
CCLOG("FOUND NEW FILE NAME: %s.", pszNewFileName);
|
//CCLOG("FOUND NEW FILE NAME: %s.", pszNewFileName);
|
||||||
}
|
}
|
||||||
return pszNewFileName;
|
return pszNewFileName;
|
||||||
}
|
}
|
||||||
|
@ -442,7 +442,6 @@ 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"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -94,14 +94,14 @@ std::string CCFileUtils::fullPathForFilename(const char* pszFileName)
|
||||||
std::string strFileName = pszFileName;
|
std::string strFileName = pszFileName;
|
||||||
if (pszFileName[0] == '/' || strFileName.find(m_strDefaultResRootPath) == 0)
|
if (pszFileName[0] == '/' || strFileName.find(m_strDefaultResRootPath) == 0)
|
||||||
{
|
{
|
||||||
CCLOG("Return absolute path( %s ) directly.", pszFileName);
|
//CCLOG("Return absolute path( %s ) directly.", pszFileName);
|
||||||
return pszFileName;
|
return pszFileName;
|
||||||
}
|
}
|
||||||
// Already Cached ?
|
// Already Cached ?
|
||||||
std::map<std::string, std::string>::iterator cacheIter = s_fullPathCache.find(pszFileName);
|
std::map<std::string, std::string>::iterator cacheIter = s_fullPathCache.find(pszFileName);
|
||||||
if (cacheIter != s_fullPathCache.end())
|
if (cacheIter != s_fullPathCache.end())
|
||||||
{
|
{
|
||||||
CCLOG("Return full path from cache: %s", cacheIter->second.c_str());
|
//CCLOG("Return full path from cache: %s", cacheIter->second.c_str());
|
||||||
return cacheIter->second;
|
return cacheIter->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -117,7 +117,7 @@ std::string CCFileUtils::fullPathForFilename(const char* pszFileName)
|
||||||
for (std::vector<std::string>::iterator resOrderIter = m_searchResolutionsOrderArray.begin();
|
for (std::vector<std::string>::iterator resOrderIter = m_searchResolutionsOrderArray.begin();
|
||||||
resOrderIter != m_searchResolutionsOrderArray.end(); ++resOrderIter) {
|
resOrderIter != m_searchResolutionsOrderArray.end(); ++resOrderIter) {
|
||||||
|
|
||||||
CCLOG("\n\nSEARCHING: %s, %s, %s", newFilename.c_str(), resOrderIter->c_str(), searchPathsIter->c_str());
|
//CCLOG("\n\nSEARCHING: %s, %s, %s", newFilename.c_str(), resOrderIter->c_str(), searchPathsIter->c_str());
|
||||||
fullpath = this->getPathForFilename(newFilename, *resOrderIter, *searchPathsIter);
|
fullpath = this->getPathForFilename(newFilename, *resOrderIter, *searchPathsIter);
|
||||||
|
|
||||||
// Check whether file exists in apk.
|
// Check whether file exists in apk.
|
||||||
|
@ -138,7 +138,7 @@ std::string CCFileUtils::fullPathForFilename(const char* pszFileName)
|
||||||
{
|
{
|
||||||
// Using the filename passed in as key.
|
// Using the filename passed in as key.
|
||||||
s_fullPathCache.insert(std::pair<std::string, std::string>(pszFileName, fullpath));
|
s_fullPathCache.insert(std::pair<std::string, std::string>(pszFileName, fullpath));
|
||||||
CCLOG("Returning path: %s", fullpath.c_str());
|
//CCLOG("Returning path: %s", fullpath.c_str());
|
||||||
return fullpath;
|
return fullpath;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -183,7 +183,7 @@ std::string CCFileUtils::getPathForFilename(const std::string& filename, const s
|
||||||
}
|
}
|
||||||
path += file;
|
path += file;
|
||||||
|
|
||||||
CCLOG("getPathForFilename, fullPath = %s", path.c_str());
|
//CCLOG("getPathForFilename, fullPath = %s", path.c_str());
|
||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -198,7 +198,7 @@ unsigned char* CCFileUtils::getFileData(const char* pszFileName, const char* psz
|
||||||
|
|
||||||
if (pszFileName[0] != '/')
|
if (pszFileName[0] != '/')
|
||||||
{
|
{
|
||||||
CCLOG("GETTING FILE RELATIVE DATA: %s", pszFileName);
|
//CCLOG("GETTING FILE RELATIVE DATA: %s", pszFileName);
|
||||||
string fullPath = fullPathForFilename(pszFileName);
|
string fullPath = fullPathForFilename(pszFileName);
|
||||||
pData = s_pZipFile->getFileData(fullPath.c_str(), pSize);
|
pData = s_pZipFile->getFileData(fullPath.c_str(), pSize);
|
||||||
}
|
}
|
||||||
|
@ -207,7 +207,7 @@ unsigned char* CCFileUtils::getFileData(const char* pszFileName, const char* psz
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
// read rrom other path than user set it
|
// read rrom other path than user set it
|
||||||
CCLOG("GETTING FILE ABSOLUTE DATA: %s", pszFileName);
|
//CCLOG("GETTING FILE ABSOLUTE DATA: %s", pszFileName);
|
||||||
FILE *fp = fopen(pszFileName, pszMode);
|
FILE *fp = fopen(pszFileName, pszMode);
|
||||||
CC_BREAK_IF(!fp);
|
CC_BREAK_IF(!fp);
|
||||||
|
|
||||||
|
@ -276,7 +276,7 @@ void CCFileUtils::setSearchPaths(const std::vector<std::string>& searchPaths)
|
||||||
|
|
||||||
if (!bExistDefaultRootPath)
|
if (!bExistDefaultRootPath)
|
||||||
{
|
{
|
||||||
CCLOG("Default root path doesn't exist, adding it.");
|
//CCLOG("Default root path doesn't exist, adding it.");
|
||||||
m_searchPathArray.push_back(m_strDefaultResRootPath);
|
m_searchPathArray.push_back(m_strDefaultResRootPath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -107,14 +107,14 @@ std::string CCFileUtils::fullPathForFilename(const char* pszFileName)
|
||||||
std::string strFileName = pszFileName;
|
std::string strFileName = pszFileName;
|
||||||
if (pszFileName[0] == '/' || strFileName.find(m_strDefaultResRootPath) == 0)
|
if (pszFileName[0] == '/' || strFileName.find(m_strDefaultResRootPath) == 0)
|
||||||
{
|
{
|
||||||
CCLOG("Return absolute path( %s ) directly.", pszFileName);
|
//CCLOG("Return absolute path( %s ) directly.", pszFileName);
|
||||||
return pszFileName;
|
return pszFileName;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Already Cached ?
|
// Already Cached ?
|
||||||
std::map<std::string, std::string>::iterator cacheIter = s_fullPathCache.find(pszFileName);
|
std::map<std::string, std::string>::iterator cacheIter = s_fullPathCache.find(pszFileName);
|
||||||
if (cacheIter != s_fullPathCache.end()) {
|
if (cacheIter != s_fullPathCache.end()) {
|
||||||
CCLOG("Return full path from cache: %s", cacheIter->second.c_str());
|
//CCLOG("Return full path from cache: %s", cacheIter->second.c_str());
|
||||||
return cacheIter->second;
|
return cacheIter->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -135,7 +135,7 @@ std::string CCFileUtils::fullPathForFilename(const char* pszFileName)
|
||||||
{
|
{
|
||||||
// Adding the full path to cache if the file was found.
|
// Adding the full path to cache if the file was found.
|
||||||
s_fullPathCache.insert(std::pair<std::string, std::string>(pszFileName, fullpath));
|
s_fullPathCache.insert(std::pair<std::string, std::string>(pszFileName, fullpath));
|
||||||
CCLOG("Returning path: %s", fullpath.c_str());
|
//CCLOG("Returning path: %s", fullpath.c_str());
|
||||||
return fullpath;
|
return fullpath;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -241,7 +241,7 @@ void CCFileUtils::setSearchPaths(const std::vector<std::string>& searchPaths)
|
||||||
|
|
||||||
if (!bExistDefaultRootPath)
|
if (!bExistDefaultRootPath)
|
||||||
{
|
{
|
||||||
CCLOG("Default root path doesn't exist, adding it.");
|
//CCLOG("Default root path doesn't exist, adding it.");
|
||||||
m_searchPathArray.push_back(m_strDefaultResRootPath);
|
m_searchPathArray.push_back(m_strDefaultResRootPath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,7 +45,7 @@ bool CCFileUtils::init()
|
||||||
resourcePath = resourcePath.substr(0, resourcePath.find_last_of("/"));
|
resourcePath = resourcePath.substr(0, resourcePath.find_last_of("/"));
|
||||||
resourcePath += "/../../../Resources/";
|
resourcePath += "/../../../Resources/";
|
||||||
m_strDefaultResRootPath = resourcePath;
|
m_strDefaultResRootPath = resourcePath;
|
||||||
CCLOG("DEFAULT RES PATH = %s", m_strDefaultResRootPath.c_str());
|
//CCLOG("DEFAULT RES PATH = %s", m_strDefaultResRootPath.c_str());
|
||||||
m_searchPathArray.push_back(m_strDefaultResRootPath);
|
m_searchPathArray.push_back(m_strDefaultResRootPath);
|
||||||
m_searchResolutionsOrderArray.push_back("");
|
m_searchResolutionsOrderArray.push_back("");
|
||||||
|
|
||||||
|
@ -125,7 +125,7 @@ std::string CCFileUtils::fullPathForFilename(const char* pszFileName)
|
||||||
for (std::vector<std::string>::iterator resOrderIter = m_searchResolutionsOrderArray.begin();
|
for (std::vector<std::string>::iterator resOrderIter = m_searchResolutionsOrderArray.begin();
|
||||||
resOrderIter != m_searchResolutionsOrderArray.end(); ++resOrderIter) {
|
resOrderIter != m_searchResolutionsOrderArray.end(); ++resOrderIter) {
|
||||||
|
|
||||||
CCLOG("\n\nSEARCHING: %s, %s, %s", newFileName.c_str(), resOrderIter->c_str(), searchPathsIter->c_str());
|
//CCLOG("\n\nSEARCHING: %s, %s, %s", newFileName.c_str(), resOrderIter->c_str(), searchPathsIter->c_str());
|
||||||
|
|
||||||
fullpath = this->getPathForFilename(newFileName, *resOrderIter, *searchPathsIter);
|
fullpath = this->getPathForFilename(newFileName, *resOrderIter, *searchPathsIter);
|
||||||
|
|
||||||
|
@ -135,7 +135,7 @@ std::string CCFileUtils::fullPathForFilename(const char* pszFileName)
|
||||||
{
|
{
|
||||||
// Adding the full path to cache if the file was found.
|
// Adding the full path to cache if the file was found.
|
||||||
s_fullPathCache.insert(std::pair<std::string, std::string>(pszFileName, fullpath));
|
s_fullPathCache.insert(std::pair<std::string, std::string>(pszFileName, fullpath));
|
||||||
CCLOG("Returning path: %s", fullpath.c_str());
|
//CCLOG("Returning path: %s", fullpath.c_str());
|
||||||
return fullpath;
|
return fullpath;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -234,7 +234,7 @@ void CCFileUtils::setSearchPaths(const std::vector<std::string>& searchPaths)
|
||||||
|
|
||||||
if (!bExistDefaultRootPath)
|
if (!bExistDefaultRootPath)
|
||||||
{
|
{
|
||||||
CCLOG("Default root path doesn't exist, adding it.");
|
//CCLOG("Default root path doesn't exist, adding it.");
|
||||||
m_searchPathArray.push_back(m_strDefaultResRootPath);
|
m_searchPathArray.push_back(m_strDefaultResRootPath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -112,7 +112,7 @@ std::string CCFileUtils::fullPathForFilename(const char* pszFileName)
|
||||||
// Return directly if it's an absolute path.
|
// Return directly if it's an absolute path.
|
||||||
if (pszFileName[0] == '/')
|
if (pszFileName[0] == '/')
|
||||||
{
|
{
|
||||||
CCLOG("Return absolute path( %s ) directly.", pszFileName);
|
//CCLOG("Return absolute path( %s ) directly.", pszFileName);
|
||||||
return pszFileName;
|
return pszFileName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -234,7 +234,7 @@ void CCFileUtils::setSearchPaths(const std::vector<std::string>& searchPaths)
|
||||||
|
|
||||||
if (!bExistDefaultRootPath)
|
if (!bExistDefaultRootPath)
|
||||||
{
|
{
|
||||||
CCLOG("Default root path doesn't exist, adding it.");
|
//CCLOG("Default root path doesn't exist, adding it.");
|
||||||
m_searchPathArray.push_back(m_strDefaultResRootPath);
|
m_searchPathArray.push_back(m_strDefaultResRootPath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -131,14 +131,14 @@ std::string CCFileUtils::fullPathForFilename(const char* pszFileName)
|
||||||
&& (pszFileName[2] == '\\' || pszFileName[2] == '/')
|
&& (pszFileName[2] == '\\' || pszFileName[2] == '/')
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
CCLOG("Probably invoking fullPathForFilename recursively, return the full path: %s", pszFileName);
|
//CCLOG("Probably invoking fullPathForFilename recursively, return the full path: %s", pszFileName);
|
||||||
return pszFileName;
|
return pszFileName;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Already Cached ?
|
// Already Cached ?
|
||||||
std::map<std::string, std::string>::iterator cacheIter = s_fullPathCache.find(pszFileName);
|
std::map<std::string, std::string>::iterator cacheIter = s_fullPathCache.find(pszFileName);
|
||||||
if (cacheIter != s_fullPathCache.end()) {
|
if (cacheIter != s_fullPathCache.end()) {
|
||||||
CCLOG("Return full path from cache: %s", cacheIter->second.c_str());
|
//CCLOG("Return full path from cache: %s", cacheIter->second.c_str());
|
||||||
return cacheIter->second;
|
return cacheIter->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -156,7 +156,7 @@ std::string CCFileUtils::fullPathForFilename(const char* pszFileName)
|
||||||
{
|
{
|
||||||
// Adding the full path to cache if the file was found.
|
// Adding the full path to cache if the file was found.
|
||||||
s_fullPathCache.insert(std::pair<std::string, std::string>(pszFileName, fullpath));
|
s_fullPathCache.insert(std::pair<std::string, std::string>(pszFileName, fullpath));
|
||||||
CCLOG("Returning path: %s", fullpath.c_str());
|
//CCLOG("Returning path: %s", fullpath.c_str());
|
||||||
return fullpath;
|
return fullpath;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -245,7 +245,7 @@ void CCFileUtils::setSearchPaths(const std::vector<std::string>& searchPaths)
|
||||||
|
|
||||||
if (!bExistDefaultRootPath)
|
if (!bExistDefaultRootPath)
|
||||||
{
|
{
|
||||||
CCLOG("Default root path doesn't exist, adding it.");
|
//CCLOG("Default root path doesn't exist, adding it.");
|
||||||
m_searchPathArray.push_back(m_strDefaultResRootPath);
|
m_searchPathArray.push_back(m_strDefaultResRootPath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,7 +71,6 @@ bool AppDelegate::applicationDidFinishLaunching()
|
||||||
}
|
}
|
||||||
else if (platform == kTargetAndroid || platform == kTargetWindows)
|
else if (platform == kTargetAndroid || platform == kTargetWindows)
|
||||||
{
|
{
|
||||||
CCLOG("screen size [%f, %f]", screenSize.width, screenSize.height);
|
|
||||||
if (screenSize.height > 960)
|
if (screenSize.height > 960)
|
||||||
{
|
{
|
||||||
resourceSize = CCSizeMake(1280, 1920);
|
resourceSize = CCSizeMake(1280, 1920);
|
||||||
|
|
|
@ -108,7 +108,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\..\..\scripting\javascript\spidermonkey-win32\li
|
||||||
if exist "$(OutDir)\CocosDragonJSRes" rd /s /q "$(OutDir)\CocosDragonJSRes"
|
if exist "$(OutDir)\CocosDragonJSRes" rd /s /q "$(OutDir)\CocosDragonJSRes"
|
||||||
mkdir "$(OutDir)\CocosDragonJSRes"
|
mkdir "$(OutDir)\CocosDragonJSRes"
|
||||||
xcopy "$(ProjectDir)..\..\..\..\scripting\javascript\bindings\js\*.js" "$(OutDir)\CocosDragonJSRes" /e /Y
|
xcopy "$(ProjectDir)..\..\..\..\scripting\javascript\bindings\js\*.js" "$(OutDir)\CocosDragonJSRes" /e /Y
|
||||||
xcopy "$(ProjectDir)..\..\Shared\games\CocosDragonJS\Published files iOS" "$(OutDir)\CocosDragonJSRes\" /e /Y</Command>
|
xcopy "$(ProjectDir)..\..\Shared\games\CocosDragonJS\Published files Android" "$(OutDir)\CocosDragonJSRes\" /e /Y</Command>
|
||||||
</PreBuildEvent>
|
</PreBuildEvent>
|
||||||
<PreBuildEvent>
|
<PreBuildEvent>
|
||||||
<Message>Copy js and resource files.</Message>
|
<Message>Copy js and resource files.</Message>
|
||||||
|
@ -161,7 +161,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\..\..\scripting\javascript\spidermonkey-win32\li
|
||||||
if exist "$(OutDir)\CocosDragonJSRes" rd /s /q "$(OutDir)\CocosDragonJSRes"
|
if exist "$(OutDir)\CocosDragonJSRes" rd /s /q "$(OutDir)\CocosDragonJSRes"
|
||||||
mkdir "$(OutDir)\CocosDragonJSRes"
|
mkdir "$(OutDir)\CocosDragonJSRes"
|
||||||
xcopy "$(ProjectDir)..\..\..\..\scripting\javascript\bindings\js\*.js" "$(OutDir)\CocosDragonJSRes" /e /Y
|
xcopy "$(ProjectDir)..\..\..\..\scripting\javascript\bindings\js\*.js" "$(OutDir)\CocosDragonJSRes" /e /Y
|
||||||
xcopy "$(ProjectDir)..\..\Shared\games\CocosDragonJS\Published files iOS" "$(OutDir)\CocosDragonJSRes\" /e /Y</Command>
|
xcopy "$(ProjectDir)..\..\Shared\games\CocosDragonJS\Published files Android" "$(OutDir)\CocosDragonJSRes\" /e /Y</Command>
|
||||||
<Message>Copy js and resource files.</Message>
|
<Message>Copy js and resource files.</Message>
|
||||||
</PreBuildEvent>
|
</PreBuildEvent>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
|
|
Loading…
Reference in New Issue