r5sdk/r5dev/vgui/vgui_baseui_interface.cpp
Kawe Mazidjatari 9c440e1e68 Overlay log system cleanup
* Use single static buffer instead of each overlay having its own (its only used in the material system thread).
* Improved readability by using ternary operators and c++ style casts.
2022-10-26 01:55:36 +02:00

43 lines
1.3 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.
{
CEngineVGui_RenderStart(g_pMatSystemSurfaceReference);
g_pOverlay->Update();
CEngineVGui_RenderEnd();
}
return result;
}
///////////////////////////////////////////////////////////////////////////////
void CEngineVGui_Attach()
{
DetourAttach((LPVOID*)&CEngineVGui_Paint, &CEngineVGui::Paint);
}
void CEngineVGui_Detach()
{
DetourDetach((LPVOID*)&CEngineVGui_Paint, &CEngineVGui::Paint);
}
///////////////////////////////////////////////////////////////////////////////