r5sdk/r5dev/rtech/rui/rui.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

30 lines
776 B
C++

//=============================================================================//
//
// Purpose: rUI Utilities
//
//=============================================================================//
#include "core/stdafx.h"
#ifndef DEDICATED
#include "rui.h"
#include "tier1/cvar.h"
//-----------------------------------------------------------------------------
// Purpose: draw RUI frame
//-----------------------------------------------------------------------------
bool __fastcall Rui_Draw(__int64* a1, __m128* a2, const __m128i* a3, __int64 a4, __m128* a5)
{
if (!rui_drawEnable->GetBool())
return false;
return v_Rui_Draw(a1, a2, a3, a4, a5);
}
void V_Rui::Detour(const bool bAttach) const
{
DetourSetup(&v_Rui_Draw, &Rui_Draw, bAttach);
}
#endif // !DEDICATED