r5sdk/r5dev/vphysics/QHull.cpp
Kawe Mazidjatari 144d5f62e1 IDetour: code refactor
Utilize the new IDetour::DetourSetup() code, IDetour::Attach and IDetour::Detach have been removed in favor of this (significantly reduces chance of user error). Since the template check happens in the idetour header, it is much more aggressive on type mismatches, such as a difference in parameter types, between the function and detour, will now raise a compile time error. As a result, some type mismatches have been fixed in this commit as well.
2024-04-05 16:41:09 +02:00

26 lines
725 B
C++

#include "core/stdafx.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::COMMON, "message", fmt, args);
va_end(args);
return NULL;
}
///////////////////////////////////////////////////////////////////////////////
void VQHull::Detour(const bool bAttach) const
{
DetourSetup(&v_QHull_PrintFunc, &QHull_PrintFunc, bAttach);
}