2022-02-19 02:31:16 +01:00
|
|
|
#pragma once
|
|
|
|
#include "core/stdafx.h"
|
|
|
|
#include "mathlib/color.h"
|
|
|
|
|
2022-10-30 10:08:14 +01:00
|
|
|
struct CTextNotify
|
2022-02-19 02:31:16 +01:00
|
|
|
{
|
2023-08-07 22:10:06 +02:00
|
|
|
CTextNotify(const eDLL_T type, const float flTime, const char* pszText)
|
2022-02-19 02:31:16 +01:00
|
|
|
{
|
2023-08-07 22:10:06 +02:00
|
|
|
this->m_Text = pszText;
|
|
|
|
this->m_flLifeRemaining = flTime;
|
|
|
|
this->m_Type = type;
|
2022-02-19 02:31:16 +01:00
|
|
|
}
|
2023-08-07 22:10:06 +02:00
|
|
|
eDLL_T m_Type;
|
|
|
|
float m_flLifeRemaining;
|
|
|
|
CUtlString m_Text;
|
2022-02-19 02:31:16 +01:00
|
|
|
};
|
|
|
|
|
2022-10-26 01:55:36 +02:00
|
|
|
class CTextOverlay
|
2022-02-19 02:31:16 +01:00
|
|
|
{
|
|
|
|
public:
|
2022-10-26 01:55:36 +02:00
|
|
|
CTextOverlay()
|
2022-08-09 15:19:12 +02:00
|
|
|
{
|
|
|
|
m_nFontHeight = 16;
|
2023-02-19 09:51:46 +01:00
|
|
|
m_nCon_NPrintf_Idx = 0;
|
|
|
|
memset(m_szCon_NPrintf_Buf, '\0', sizeof(m_szCon_NPrintf_Buf));
|
2022-08-09 15:19:12 +02:00
|
|
|
}
|
|
|
|
|
2022-02-19 02:31:16 +01:00
|
|
|
void Update(void);
|
2023-08-07 22:10:06 +02:00
|
|
|
void AddLog(const eDLL_T context, const char* pszText);
|
2022-10-26 01:55:36 +02:00
|
|
|
void DrawNotify(void);
|
|
|
|
void DrawFormat(const int x, const int y, const Color c, const char* pszFormat, ...) const;
|
2022-09-11 23:48:11 +02:00
|
|
|
void ShouldDraw(const float flFrameTime);
|
2022-02-19 02:31:16 +01:00
|
|
|
void DrawSimStats(void) const;
|
|
|
|
void DrawGPUStats(void) const;
|
2022-07-01 22:33:48 +01:00
|
|
|
void DrawCrosshairMaterial(void) const;
|
2022-07-20 22:50:55 +01:00
|
|
|
void DrawStreamOverlay(void) const;
|
2022-02-19 02:31:16 +01:00
|
|
|
|
2023-02-19 09:51:46 +01:00
|
|
|
void Con_NPrintf(void);
|
|
|
|
|
2022-02-19 02:31:16 +01:00
|
|
|
private:
|
2023-03-26 16:09:05 +02:00
|
|
|
Color GetLogColorForType(const eDLL_T type) const;
|
2023-08-07 22:10:06 +02:00
|
|
|
CUtlVector<CTextNotify> m_NotifyLines;
|
2022-09-11 23:48:11 +02:00
|
|
|
int m_nFontHeight; // Hardcoded to 16 in this engine.
|
|
|
|
|
2023-08-07 22:10:06 +02:00
|
|
|
mutable CThreadFastMutex m_Mutex;
|
2022-02-28 01:01:40 +01:00
|
|
|
|
|
|
|
public:
|
2023-02-19 09:51:46 +01:00
|
|
|
int m_nCon_NPrintf_Idx;
|
|
|
|
char m_szCon_NPrintf_Buf[4096];
|
2022-02-19 02:31:16 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
2024-01-21 21:29:23 +01:00
|
|
|
extern CTextOverlay g_TextOverlay;
|