r5sdk/r5dev/engine/sys_dll.cpp
Kawe Mazidjatari 4b72afb74f Light refactor for logging
Moved logging functions to dbg.h (tier0) and export them from the dll.
Added additional functions for checking bad pointers (debug only!).
Reduced output code size.
2022-05-25 14:18:29 +02:00

29 lines
867 B
C++

#include "core/stdafx.h"
#include "engine/sys_dll.h"
//-----------------------------------------------------------------------------
// Sys_Error_Internal
//
//-----------------------------------------------------------------------------
int HSys_Error_Internal(char* fmt, va_list args)
{
char buffer[2048]{};
Error(eDLL_T::NONE, "_______________________________________________________________\n");
Error(eDLL_T::NONE, "] ENGINE ERROR ################################################\n");
vsprintf(buffer, fmt, args);
Error(eDLL_T::NONE, "%s\n", buffer);
///////////////////////////////////////////////////////////////////////////
return Sys_Error_Internal(fmt, args);
}
void SysDll_Attach()
{
DetourAttach((LPVOID*)&Sys_Error_Internal, &HSys_Error_Internal);
}
void SysDll_Detach()
{
DetourDetach((LPVOID*)&Sys_Error_Internal, &HSys_Error_Internal);
}