r5sdk/r5dev/vgui/vgui_baseui_interface.cpp
Kawe Mazidjatari fcf3a09418 Make singletons use static memory
Avoid heap memory allocation and a level of indirection. This allows the compiler to optimize the program even more. No logic has been changed in this patch.
2024-04-05 17:52:57 +02:00

36 lines
1.2 KiB
C++

//===========================================================================//
//
// Purpose: Implements all the functions exported by the GameUI dll.
//
// $NoKeywords: $
//===========================================================================//
#include <core/stdafx.h>
#include <tier1/cvar.h>
#include <engine/sys_utils.h>
#include <vgui/vgui_debugpanel.h>
#include <vgui/vgui_baseui_interface.h>
#include <vguimatsurface/MatSystemSurface.h>
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
int CEngineVGui::Paint(CEngineVGui* thisptr, PaintMode_t mode)
{
int result = CEngineVGui__Paint(thisptr, mode);
if (/*mode == PaintMode_t::PAINT_UIPANELS ||*/ mode == PaintMode_t::PAINT_INGAMEPANELS) // Render in-main menu and in-game.
{
g_TextOverlay.Update();
}
return result;
}
///////////////////////////////////////////////////////////////////////////////
void VEngineVGui::Detour(const bool bAttach) const
{
DetourSetup(&CEngineVGui__Paint, &CEngineVGui::Paint, bAttach);
}
///////////////////////////////////////////////////////////////////////////////