2015-04-16 16:55:32 +00:00
|
|
|
/*
|
|
|
|
GWEN
|
|
|
|
Copyright (c) 2010 Facepunch Studios
|
|
|
|
See license in Gwen.h
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "Gwen/Gwen.h"
|
|
|
|
|
|
|
|
namespace Gwen
|
|
|
|
{
|
2018-09-23 21:17:31 +00:00
|
|
|
// Globals
|
|
|
|
GWEN_EXPORT Controls::Base* HoveredControl = NULL;
|
|
|
|
GWEN_EXPORT Controls::Base* KeyboardFocus = NULL;
|
|
|
|
GWEN_EXPORT Controls::Base* MouseFocus = NULL;
|
2015-04-16 16:55:32 +00:00
|
|
|
|
2018-09-23 21:17:31 +00:00
|
|
|
namespace Debug
|
|
|
|
{
|
|
|
|
void Msg(const char* str, ...)
|
|
|
|
{
|
|
|
|
char strOut[1024];
|
|
|
|
va_list s;
|
|
|
|
va_start(s, str);
|
|
|
|
GwenUtil_VSNPrintFSafe(strOut, sizeof(strOut), _TRUNCATE, str, s);
|
|
|
|
va_end(s);
|
|
|
|
GwenUtil_OutputDebugCharString(strOut);
|
|
|
|
}
|
2015-04-16 16:55:32 +00:00
|
|
|
#ifdef UNICODE
|
2018-09-23 21:17:31 +00:00
|
|
|
void Msg(const wchar_t* str, ...)
|
|
|
|
{
|
|
|
|
wchar_t strOut[1024];
|
|
|
|
va_list s;
|
|
|
|
va_start(s, str);
|
|
|
|
GwenUtil_VSWPrintFSafeSized(strOut, str, s);
|
|
|
|
va_end(s);
|
|
|
|
GwenUtil_OutputDebugWideString(strOut);
|
|
|
|
}
|
2015-04-16 16:55:32 +00:00
|
|
|
#endif
|
2018-09-23 21:17:31 +00:00
|
|
|
void AssertCheck(bool b, const char* strMsg)
|
|
|
|
{
|
|
|
|
if (b) return;
|
2015-04-16 16:55:32 +00:00
|
|
|
#ifdef WINDOWS
|
2018-09-23 21:17:31 +00:00
|
|
|
MessageBoxA(NULL, strMsg, "Assert", MB_ICONEXCLAMATION | MB_OK);
|
|
|
|
_asm { int 3 }
|
|
|
|
#else
|
|
|
|
(void)strMsg; // unused param
|
2015-04-16 16:55:32 +00:00
|
|
|
#endif
|
|
|
|
}
|
2018-09-23 21:17:31 +00:00
|
|
|
} // namespace Debug
|
|
|
|
|
|
|
|
} // namespace Gwen
|