r5sdk/r5dev/vphysics/QHull.cpp
Kawe Mazidjatari 793fcd62f2 End of logger refactor
Changed all loggers to use the internal 'CoreMsg/CoreMsgV' functions. Significantly reduced duplicate code and CPU time. Code is also much more robust.

* Code now only acquires mutex lock when the actual logging part takes place.
* Code now only checks and strip ANSI rows if its enabled to begin with.
* Code now supports setting log levels, which ultimately could be tweaked with a cvar.
* Changed logger and file names to be more readable.

TODO:
* The RCON protocol has to be modified to accommodate these changes.
2023-03-26 16:09:05 +02:00

31 lines
825 B
C++

#include "core/stdafx.h"
#include "core/logdef.h"
#include "vphysics/QHull.h"
#ifndef DEDICATED
#include "gameui/IConsole.h"
#endif // !DEDICATED
//-----------------------------------------------------------------------------
// Purpose: qhull error and debug prints
//-----------------------------------------------------------------------------
int QHull_PrintFunc(const char* fmt, ...)
{
va_list args;
va_start(args, fmt);
CoreMsgV(LogType_t::LOG_INFO, LogLevel_t::LEVEL_NOTIFY, eDLL_T::NONE, "message", fmt, args);
va_end(args);
return NULL;
}
///////////////////////////////////////////////////////////////////////////////
void VQHull::Attach() const
{
DetourAttach((LPVOID*)&v_QHull_PrintFunc, &QHull_PrintFunc);
}
void VQHull::Detach() const
{
DetourDetach((LPVOID*)&v_QHull_PrintFunc, &QHull_PrintFunc);
}