mirror of https://github.com/axmolengine/axmol.git
Merge pull request #5073 from ricardoquesada/console_log_fixes
Console::log(format, va_args) is private
This commit is contained in:
commit
567630fa47
|
@ -2,6 +2,7 @@ cocos2d-x-3.0final ?.? ?
|
||||||
[All]
|
[All]
|
||||||
[NEW] Console: added the 'textures', 'fileutils dump' and 'config' commands
|
[NEW] Console: added the 'textures', 'fileutils dump' and 'config' commands
|
||||||
[NEW] DrawNode supports to draw triangle, quad bezier, cubic bezier.
|
[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] Configuration: dumpInfo() -> getInfo()
|
||||||
[FIX] ControlSlider doesn't support to set selected thumb sprite.
|
[FIX] ControlSlider doesn't support to set selected thumb sprite.
|
||||||
[FIX] ControlButton doesn't support to set scale ratio of touchdown state.
|
[FIX] ControlButton doesn't support to set scale ratio of touchdown state.
|
||||||
|
|
|
@ -144,24 +144,7 @@ static const char* inet_ntop(int af, const void* src, char* dst, int cnt)
|
||||||
// Free functions to log
|
// Free functions to log
|
||||||
//
|
//
|
||||||
|
|
||||||
// XXX: Deprecated
|
static void _log(const char *format, va_list args)
|
||||||
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)
|
|
||||||
{
|
{
|
||||||
char buf[MAX_LOG_LENGTH];
|
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));
|
MultiByteToWideChar(CP_UTF8, 0, buf, -1, wszBuf, sizeof(wszBuf));
|
||||||
OutputDebugStringW(wszBuf);
|
OutputDebugStringW(wszBuf);
|
||||||
OutputDebugStringA("\n");
|
OutputDebugStringA("\n");
|
||||||
|
|
||||||
WideCharToMultiByte(CP_ACP, 0, wszBuf, sizeof(wszBuf), buf, sizeof(buf), NULL, FALSE);
|
WideCharToMultiByte(CP_ACP, 0, wszBuf, sizeof(wszBuf), buf, sizeof(buf), NULL, FALSE);
|
||||||
printf("%s\n", buf);
|
printf("%s\n", buf);
|
||||||
|
|
||||||
|
@ -189,6 +172,22 @@ void log(const char *format, va_list args)
|
||||||
Director::getInstance()->getConsole()->log(buf);
|
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
|
// Console code
|
||||||
|
|
|
@ -58,7 +58,6 @@ static const int MAX_LOG_LENGTH = 16*1024;
|
||||||
@brief Output Debug message.
|
@brief Output Debug message.
|
||||||
*/
|
*/
|
||||||
void CC_DLL log(const char * format, ...) CC_FORMAT_PRINTF(1, 2);
|
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 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.
|
Console will spawn a new thread that will listen to a specified TCP port.
|
||||||
|
|
|
@ -151,7 +151,6 @@ TestController::~TestController()
|
||||||
|
|
||||||
void TestController::menuCallback(Object * sender)
|
void TestController::menuCallback(Object * sender)
|
||||||
{
|
{
|
||||||
|
|
||||||
Director::getInstance()->purgeCachedData();
|
Director::getInstance()->purgeCachedData();
|
||||||
|
|
||||||
// get the userdata, it's the index of the menu item clicked
|
// get the userdata, it's the index of the menu item clicked
|
||||||
|
|
Loading…
Reference in New Issue