Merge pull request #1927 from dumganhar/master

Comments some logs in CCFileUtils.
This commit is contained in:
minggo 2013-01-29 03:16:01 -08:00
commit 67a2ff5199
8 changed files with 26 additions and 28 deletions

View File

@ -382,7 +382,7 @@ std::string CCFileUtils::getNewFilename(const char* pszFileName)
}
else {
pszNewFileName = fileNameFound->getCString();
CCLOG("FOUND NEW FILE NAME: %s.", pszNewFileName);
//CCLOG("FOUND NEW FILE NAME: %s.", 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);
return;
}
CCLOG("Found file lookup plist.");
setFilenameLookupDictionary((CCDictionary*)pDict->objectForKey("filenames"));
}
}

View File

@ -94,14 +94,14 @@ std::string CCFileUtils::fullPathForFilename(const char* pszFileName)
std::string strFileName = pszFileName;
if (pszFileName[0] == '/' || strFileName.find(m_strDefaultResRootPath) == 0)
{
CCLOG("Return absolute path( %s ) directly.", pszFileName);
//CCLOG("Return absolute path( %s ) directly.", pszFileName);
return pszFileName;
}
// Already Cached ?
std::map<std::string, std::string>::iterator cacheIter = s_fullPathCache.find(pszFileName);
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;
}
@ -117,8 +117,8 @@ std::string CCFileUtils::fullPathForFilename(const char* pszFileName)
for (std::vector<std::string>::iterator resOrderIter = m_searchResolutionsOrderArray.begin();
resOrderIter != m_searchResolutionsOrderArray.end(); ++resOrderIter) {
CCLOG("\n\nSEARCHING: %s, %s, %s", newFilename.c_str(), resOrderIter->c_str(), searchPathsIter->c_str());
fullpath = this->getPathForFilename(newFilename, *resOrderIter, *searchPathsIter);
//CCLOG("\n\nSEARCHING: %s, %s, %s", newFilename.c_str(), resOrderIter->c_str(), searchPathsIter->c_str());
fullpath = this->getPathForFilename(newFilename, *resOrderIter, *searchPathsIter);
// Check whether file exists in apk.
if (s_pZipFile->fileExists(fullpath))
@ -138,7 +138,7 @@ std::string CCFileUtils::fullPathForFilename(const char* pszFileName)
{
// Using the filename passed in as key.
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;
}
}
@ -183,7 +183,7 @@ std::string CCFileUtils::getPathForFilename(const std::string& filename, const s
}
path += file;
CCLOG("getPathForFilename, fullPath = %s", path.c_str());
//CCLOG("getPathForFilename, fullPath = %s", path.c_str());
return path;
}
@ -198,7 +198,7 @@ unsigned char* CCFileUtils::getFileData(const char* pszFileName, const char* psz
if (pszFileName[0] != '/')
{
CCLOG("GETTING FILE RELATIVE DATA: %s", pszFileName);
//CCLOG("GETTING FILE RELATIVE DATA: %s", pszFileName);
string fullPath = fullPathForFilename(pszFileName);
pData = s_pZipFile->getFileData(fullPath.c_str(), pSize);
}
@ -207,7 +207,7 @@ unsigned char* CCFileUtils::getFileData(const char* pszFileName, const char* psz
do
{
// 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);
CC_BREAK_IF(!fp);
@ -276,7 +276,7 @@ void CCFileUtils::setSearchPaths(const std::vector<std::string>& searchPaths)
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);
}
}

View File

@ -107,14 +107,14 @@ std::string CCFileUtils::fullPathForFilename(const char* pszFileName)
std::string strFileName = pszFileName;
if (pszFileName[0] == '/' || strFileName.find(m_strDefaultResRootPath) == 0)
{
CCLOG("Return absolute path( %s ) directly.", pszFileName);
//CCLOG("Return absolute path( %s ) directly.", pszFileName);
return pszFileName;
}
// Already Cached ?
std::map<std::string, std::string>::iterator cacheIter = s_fullPathCache.find(pszFileName);
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;
}
@ -135,7 +135,7 @@ std::string CCFileUtils::fullPathForFilename(const char* pszFileName)
{
// Adding the full path to cache if the file was found.
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;
}
}
@ -241,7 +241,7 @@ void CCFileUtils::setSearchPaths(const std::vector<std::string>& searchPaths)
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);
}
}

View File

@ -45,7 +45,7 @@ bool CCFileUtils::init()
resourcePath = resourcePath.substr(0, resourcePath.find_last_of("/"));
resourcePath += "/../../../Resources/";
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_searchResolutionsOrderArray.push_back("");
@ -125,7 +125,7 @@ std::string CCFileUtils::fullPathForFilename(const char* pszFileName)
for (std::vector<std::string>::iterator resOrderIter = m_searchResolutionsOrderArray.begin();
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);
@ -135,7 +135,7 @@ std::string CCFileUtils::fullPathForFilename(const char* pszFileName)
{
// Adding the full path to cache if the file was found.
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;
}
}
@ -234,7 +234,7 @@ void CCFileUtils::setSearchPaths(const std::vector<std::string>& searchPaths)
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);
}
}

View File

@ -112,7 +112,7 @@ std::string CCFileUtils::fullPathForFilename(const char* pszFileName)
// Return directly if it's an absolute path.
if (pszFileName[0] == '/')
{
CCLOG("Return absolute path( %s ) directly.", pszFileName);
//CCLOG("Return absolute path( %s ) directly.", pszFileName);
return pszFileName;
}
@ -234,7 +234,7 @@ void CCFileUtils::setSearchPaths(const std::vector<std::string>& searchPaths)
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);
}
}

View File

@ -131,14 +131,14 @@ std::string CCFileUtils::fullPathForFilename(const char* pszFileName)
&& (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;
}
// Already Cached ?
std::map<std::string, std::string>::iterator cacheIter = s_fullPathCache.find(pszFileName);
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;
}
@ -156,7 +156,7 @@ std::string CCFileUtils::fullPathForFilename(const char* pszFileName)
{
// Adding the full path to cache if the file was found.
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;
}
}
@ -245,7 +245,7 @@ void CCFileUtils::setSearchPaths(const std::vector<std::string>& searchPaths)
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);
}
}

View File

@ -71,7 +71,6 @@ bool AppDelegate::applicationDidFinishLaunching()
}
else if (platform == kTargetAndroid || platform == kTargetWindows)
{
CCLOG("screen size [%f, %f]", screenSize.width, screenSize.height);
if (screenSize.height > 960)
{
resourceSize = CCSizeMake(1280, 1920);

View File

@ -108,7 +108,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\..\..\scripting\javascript\spidermonkey-win32\li
if exist "$(OutDir)\CocosDragonJSRes" rd /s /q "$(OutDir)\CocosDragonJSRes"
mkdir "$(OutDir)\CocosDragonJSRes"
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>
<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"
mkdir "$(OutDir)\CocosDragonJSRes"
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>
</PreBuildEvent>
</ItemDefinitionGroup>