diff --git a/CHANGELOG b/CHANGELOG index 68acb827a9..4e7311b166 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -2,6 +2,7 @@ cocos2d-x-3.0final ?.? ? [All] [NEW] Console: added the 'textures', 'fileutils dump' and 'config' commands [NEW] DrawNode supports to draw triangle, quad bezier, cubic bezier. + [FIX] Console: log(format, va_args) is private to prevent possible resolution errors [FIX] Configuration: dumpInfo() -> getInfo() [FIX] ControlSlider doesn't support to set selected thumb sprite. [FIX] ControlButton doesn't support to set scale ratio of touchdown state. diff --git a/cocos/base/CCConsole.cpp b/cocos/base/CCConsole.cpp index 002fb6e071..19f7d54048 100644 --- a/cocos/base/CCConsole.cpp +++ b/cocos/base/CCConsole.cpp @@ -144,24 +144,7 @@ static const char* inet_ntop(int af, const void* src, char* dst, int cnt) // Free functions to log // -// XXX: Deprecated -void CCLog(const char * format, ...) -{ - va_list args; - va_start(args, format); - log(format, args); - va_end(args); -} - -void log(const char * format, ...) -{ - va_list args; - va_start(args, format); - log(format, args); - va_end(args); -} - -void log(const char *format, va_list args) +static void _log(const char *format, va_list args) { char buf[MAX_LOG_LENGTH]; @@ -176,7 +159,7 @@ void log(const char *format, va_list args) MultiByteToWideChar(CP_UTF8, 0, buf, -1, wszBuf, sizeof(wszBuf)); OutputDebugStringW(wszBuf); OutputDebugStringA("\n"); - + WideCharToMultiByte(CP_ACP, 0, wszBuf, sizeof(wszBuf), buf, sizeof(buf), NULL, FALSE); printf("%s\n", buf); @@ -189,6 +172,22 @@ void log(const char *format, va_list args) Director::getInstance()->getConsole()->log(buf); } +// XXX: Deprecated +void CCLog(const char * format, ...) +{ + va_list args; + va_start(args, format); + _log(format, args); + va_end(args); +} + +void log(const char * format, ...) +{ + va_list args; + va_start(args, format); + _log(format, args); + va_end(args); +} // // Console code diff --git a/cocos/base/CCConsole.h b/cocos/base/CCConsole.h index 1218bf8066..7a06d3423f 100644 --- a/cocos/base/CCConsole.h +++ b/cocos/base/CCConsole.h @@ -58,7 +58,6 @@ static const int MAX_LOG_LENGTH = 16*1024; @brief Output Debug message. */ void CC_DLL log(const char * format, ...) CC_FORMAT_PRINTF(1, 2); -void CC_DLL log(const char * format, va_list args); /** Console is helper class that lets the developer control the game from TCP connection. Console will spawn a new thread that will listen to a specified TCP port. diff --git a/samples/Cpp/TestCpp/Classes/controller.cpp b/samples/Cpp/TestCpp/Classes/controller.cpp index 750ba02a9f..b9713167a1 100644 --- a/samples/Cpp/TestCpp/Classes/controller.cpp +++ b/samples/Cpp/TestCpp/Classes/controller.cpp @@ -151,7 +151,6 @@ TestController::~TestController() void TestController::menuCallback(Object * sender) { - Director::getInstance()->purgeCachedData(); // get the userdata, it's the index of the menu item clicked