37 lines
1 KiB
C++
37 lines
1 KiB
C++
|
|
#include "Precompiled.h"
|
|
#include "RakiEngine/System/RakiThread.h"
|
|
#include <libdbg.h>
|
|
|
|
namespace raki
|
|
{
|
|
void Debug::output(const char * _text, ...)
|
|
{
|
|
char formattedText[0x200];
|
|
va_list args;
|
|
va_start(args, _text);
|
|
vsprintf_s(formattedText, 0x200, _text, args);
|
|
va_end(args);
|
|
|
|
char formattedTextWithTime[0x200];
|
|
#if defined ( RAKI_DEBUG_SIMPLE_OUTPUT_WITHOUT_TIME )
|
|
sprintf_s(formattedTextWithTime, 0x200, "%s\n", formattedText);
|
|
#else
|
|
sprintf_s(formattedTextWithTime, 0x200, "(%.3f) (thread 0x%lx) %s\n", Time::getTime(), reinterpret_cast<uintptr_t>(scePthreadSelf()), formattedText);
|
|
#endif
|
|
printf("%s", formattedTextWithTime);
|
|
}
|
|
|
|
void Debug::debugBreak(const char * _path, const int _line)
|
|
{
|
|
output("RAKI ASSERT in %s (%d)", _path, _line);
|
|
SCE_BREAK();
|
|
}
|
|
|
|
void Debug::debugBreakWithMessage(const char * _path, const int _line, const char* _errMsg)
|
|
{
|
|
output("RAKI ASSERT <%s> in %s (%d)", _errMsg, _path, _line);
|
|
SCE_BREAK();
|
|
}
|
|
}
|
|
|