From 04c1a863a0241e82df9bceff0e77a4defd56ca8f Mon Sep 17 00:00:00 2001 From: Sam Clegg Date: Sat, 16 Mar 2013 08:56:03 -0700 Subject: [PATCH] Remove tailing newlines from CCLog messaages. Some CCLog message contained trailing newlines which made the logs hard to read on many platforms. The solution here is to stip trailing newlines on those platforms, and also to remove the newlines from the existing log messages. --- cocos2dx/platform/blackberry/CCCommon.cpp | 19 ++- cocos2dx/platform/blackberry/CCImage.cpp | 6 +- cocos2dx/platform/linux/CCCommon.cpp | 15 ++- cocos2dx/platform/linux/CCEGLView.cpp | 8 +- .../platform/marmalade/CCAccelerometer.cpp | 2 +- cocos2dx/platform/marmalade/CCCommon.cpp | 13 +- cocos2dx/platform/marmalade/CCImage.cpp | 2 +- cocos2dx/platform/nacl/CCCommon.cpp | 8 ++ cocos2dx/platform/win32/CCEGLView.cpp | 10 +- extensions/network/HttpClient.cpp | 2 +- .../Classes/FileUtilsTest/FileUtilsTest.cpp | 2 +- .../PerformanceTextureTest.cpp | 120 +++++++++--------- .../Classes/Texture2dTest/Texture2dTest.cpp | 16 +-- 13 files changed, 126 insertions(+), 97 deletions(-) diff --git a/cocos2dx/platform/blackberry/CCCommon.cpp b/cocos2dx/platform/blackberry/CCCommon.cpp index 9d0a7d30ee..5564cadc79 100644 --- a/cocos2dx/platform/blackberry/CCCommon.cpp +++ b/cocos2dx/platform/blackberry/CCCommon.cpp @@ -33,17 +33,25 @@ void CCLog(const char * pszFormat, ...) char buf[MAX_LEN]; va_list args; - va_start(args, pszFormat); + va_start(args, pszFormat); vsnprintf(buf, MAX_LEN, pszFormat, args); va_end(args); - - fprintf(stderr, "cocos2d-x debug info %s\n", buf); + + // Strip any trailing newlines from log message. + size_t len = strlen(szBuf); + while (len && szBuf[len-1] == '\n') + { + szBuf[len-1] = '\0'; + len--; + } + + fprintf(stderr, "cocos2d-x debug info %s\n", buf); } void CCMessageBox(const char * pszMsg, const char * pszTitle) { -// MessageBoxA(NULL, pszMsg, pszTitle, MB_OK); - CCLog(pszMsg); + //MessageBoxA(NULL, pszMsg, pszTitle, MB_OK); + CCLog(pszMsg); } void CCLuaLog(const char * pszFormat) @@ -52,4 +60,3 @@ void CCLuaLog(const char * pszFormat) } NS_CC_END - diff --git a/cocos2dx/platform/blackberry/CCImage.cpp b/cocos2dx/platform/blackberry/CCImage.cpp index ce7d662d09..3137f89a49 100755 --- a/cocos2dx/platform/blackberry/CCImage.cpp +++ b/cocos2dx/platform/blackberry/CCImage.cpp @@ -259,12 +259,12 @@ public: return false; } do { - //CCLog("\n\n ---- FT_New_Face with pFontName = %s\n", pFontName); + //CCLog(" ---- FT_New_Face with pFontName = %s", pFontName); iError = FT_New_Face( library, pFontName, 0, &face ); if (iError) { //no valid font found use default - //CCLog("\n\n ---- no valid font, use default %s\n", pFontName); + //CCLog(" ---- no valid font, use default %s", pFontName); iError = FT_New_Face( library, "/usr/fonts/font_repository/monotype/arial.ttf", 0, &face ); } CC_BREAK_IF(iError); @@ -418,7 +418,7 @@ bool CCImage::initWithString( //CCLog("-----pText=%s and Font File is %s nWidth= %d,nHeight=%d",pText,fullFontName.c_str(),nWidth,nHeight); CC_BREAK_IF(! dc.getBitmap(pText, nWidth, nHeight, eAlignMask, fullFontName.c_str(), nSize)); - //CCLog("---- dc.getBitmap is Succesfull... \n"); + //CCLog("---- dc.getBitmap is Succesfull..."); // assign the dc.m_pData to m_pData in order to save time m_pData = dc.m_pData; diff --git a/cocos2dx/platform/linux/CCCommon.cpp b/cocos2dx/platform/linux/CCCommon.cpp index 822f33a76d..44c4989caf 100644 --- a/cocos2dx/platform/linux/CCCommon.cpp +++ b/cocos2dx/platform/linux/CCCommon.cpp @@ -34,15 +34,23 @@ void CCLog(const char * pszFormat, ...) va_list ap; va_start(ap, pszFormat); - vsnprintf( szBuf, MAX_LEN, pszFormat, ap); + vsnprintf(szBuf, MAX_LEN, pszFormat, ap); va_end(ap); - fprintf(stderr, "cocos2d-x debug info [%s]\n", szBuf); + // Strip any trailing newlines from log message. + size_t len = strlen(szBuf); + while (len && szBuf[len-1] == '\n') + { + szBuf[len-1] = '\0'; + len--; + } + + fprintf(stderr, "cocos2d-x debug info [%s]\n", szBuf); } void CCMessageBox(const char * pszMsg, const char * pszTitle) { - CCLog("%s: %s", pszTitle, pszMsg); + CCLog("%s: %s", pszTitle, pszMsg); } void CCLuaLog(const char * pszFormat) @@ -51,4 +59,3 @@ void CCLuaLog(const char * pszFormat) } NS_CC_END - diff --git a/cocos2dx/platform/linux/CCEGLView.cpp b/cocos2dx/platform/linux/CCEGLView.cpp index 75ca2e83cd..0599eb53b7 100644 --- a/cocos2dx/platform/linux/CCEGLView.cpp +++ b/cocos2dx/platform/linux/CCEGLView.cpp @@ -305,20 +305,20 @@ bool CCEGLView::initGL() if (GLEW_ARB_vertex_shader && GLEW_ARB_fragment_shader) { - CCLog("Ready for GLSL\n"); + CCLog("Ready for GLSL"); } else { - CCLog("Not totally ready :( \n"); + CCLog("Not totally ready :("); } if (glewIsSupported("GL_VERSION_2_0")) { - CCLog("Ready for OpenGL 2.0\n"); + CCLog("Ready for OpenGL 2.0"); } else { - CCLog("OpenGL 2.0 not supported\n"); + CCLog("OpenGL 2.0 not supported"); } // Enable point size by default on linux. diff --git a/cocos2dx/platform/marmalade/CCAccelerometer.cpp b/cocos2dx/platform/marmalade/CCAccelerometer.cpp index aaa29b1b4b..25a3b12f9e 100644 --- a/cocos2dx/platform/marmalade/CCAccelerometer.cpp +++ b/cocos2dx/platform/marmalade/CCAccelerometer.cpp @@ -61,7 +61,7 @@ void CCAccelerometer::setDelegate(CCAccelerometerDelegate* pDelegate) { if (s3eAccelerometerStart() != S3E_RESULT_SUCCESS) { - CCLog("s3eAccelerometerStart() - ERROR\n"); + CCLog("s3eAccelerometerStart() - ERROR"); } } else diff --git a/cocos2dx/platform/marmalade/CCCommon.cpp b/cocos2dx/platform/marmalade/CCCommon.cpp index abb99bd78c..6a54176ad6 100644 --- a/cocos2dx/platform/marmalade/CCCommon.cpp +++ b/cocos2dx/platform/marmalade/CCCommon.cpp @@ -38,12 +38,20 @@ void CCLog(const char * pszFormat, ...) vsnprintf( szBuf, MAX_LEN, pszFormat, ap); va_end(ap); - fprintf(stderr, "cocos2d-x debug info [%s]\n", szBuf); + // Strip any trailing newlines from log message. + size_t len = strlen(szBuf); + while (len && szBuf[len-1] == '\n') + { + szBuf[len-1] = '\0'; + len--; + } + + fprintf(stderr, "cocos2d-x debug info [%s]\n", szBuf); } void CCMessageBox(const char * pszMsg, const char * pszTitle) { - CCLog("%s: %s", pszTitle, pszMsg); + CCLog("%s: %s", pszTitle, pszMsg); } void CCLuaLog(const char * pszFormat) @@ -52,4 +60,3 @@ void CCLuaLog(const char * pszFormat) } NS_CC_END - diff --git a/cocos2dx/platform/marmalade/CCImage.cpp b/cocos2dx/platform/marmalade/CCImage.cpp index 401be9ed92..96e6da535d 100644 --- a/cocos2dx/platform/marmalade/CCImage.cpp +++ b/cocos2dx/platform/marmalade/CCImage.cpp @@ -383,7 +383,7 @@ bool BitmapDC::getBitmap( const char *text, int nWidth, int nHeight, CCImage::ET if (iError) { //no valid font found, try to use default fName = "fonts/Marker Felt.ttf" ; - //CCLog("No valid font, use default %s\n", fName.c_str()); + //CCLog("No valid font, use default %s", fName.c_str()); iError = openFont( fName, fontSize ); } } diff --git a/cocos2dx/platform/nacl/CCCommon.cpp b/cocos2dx/platform/nacl/CCCommon.cpp index e8eaabac9e..fa62691599 100644 --- a/cocos2dx/platform/nacl/CCCommon.cpp +++ b/cocos2dx/platform/nacl/CCCommon.cpp @@ -38,6 +38,14 @@ void CCLog(const char * pszFormat, ...) vsnprintf( szBuf, MAX_LEN, pszFormat, ap); va_end(ap); + // Strip any trailing newlines from log message. + size_t len = strlen(szBuf); + while (len && szBuf[len-1] == '\n') + { + szBuf[len-1] = '\0'; + len--; + } + fprintf(stderr, "cocos2d-x debug info [%s]\n", szBuf); } diff --git a/cocos2dx/platform/win32/CCEGLView.cpp b/cocos2dx/platform/win32/CCEGLView.cpp index 7f960908b9..ddc79748fa 100644 --- a/cocos2dx/platform/win32/CCEGLView.cpp +++ b/cocos2dx/platform/win32/CCEGLView.cpp @@ -103,10 +103,10 @@ static bool glew_dynamic_binding() // If the current opengl driver doesn't have framebuffers methods, check if an extension exists if (glGenFramebuffers == NULL) { - CCLog("OpenGL: glGenFramebuffers is NULL, try to detect an extension\n"); + CCLog("OpenGL: glGenFramebuffers is NULL, try to detect an extension"); if (strstr(gl_extensions, "ARB_framebuffer_object")) { - CCLog("OpenGL: ARB_framebuffer_object is supported\n"); + CCLog("OpenGL: ARB_framebuffer_object is supported"); glIsRenderbuffer = (PFNGLISRENDERBUFFERPROC) wglGetProcAddress("glIsRenderbuffer"); glBindRenderbuffer = (PFNGLBINDRENDERBUFFERPROC) wglGetProcAddress("glBindRenderbuffer"); @@ -129,7 +129,7 @@ static bool glew_dynamic_binding() else if (strstr(gl_extensions, "EXT_framebuffer_object")) { - CCLog("OpenGL: EXT_framebuffer_object is supported\n"); + CCLog("OpenGL: EXT_framebuffer_object is supported"); glIsRenderbuffer = (PFNGLISRENDERBUFFERPROC) wglGetProcAddress("glIsRenderbufferEXT"); glBindRenderbuffer = (PFNGLBINDRENDERBUFFERPROC) wglGetProcAddress("glBindRenderbufferEXT"); glDeleteRenderbuffers = (PFNGLDELETERENDERBUFFERSPROC) wglGetProcAddress("glDeleteRenderbuffersEXT"); @@ -150,8 +150,8 @@ static bool glew_dynamic_binding() } else { - CCLog("OpenGL: No framebuffers extension is supported\n"); - CCLog("OpenGL: Any call to Fbo will crash!\n"); + CCLog("OpenGL: No framebuffers extension is supported"); + CCLog("OpenGL: Any call to Fbo will crash!"); return false; } } diff --git a/extensions/network/HttpClient.cpp b/extensions/network/HttpClient.cpp index a3ffd979a6..6845d41b4f 100644 --- a/extensions/network/HttpClient.cpp +++ b/extensions/network/HttpClient.cpp @@ -99,7 +99,7 @@ static void* networkThread(void *data) // Wait for http request tasks from main thread int semWaitRet = sem_wait(s_pSem); if (semWaitRet < 0) { - CCLog("HttpRequest async thread semaphore error: %s\n", strerror(errno)); + CCLog("HttpRequest async thread semaphore error: %s", strerror(errno)); break; } diff --git a/samples/Cpp/TestCpp/Classes/FileUtilsTest/FileUtilsTest.cpp b/samples/Cpp/TestCpp/Classes/FileUtilsTest/FileUtilsTest.cpp index bce737562e..6f2e716d06 100644 --- a/samples/Cpp/TestCpp/Classes/FileUtilsTest/FileUtilsTest.cpp +++ b/samples/Cpp/TestCpp/Classes/FileUtilsTest/FileUtilsTest.cpp @@ -226,7 +226,7 @@ void TestSearchPath::onEnter() // Gets external.txt from writable path string fullPath = sharedFileUtils->fullPathForFilename("external.txt"); - CCLog("\nexternal file path = %s\n", fullPath.c_str()); + CCLog("external file path = %s", fullPath.c_str()); if (fullPath.length() > 0) { fp = fopen(fullPath.c_str(), "rb"); diff --git a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceTextureTest.cpp b/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceTextureTest.cpp index 05e8de353f..05c6378b50 100644 --- a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceTextureTest.cpp +++ b/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceTextureTest.cpp @@ -91,9 +91,9 @@ void TextureTest::performTestsPNG(const char* filename) gettimeofday(&now, NULL); texture = cache->addImage(filename); if( texture ) - CCLog(" ms:%f\n", calculateDeltaTime(&now) ); + CCLog(" ms:%f", calculateDeltaTime(&now) ); else - CCLog(" ERROR\n"); + CCLog(" ERROR"); cache->removeTexture(texture); CCLog("RGBA 4444"); @@ -101,9 +101,9 @@ void TextureTest::performTestsPNG(const char* filename) gettimeofday(&now, NULL); texture = cache->addImage(filename); if( texture ) - CCLog(" ms:%f\n", calculateDeltaTime(&now) ); + CCLog(" ms:%f", calculateDeltaTime(&now) ); else - CCLog(" ERROR\n"); + CCLog(" ERROR"); cache->removeTexture(texture); CCLog("RGBA 5551"); @@ -111,9 +111,9 @@ void TextureTest::performTestsPNG(const char* filename) gettimeofday(&now, NULL); texture = cache->addImage(filename); if( texture ) - CCLog(" ms:%f\n", calculateDeltaTime(&now) ); + CCLog(" ms:%f", calculateDeltaTime(&now) ); else - CCLog(" ERROR\n"); + CCLog(" ERROR"); cache->removeTexture(texture); CCLog("RGB 565"); @@ -121,9 +121,9 @@ void TextureTest::performTestsPNG(const char* filename) gettimeofday(&now, NULL); texture = cache->addImage(filename); if( texture ) - CCLog(" ms:%f\n", calculateDeltaTime(&now) ); + CCLog(" ms:%f", calculateDeltaTime(&now) ); else - CCLog(" ERROR\n"); + CCLog(" ERROR"); cache->removeTexture(texture); } @@ -133,60 +133,60 @@ void TextureTest::performTests() // struct timeval now; // CCTextureCache *cache = CCTextureCache::sharedTextureCache(); - CCLog("\n\n--------\n\n"); + CCLog("--------"); - CCLog("--- PNG 128x128 ---\n"); + CCLog("--- PNG 128x128 ---"); performTestsPNG("Images/test_image.png"); -// CCLog("--- PVR 128x128 ---\n"); +// CCLog("--- PVR 128x128 ---"); // CCLog("RGBA 8888"); // gettimeofday(&now, NULL); // texture = cache->addImage("Images/test_image_rgba8888.pvr"); // if( texture ) -// CCLog(" ms:%f\n", calculateDeltaTime(&now) ); +// CCLog(" ms:%f", calculateDeltaTime(&now) ); // else -// CCLog("ERROR\n"); +// CCLog("ERROR"); // cache->removeTexture(texture); // // CCLog("BGRA 8888"); // gettimeofday(&now, NULL); // texture = cache->addImage("Images/test_image_bgra8888.pvr"); // if( texture ) -// CCLog(" ms:%f\n", calculateDeltaTime(&now) ); +// CCLog(" ms:%f", calculateDeltaTime(&now) ); // else -// CCLog("ERROR\n"); +// CCLog("ERROR"); // cache->removeTexture(texture); // // CCLog("RGBA 4444"); // gettimeofday(&now, NULL); // texture = cache->addImage("Images/test_image_rgba4444.pvr"); // if( texture ) -// CCLog(" ms:%f\n", calculateDeltaTime(&now) ); +// CCLog(" ms:%f", calculateDeltaTime(&now) ); // else -// CCLog("ERROR\n"); +// CCLog("ERROR"); // cache->removeTexture(texture); // // CCLog("RGB 565"); // gettimeofday(&now, NULL); // texture = cache->addImage("Images/test_image_rgb565.pvr"); // if( texture ) -// CCLog(" ms:%f\n", calculateDeltaTime(&now) ); +// CCLog(" ms:%f", calculateDeltaTime(&now) ); // else -// CCLog("ERROR\n"); +// CCLog("ERROR"); // cache->removeTexture(texture); - CCLog("\n\n--- PNG 512x512 ---\n"); + CCLog("--- PNG 512x512 ---"); performTestsPNG("Images/texture512x512.png"); -// CCLog("--- PVR 512x512 ---\n"); +// CCLog("--- PVR 512x512 ---"); // CCLog("RGBA 4444"); // gettimeofday(&now, NULL); // texture = cache->addImage("Images/texture512x512_rgba4444.pvr"); // if( texture ) -// CCLog(" ms:%f\n", calculateDeltaTime(&now) ); +// CCLog(" ms:%f", calculateDeltaTime(&now) ); // else -// CCLog("ERROR\n"); +// CCLog("ERROR"); // cache->removeTexture(texture); // @@ -195,38 +195,38 @@ void TextureTest::performTests() // Empty image // - CCLog("\n\nEMPTY IMAGE\n\n"); - CCLog("--- PNG 1024x1024 ---\n"); + CCLog("EMPTY IMAGE"); + CCLog("--- PNG 1024x1024 ---"); performTestsPNG("Images/texture1024x1024.png"); -// CCLog("--- PVR 1024x1024 ---\n"); +// CCLog("--- PVR 1024x1024 ---"); // CCLog("RGBA 4444"); // gettimeofday(&now, NULL); // texture = cache->addImage("Images/texture1024x1024_rgba4444.pvr"); // if( texture ) -// CCLog(" ms:%f\n", calculateDeltaTime(&now) ); +// CCLog(" ms:%f", calculateDeltaTime(&now) ); // else -// CCLog("ERROR\n"); +// CCLog("ERROR"); // cache->removeTexture(texture); // -// CCLog("--- PVR.GZ 1024x1024 ---\n"); +// CCLog("--- PVR.GZ 1024x1024 ---"); // CCLog("RGBA 4444"); // gettimeofday(&now, NULL); // texture = cache->addImage("Images/texture1024x1024_rgba4444.pvr.gz"); // if( texture ) -// CCLog(" ms:%f\n", calculateDeltaTime(&now) ); +// CCLog(" ms:%f", calculateDeltaTime(&now) ); // else -// CCLog("ERROR\n"); +// CCLog("ERROR"); // cache->removeTexture(texture); // -// CCLog("--- PVR.CCZ 1024x1024 ---\n"); +// CCLog("--- PVR.CCZ 1024x1024 ---"); // CCLog("RGBA 4444"); // gettimeofday(&now, NULL); // texture = cache->addImage("Images/texture1024x1024_rgba4444.pvr.ccz"); // if( texture ) -// CCLog(" ms:%f\n", calculateDeltaTime(&now) ); +// CCLog(" ms:%f", calculateDeltaTime(&now) ); // else -// CCLog("ERROR\n"); +// CCLog("ERROR"); // cache->removeTexture(texture); // @@ -235,38 +235,38 @@ void TextureTest::performTests() // SpriteSheet images // - CCLog("\n\nSPRITESHEET IMAGE\n\n"); - CCLog("--- PNG 1024x1024 ---\n"); + CCLog("SPRITESHEET IMAGE"); + CCLog("--- PNG 1024x1024 ---"); performTestsPNG("Images/PlanetCute-1024x1024.png"); -// CCLog("--- PVR 1024x1024 ---\n"); +// CCLog("--- PVR 1024x1024 ---"); // CCLog("RGBA 4444"); // gettimeofday(&now, NULL); // texture = cache->addImage("Images/PlanetCute-1024x1024-rgba4444.pvr"); // if( texture ) -// CCLog(" ms:%f\n", calculateDeltaTime(&now) ); +// CCLog(" ms:%f", calculateDeltaTime(&now) ); // else -// CCLog("ERROR\n"); +// CCLog("ERROR"); // cache->removeTexture(texture); // -// CCLog("--- PVR.GZ 1024x1024 ---\n"); +// CCLog("--- PVR.GZ 1024x1024 ---"); // CCLog("RGBA 4444"); // gettimeofday(&now, NULL); // texture = cache->addImage("Images/PlanetCute-1024x1024-rgba4444.pvr.gz"); // if( texture ) -// CCLog(" ms:%f\n", calculateDeltaTime(&now) ); +// CCLog(" ms:%f", calculateDeltaTime(&now) ); // else -// CCLog("ERROR\n"); +// CCLog("ERROR"); // cache->removeTexture(texture); // -// CCLog("--- PVR.CCZ 1024x1024 ---\n"); +// CCLog("--- PVR.CCZ 1024x1024 ---"); // CCLog("RGBA 4444"); // gettimeofday(&now, NULL); // texture = cache->addImage("Images/PlanetCute-1024x1024-rgba4444.pvr.ccz"); // if( texture ) -// CCLog(" ms:%f\n", calculateDeltaTime(&now) ); +// CCLog(" ms:%f", calculateDeltaTime(&now) ); // else -// CCLog("ERROR\n"); +// CCLog("ERROR"); // cache->removeTexture(texture); @@ -276,39 +276,39 @@ void TextureTest::performTests() // Landscape Image // - CCLog("\n\nLANDSCAPE IMAGE\n\n"); + CCLog("LANDSCAPE IMAGE"); - CCLog("--- PNG 1024x1024 ---\n"); + CCLog("--- PNG 1024x1024 ---"); performTestsPNG("Images/landscape-1024x1024.png"); -// CCLog("--- PVR 1024x1024 ---\n"); +// CCLog("--- PVR 1024x1024 ---"); // CCLog("RGBA 8888"); // gettimeofday(&now, NULL); // texture = cache->addImage("Images/landscape-1024x1024-rgba8888.pvr"); // if( texture ) -// CCLog(" ms:%f\n", calculateDeltaTime(&now) ); +// CCLog(" ms:%f", calculateDeltaTime(&now) ); // else -// CCLog("ERROR\n"); +// CCLog("ERROR"); // cache->removeTexture(texture); // -// CCLog("--- PVR.GZ 1024x1024 ---\n"); +// CCLog("--- PVR.GZ 1024x1024 ---"); // CCLog("RGBA 8888"); // gettimeofday(&now, NULL); // texture = cache->addImage("Images/landscape-1024x1024-rgba8888.pvr.gz"); // if( texture ) -// CCLog(" ms:%f\n", calculateDeltaTime(&now) ); +// CCLog(" ms:%f", calculateDeltaTime(&now) ); // else -// CCLog("ERROR\n"); +// CCLog("ERROR"); // cache->removeTexture(texture); // -// CCLog("--- PVR.CCZ 1024x1024 ---\n"); +// CCLog("--- PVR.CCZ 1024x1024 ---"); // CCLog("RGBA 8888"); // gettimeofday(&now, NULL); // texture = cache->addImage("Images/landscape-1024x1024-rgba8888.pvr.ccz"); // if( texture ) -// CCLog(" ms:%f\n", calculateDeltaTime(&now) ); +// CCLog(" ms:%f", calculateDeltaTime(&now) ); // else -// CCLog("ERROR\n"); +// CCLog("ERROR"); // cache->removeTexture(texture); @@ -318,17 +318,17 @@ void TextureTest::performTests() // // most platform don't support texture with width/height is 2048 -// CCLog("\n\n--- PNG 2048x2048 ---\n"); +// CCLog("--- PNG 2048x2048 ---"); // performTestsPNG("Images/texture2048x2048.png"); -// CCLog("--- PVR 2048x2048 ---\n"); +// CCLog("--- PVR 2048x2048 ---"); // CCLog("RGBA 4444"); // gettimeofday(&now, NULL); // texture = cache->addImage("Images/texture2048x2048_rgba4444.pvr"); // if( texture ) -// CCLog(" ms:%f\n", calculateDeltaTime(&now) ); +// CCLog(" ms:%f", calculateDeltaTime(&now) ); // else -// CCLog("ERROR\n"); +// CCLog("ERROR"); // cache->removeTexture(texture); } diff --git a/samples/Cpp/TestCpp/Classes/Texture2dTest/Texture2dTest.cpp b/samples/Cpp/TestCpp/Classes/Texture2dTest/Texture2dTest.cpp index ed2e4cbfb5..4173e5d6c7 100644 --- a/samples/Cpp/TestCpp/Classes/Texture2dTest/Texture2dTest.cpp +++ b/samples/Cpp/TestCpp/Classes/Texture2dTest/Texture2dTest.cpp @@ -1701,30 +1701,30 @@ void TextureSizeTest::onEnter() CCLog("Loading 512x512 image..."); sprite = CCSprite::create("Images/texture512x512.png"); if( sprite ) - CCLog("OK\n"); + CCLog("OK"); else - CCLog("Error\n"); + CCLog("Error"); CCLog("Loading 1024x1024 image..."); sprite = CCSprite::create("Images/texture1024x1024.png"); if( sprite ) - CCLog("OK\n"); + CCLog("OK"); else - CCLog("Error\n"); + CCLog("Error"); // @todo // CCLog("Loading 2048x2048 image..."); // sprite = CCSprite::create("Images/texture2048x2048.png"); // if( sprite ) -// CCLog("OK\n"); +// CCLog("OK"); // else -// CCLog("Error\n"); +// CCLog("Error"); // // CCLog("Loading 4096x4096 image..."); // sprite = CCSprite::create("Images/texture4096x4096.png"); // if( sprite ) -// CCLog("OK\n"); +// CCLog("OK"); // else -// CCLog("Error\n"); +// CCLog("Error"); } std::string TextureSizeTest::title()