mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Draw simulation stats and GPU stats to debug text overlay
This commit is contained in:
parent
21a10e201b
commit
0177c17da9
@ -36,9 +36,9 @@ void DevMsg(eDLL_T idx, const char* fmt, ...)
|
||||
|
||||
static std::string vmType[7] = { "Native(S):", "Native(C):", "Native(U):", "Native(E):", "Native(F):", "Native(R):", "Native(M):" };
|
||||
|
||||
static auto iconsole = spdlog::stdout_logger_mt("sys_print_iconsole"); // in-game console.
|
||||
static auto wconsole = spdlog::stdout_logger_mt("sys_print_wconsole"); // windows console.
|
||||
static auto sqlogger = spdlog::basic_logger_mt("sys_print_logger", "platform\\logs\\sys_print.log"); // file logger.
|
||||
static auto iconsole = spdlog::stdout_logger_mt("dev_message_iconsole"); // in-game console.
|
||||
static auto wconsole = spdlog::stdout_logger_mt("dev_message_wconsole"); // windows console.
|
||||
static auto sqlogger = spdlog::basic_logger_mt("dev_message_logger", "platform\\logs\\dev_message.log"); // file logger.
|
||||
|
||||
std::string vmStr = vmType[vmIdx].c_str();
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
#pragma once
|
||||
#include "engine/debugoverlay.h"
|
||||
|
||||
namespace
|
||||
{
|
||||
@ -9,7 +10,15 @@ namespace
|
||||
ADDRESS InitMaterialSystem = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x48\x83\xEC\x28\x48\x8B\x0D\x00\x00\x00\x00\x48\x8D\x15\x00\x00\x00\x00\x48\x8B\x01\xFF\x90\x00\x00\x00\x00\x48\x8B\x0D\x00\x00\x00\x00\x48\x8D\x15\x00\x00\x00\x00\x48\x8B\x01\xFF\x90\x00\x00\x00\x00", "xxxxxxx????xxx????xxxxx????xxx????xxx????xxxxx????"); //
|
||||
// 0x14024B390 // 48 83 EC 28 48 8B 0D ? ? ? ? 48 8D 15 ? ? ? ? 48 8B 01 FF 90 ? ? ? ? 48 8B 0D ? ? ? ? 48 8D 15 ? ? ? ? 48 8B 01 FF 90 ? ? ? ? //
|
||||
|
||||
ADDRESS p_DrawStreamOverlay = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x41\x56\xB8\x00\x00\x00\x00\xE8\x00\x00\x00\x00\x48\x2B\xE0\xC6\x02\x00", "xxx????x????xxxxxx"); // 41 56 B8 ? ? ? ? E8 ? ? ? ? 48 2B E0 C6 02 00 //
|
||||
const char* (*DrawStreamOverlay)(void* thisptr, std::uint8_t* a2, void* unused, void* a4) = (const char* (*)(void*, std::uint8_t*, void*, void*))p_DrawStreamOverlay.GetPtr();
|
||||
|
||||
void* g_pMaterialSystem = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x48\x8B\x0D\x00\x00\x00\x00\x48\x85\xC9\x74\x11\x48\x8B\x01\x48\x8D\x15\x00\x00\x00\x00", "xxx????xxxxxxxxxxx????").ResolveRelativeAddressSelf(0x3, 0x7).RCast<void*>();
|
||||
|
||||
int* total_streaming_tex_memory = p_DrawStreamOverlay.Offset(0x0).FindPatternSelf("48 8B 05", ADDRESS::Direction::DOWN).ResolveRelativeAddressSelf(0x3, 0x7).RCast<int*>();
|
||||
int* unfree_streaming_tex_memory = p_DrawStreamOverlay.Offset(0x20).FindPatternSelf("48 8B 05", ADDRESS::Direction::DOWN).ResolveRelativeAddressSelf(0x3, 0x7).RCast<int*>();
|
||||
int* unusable_streaming_tex_memory = p_DrawStreamOverlay.Offset(0x50).FindPatternSelf("48 8B 05", ADDRESS::Direction::DOWN).ResolveRelativeAddressSelf(0x3, 0x7).RCast<int*>();
|
||||
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
@ -19,6 +28,7 @@ class HMaterialSystem : public IDetour
|
||||
{
|
||||
std::cout << "| FUN: CMaterialSystem::Init : 0x" << std::hex << std::uppercase << CMaterialSystem__Init.GetPtr() << std::setw(npad) << " |" << std::endl;
|
||||
std::cout << "| FUN: InitMaterialSystem : 0x" << std::hex << std::uppercase << InitMaterialSystem.GetPtr() << std::setw(npad) << " |" << std::endl;
|
||||
std::cout << "| FUN: DrawStreamOverlay : 0x" << std::hex << std::uppercase << p_DrawStreamOverlay.GetPtr() << std::setw(npad) << " |" << std::endl;
|
||||
std::cout << "| VAR: g_pMaterialSystem : 0x" << std::hex << std::uppercase << g_pMaterialSystem << std::setw(0) << " |" << std::endl;
|
||||
std::cout << "+----------------------------------------------------------------+" << std::endl;
|
||||
}
|
||||
|
@ -10,6 +10,5 @@ public:
|
||||
_color[2] = (unsigned char)b;
|
||||
_color[3] = (unsigned char)a;
|
||||
}
|
||||
private:
|
||||
unsigned char _color[4];
|
||||
};
|
||||
|
@ -16,6 +16,8 @@ struct user_creds
|
||||
namespace
|
||||
{
|
||||
/* ==== CSERVER ========================================================================================================================================================= */
|
||||
ADDRESS p_CServer_Think = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x48\x89\x5C\x24\x00\x48\x89\x74\x24\x00\x57\x48\x81\xEC\x00\x00\x00\x00\x80\x3D\x00\x00\x00\x00\x00", "xxxx?xxxx?xxxx????xx?????");
|
||||
void (*CServer_Think)(bool check_clock_drift, bool bIsSimulating) = (void (*)(bool, bool))p_CServer_Think.GetPtr(); /*48 89 5C 24 ? 48 89 74 24 ? 57 48 81 EC ? ? ? ? 80 3D ? ? ? ? ?*/
|
||||
#if defined (GAMEDLL_S0) || defined (GAMEDLL_S1)
|
||||
ADDRESS p_CServer_Authenticate = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x44\x89\x44\x24\x00\x55\x56\x57\x48\x8D\xAC\x24\x00\x00\x00\x00", "xxxx?xxxxxxx????");
|
||||
void* (*CServer_Authenticate)(void* cserver, user_creds* creds) = (void* (*)(void* cserver, user_creds * creds))p_CServer_Authenticate.GetPtr(); /*44 89 44 24 ?? 55 56 57 48 8D AC 24 ?? ?? ?? ??*/
|
||||
@ -28,6 +30,8 @@ namespace
|
||||
#endif
|
||||
ADDRESS p_CServer_RejectConnection = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x4C\x89\x4C\x24\x00\x53\x55\x56\x57\x48\x81\xEC\x00\x00\x00\x00\x49\x8B\xD9", "xxxx?xxxxxxx????xxx");
|
||||
void* (*CServer_RejectConnection)(void* pServer, unsigned int a2, user_creds* pCreds, const char* szMessage) = (void* (*)(void*, unsigned int, user_creds*, const char*))p_CServer_RejectConnection.GetPtr(); /*4C 89 4C 24 ?? 53 55 56 57 48 81 EC ?? ?? ?? ?? 49 8B D9*/
|
||||
|
||||
int* sv_m_nTickCount = p_CServer_Think.Offset(0xB0).FindPatternSelf("8B 15", ADDRESS::Direction::DOWN).ResolveRelativeAddressSelf(0x2, 0x6).RCast<int*>();
|
||||
}
|
||||
|
||||
void CServer_Attach();
|
||||
@ -43,8 +47,10 @@ class HServer : public IDetour
|
||||
{
|
||||
virtual void debugp()
|
||||
{
|
||||
std::cout << "| FUN: CServer::Think : 0x" << std::hex << std::uppercase << p_CServer_Think.GetPtr() << std::setw(npad) << " |" << std::endl;
|
||||
std::cout << "| FUN: CServer::Authenticate : 0x" << std::hex << std::uppercase << p_CServer_Authenticate.GetPtr() << std::setw(npad) << " |" << std::endl;
|
||||
std::cout << "| FUN: CServer::RejectConnection : 0x" << std::hex << std::uppercase << p_CServer_RejectConnection.GetPtr() << std::setw(npad) << " |" << std::endl;
|
||||
std::cout << "| VAR: sv_m_nTickCount : 0x" << std::hex << std::uppercase << sv_m_nTickCount << std::setw(0) << " |" << std::endl;
|
||||
std::cout << "+----------------------------------------------------------------+" << std::endl;
|
||||
}
|
||||
};
|
||||
|
@ -11,64 +11,39 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
bool HIConVar_IsFlagSet(ConVar* pConVar, int nFlags)
|
||||
{
|
||||
if (cm_debug_cmdquery->m_pParent->m_iValue > 0)
|
||||
{
|
||||
printf("--------------------------------------------------\n");
|
||||
printf(" Flaged: %08X\n", pConVar->m_ConCommandBase.m_nFlags);
|
||||
}
|
||||
if (cm_return_false_cmdquery_cheats->m_pParent->m_iValue > 0)
|
||||
{
|
||||
if (cm_debug_cmdquery->m_pParent->m_iValue > 0)
|
||||
{
|
||||
printf("--------------------------------------------------\n");
|
||||
printf(" Flaged: %08X\n", pConVar->m_ConCommandBase.m_nFlags);
|
||||
}
|
||||
// Mask off FCVAR_CHEATS and FCVAR_DEVELOPMENTONLY.
|
||||
pConVar->m_ConCommandBase.RemoveFlags(FCVAR_DEVELOPMENTONLY | FCVAR_CHEAT);
|
||||
if (cm_debug_cmdquery->m_pParent->m_iValue > 0)
|
||||
{
|
||||
printf(" Masked: %08X\n", pConVar->m_ConCommandBase.m_nFlags);
|
||||
printf(" Verify: %08X\n", nFlags);
|
||||
printf("--------------------------------------------------\n");
|
||||
}
|
||||
if (nFlags & FCVAR_RELEASE && cm_return_false_cmdquery_all->m_pParent->m_iValue <= 0)
|
||||
{
|
||||
// Default retail behaviour.
|
||||
return IConVar_IsFlagSet(pConVar, nFlags);
|
||||
}
|
||||
if (cm_return_false_cmdquery_all->m_pParent->m_iValue > 0)
|
||||
{
|
||||
// Returning false on all queries may cause problems.
|
||||
return false;
|
||||
}
|
||||
// Return false on every FCVAR_DEVELOPMENTONLY | FCVAR_CHEAT query.
|
||||
return pConVar->m_ConCommandBase.HasFlags(nFlags) != 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (cm_debug_cmdquery->m_pParent->m_iValue > 0)
|
||||
{
|
||||
printf("--------------------------------------------------\n");
|
||||
printf(" Flaged: %08X\n", pConVar->m_ConCommandBase.m_nFlags);
|
||||
}
|
||||
// Mask off FCVAR_DEVELOPMENTONLY.
|
||||
pConVar->m_ConCommandBase.RemoveFlags(FCVAR_DEVELOPMENTONLY);
|
||||
if (cm_debug_cmdquery->m_pParent->m_iValue > 0)
|
||||
{
|
||||
printf(" Masked: %08X\n", pConVar->m_ConCommandBase.m_nFlags);
|
||||
printf(" Verify: %08X\n", nFlags);
|
||||
printf("--------------------------------------------------\n");
|
||||
}
|
||||
if (nFlags & FCVAR_RELEASE && cm_return_false_cmdquery_all->m_pParent->m_iValue <= 0)
|
||||
{
|
||||
// Default retail behaviour.
|
||||
return IConVar_IsFlagSet(pConVar, nFlags);
|
||||
}
|
||||
if (cm_return_false_cmdquery_all->m_pParent->m_iValue > 0)
|
||||
{
|
||||
// Returning false on all queries may cause problems.
|
||||
return false;
|
||||
}
|
||||
// Return false on every FCVAR_DEVELOPMENTONLY query.
|
||||
return pConVar->m_ConCommandBase.HasFlags(nFlags) != 0;
|
||||
}
|
||||
// Default retail behaviour.
|
||||
return IConVar_IsFlagSet(pConVar, nFlags);
|
||||
if (cm_debug_cmdquery->m_pParent->m_iValue > 0)
|
||||
{
|
||||
printf(" Masked: %08X\n", pConVar->m_ConCommandBase.m_nFlags);
|
||||
printf(" Verify: %08X\n", nFlags);
|
||||
printf("--------------------------------------------------\n");
|
||||
}
|
||||
if (nFlags & FCVAR_RELEASE && cm_return_false_cmdquery_all->m_pParent->m_iValue <= 0)
|
||||
{
|
||||
// Default retail behaviour.
|
||||
return IConVar_IsFlagSet(pConVar, nFlags);
|
||||
}
|
||||
if (cm_return_false_cmdquery_all->m_pParent->m_iValue > 0)
|
||||
{
|
||||
// Returning false on all queries may cause problems.
|
||||
return false;
|
||||
}
|
||||
// Return false on every FCVAR_DEVELOPMENTONLY query.
|
||||
return pConVar->m_ConCommandBase.HasFlags(nFlags) != 0;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@ -110,6 +85,14 @@ void IConVar_InitConVar()
|
||||
cl_consoleoverlay_lines = IConVar_RegisterConVar("cl_consoleoverlay_lines", "3", FCVAR_RELEASE, "Number of lines of console output to draw.", false, 0.f, false, 0.f, nullptr, nullptr);
|
||||
cl_consoleoverlay_offset_x = IConVar_RegisterConVar("cl_consoleoverlay_offset_x", "10", FCVAR_RELEASE, "X offset for console overlay.", false, 1.f, false, 50.f, nullptr, nullptr);
|
||||
cl_consoleoverlay_offset_y = IConVar_RegisterConVar("cl_consoleoverlay_offset_y", "10", FCVAR_RELEASE, "Y offset for console overlay.", false, 1.f, false, 50.f, nullptr, nullptr);
|
||||
|
||||
cl_showsimstats = IConVar_RegisterConVar("cl_showsimstats", "1", FCVAR_RELEASE, "Shows the tick counter for the server/client simulation and the render frame.", false, 0.f, false, 0.f, nullptr, nullptr);
|
||||
cl_simstats_offset_x = IConVar_RegisterConVar("cl_simstats_offset_x", "1250", FCVAR_RELEASE, "X offset for simulation debug overlay.", false, 0.f, false, 0.f, nullptr, nullptr);
|
||||
cl_simstats_offset_y = IConVar_RegisterConVar("cl_simstats_offset_y", "885", FCVAR_RELEASE, "Y offset for simulation debug overlay.", false, 0.f, false, 0.f, nullptr, nullptr);
|
||||
|
||||
cl_showgpustats = IConVar_RegisterConVar("cl_showgpustats", "1", FCVAR_RELEASE, "Texture streaming debug overlay.", false, 0.f, false, 0.f, nullptr, nullptr);
|
||||
cl_gpustats_offset_x = IConVar_RegisterConVar("cl_gpustats_offset_x", "1250", FCVAR_RELEASE, "X offset for texture streaming debug overlay.", false, 0.f, false, 0.f, nullptr, nullptr);
|
||||
cl_gpustats_offset_y = IConVar_RegisterConVar("cl_gpustats_offset_y", "900", FCVAR_RELEASE, "Y offset for texture streaming debug overlay.", false, 0.f, false, 0.f, nullptr, nullptr);
|
||||
//-------------------------------------------------------------------------
|
||||
// FILESYSTEM |
|
||||
fs_warning_level_native = IConVar_RegisterConVar("fs_warning_level_native", "0", FCVAR_DEVELOPMENTONLY | FCVAR_CHEAT, "Set the filesystem warning level ( !slower! ).", false, 0.f, false, 0.f, nullptr, nullptr);
|
||||
|
@ -19,6 +19,14 @@ ConVar* cl_drawconsoleoverlay = new ConVar();
|
||||
ConVar* cl_consoleoverlay_lines = new ConVar();
|
||||
ConVar* cl_consoleoverlay_offset_x = new ConVar();
|
||||
ConVar* cl_consoleoverlay_offset_y = new ConVar();
|
||||
|
||||
ConVar* cl_showsimstats = new ConVar();
|
||||
ConVar* cl_simstats_offset_x = new ConVar();
|
||||
ConVar* cl_simstats_offset_y = new ConVar();
|
||||
|
||||
ConVar* cl_showgpustats = new ConVar();
|
||||
ConVar* cl_gpustats_offset_x = new ConVar();
|
||||
ConVar* cl_gpustats_offset_y = new ConVar();
|
||||
//-------------------------------------------------------------------------
|
||||
// FILESYSTEM |
|
||||
ConVar* fs_warning_level_native = new ConVar();
|
||||
|
@ -30,6 +30,14 @@ extern ConVar* cl_drawconsoleoverlay;
|
||||
extern ConVar* cl_consoleoverlay_lines;
|
||||
extern ConVar* cl_consoleoverlay_offset_x;
|
||||
extern ConVar* cl_consoleoverlay_offset_y;
|
||||
|
||||
extern ConVar* cl_showsimstats;
|
||||
extern ConVar* cl_simstats_offset_x;
|
||||
extern ConVar* cl_simstats_offset_y;
|
||||
|
||||
extern ConVar* cl_showgpustats;;
|
||||
extern ConVar* cl_gpustats_offset_x;
|
||||
extern ConVar* cl_gpustats_offset_y;
|
||||
//-------------------------------------------------------------------------
|
||||
// FILESYSTEM |
|
||||
extern ConVar* fs_warning_level_native;
|
||||
|
@ -1,7 +1,12 @@
|
||||
#include "core/stdafx.h"
|
||||
#include "tier0/cvar.h"
|
||||
#include "mathlib/color.h"
|
||||
#include "vgui/CEngineVGui.h"
|
||||
#include "vguimatsurface/MatSystemSurface.h"
|
||||
#include "materialsystem/materialsystem.h"
|
||||
#include "engine/debugoverlay.h"
|
||||
#include "engine/baseclientstate.h"
|
||||
#include "server/server.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
@ -31,21 +36,46 @@ int HCEngineVGui_Paint(void* thisptr, int mode)
|
||||
//-----------------------------------------------------------------------------
|
||||
void CLogSystem::Update()
|
||||
{
|
||||
if (cl_drawconsoleoverlay->m_pParent->m_iValue < 1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (m_vLogs.empty())
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (!g_pMatSystemSurface)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (cl_drawconsoleoverlay->m_pParent->m_iValue > 0)
|
||||
{
|
||||
DrawLog();
|
||||
}
|
||||
if (cl_showsimstats->m_pParent->m_iValue > 0)
|
||||
{
|
||||
DrawSimStats();
|
||||
}
|
||||
if (cl_showgpustats->m_pParent->m_iValue > 0)
|
||||
{
|
||||
DrawGPUStats();
|
||||
}
|
||||
}
|
||||
|
||||
static int fontHeight = 16;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
//-----------------------------------------------------------------------------
|
||||
void CLogSystem::AddLog(LogType_t type, std::string message)
|
||||
{
|
||||
if (message.length() > 0)
|
||||
{
|
||||
m_vLogs.push_back(Log{ message, 1024, type });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
//-----------------------------------------------------------------------------
|
||||
void CLogSystem::DrawLog()
|
||||
{
|
||||
if (m_vLogs.empty())
|
||||
{
|
||||
return;
|
||||
}
|
||||
for (int i = 0; i < m_vLogs.size(); ++i)
|
||||
{
|
||||
if (m_vLogs[i].Ticks >= 0)
|
||||
@ -58,8 +88,8 @@ void CLogSystem::Update()
|
||||
int y = (cl_consoleoverlay_offset_y->m_pParent->m_iValue + (fontHeight * i));
|
||||
int x = cl_consoleoverlay_offset_x->m_pParent->m_iValue;
|
||||
|
||||
std::array<int, 3> color = GetLogColorForType(m_vLogs[i].Type);
|
||||
CMatSystemSurface_DrawColoredText(g_pMatSystemSurface, 0x13, fontHeight, x, y, color[0], color[1], color[2], alpha, m_vLogs[i].Message.c_str());
|
||||
Color c = GetLogColorForType(m_vLogs[i].Type);
|
||||
CMatSystemSurface_DrawColoredText(g_pMatSystemSurface, 0x13, fontHeight, x, y, c._color[0], c._color[1], c._color[2], alpha, m_vLogs[i].Message.c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -76,31 +106,55 @@ void CLogSystem::Update()
|
||||
}
|
||||
}
|
||||
|
||||
void CLogSystem::AddLog(LogType_t type, std::string message)
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
//-----------------------------------------------------------------------------
|
||||
void CLogSystem::DrawSimStats()
|
||||
{
|
||||
if (message.length() > 0)
|
||||
{
|
||||
m_vLogs.push_back(Log{ message, 1024, type });
|
||||
}
|
||||
Color c = { 255, 255, 255, 255 };
|
||||
static const char* szLogbuf[4096]{};
|
||||
snprintf((char*)szLogbuf, 4096, "Server Frame: (%d) Client Frame (%d) Render Frame (%d)\n",
|
||||
*sv_m_nTickCount, *cl_host_tickcount, *render_tickcount);
|
||||
|
||||
CMatSystemSurface_DrawColoredText(g_pMatSystemSurface, 0x13, fontHeight, cl_simstats_offset_x->m_iValue, cl_simstats_offset_y->m_iValue, c._color[0], c._color[1], c._color[2], 255, (char*)szLogbuf);
|
||||
}
|
||||
|
||||
std::array<int, 3> CLogSystem::GetLogColorForType(LogType_t type)
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
//-----------------------------------------------------------------------------
|
||||
void CLogSystem::DrawGPUStats()
|
||||
{
|
||||
Color c = { 255, 255, 255, 255 };
|
||||
static const char* szLogbuf[4096]{};
|
||||
snprintf((char*)szLogbuf, 4096, "%8d/%8d/%8dkiB unusable/unfree/total GPU Streaming Texture memory\n",
|
||||
*unusable_streaming_tex_memory / 1024, *unfree_streaming_tex_memory / 1024, *unusable_streaming_tex_memory / 1024);
|
||||
|
||||
CMatSystemSurface_DrawColoredText(g_pMatSystemSurface, 0x13, fontHeight, cl_gpustats_offset_x->m_iValue, cl_gpustats_offset_y->m_iValue, c._color[0], c._color[1], c._color[2], 255, (char*)szLogbuf);
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
//-----------------------------------------------------------------------------
|
||||
Color CLogSystem::GetLogColorForType(LogType_t type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case LogType_t::NATIVE:
|
||||
return { 255, 255, 255 };
|
||||
return { 255, 255, 255, 255 };
|
||||
case LogType_t::SCRIPT_SERVER:
|
||||
return { 190, 183, 240 };
|
||||
return { 190, 183, 240, 255 };
|
||||
case LogType_t::SCRIPT_CLIENT:
|
||||
return { 117, 116, 139 };
|
||||
return { 117, 116, 139, 255 };
|
||||
case LogType_t::SCRIPT_UI:
|
||||
return { 197, 160, 177 };
|
||||
return { 197, 160, 177, 255 };
|
||||
default:
|
||||
return { 255, 255, 255 };
|
||||
return { 255, 255, 255, 255 };
|
||||
}
|
||||
|
||||
return { 255, 255, 255 };
|
||||
return { 255, 255, 255, 255 };
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
#include "core/stdafx.h"
|
||||
#include "tier0/basetypes.h"
|
||||
#include "mathlib/color.h"
|
||||
|
||||
enum class LogType_t : int
|
||||
{
|
||||
@ -27,12 +28,16 @@ struct Log
|
||||
class CLogSystem
|
||||
{
|
||||
public:
|
||||
void AddLog(LogType_t type, std::string text);
|
||||
void Update();
|
||||
void AddLog(LogType_t type, std::string text);
|
||||
void DrawLog();
|
||||
void DrawSimStats();
|
||||
void DrawGPUStats();
|
||||
|
||||
private:
|
||||
std::array<int, 3> GetLogColorForType(LogType_t type);
|
||||
Color GetLogColorForType(LogType_t type);
|
||||
std::vector<Log> m_vLogs{};
|
||||
int fontHeight = 16;
|
||||
};
|
||||
|
||||
namespace
|
||||
@ -43,13 +48,13 @@ namespace
|
||||
int (*CEngineVGui_Paint)(void* thisptr, int mode) = (int (*)(void*, int))p_CEngineVGui_Paint.GetPtr(); /*41 55 41 56 48 83 EC 78 44 8B EA*/
|
||||
|
||||
ADDRESS p_CEngineVGui_Unknown = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x4C\x8B\x81\x00\x00\x00\x00\x48\x8D\x05\x00\x00\x00\x00\x4C\x3B\xC0\x74\x1F", "xxx????xxx????xxxxx");
|
||||
void** (*CEngineVGui_Unknown)(std::int64_t a1) = (void** (*)(std::int64_t))p_CEngineVGui_Paint.GetPtr(); /*4C 8B 81 ?? ?? ?? ?? 48 8D 05 ?? ?? ?? ?? 4C 3B C0 74 1F*/
|
||||
void** (*CEngineVGui_Unknown)(std::int64_t a1) = (void** (*)(std::int64_t))p_CEngineVGui_Unknown.GetPtr(); /*4C 8B 81 ?? ?? ?? ?? 48 8D 05 ?? ?? ?? ?? 4C 3B C0 74 1F*/
|
||||
#elif defined (GAMEDLL_S2) || defined (GAMEDLL_S3)
|
||||
ADDRESS p_CEngineVGui_Paint = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x41\x55\x41\x56\x48\x83\xEC\x78\x44\x8B\xEA", "xxxxxxxxxxx");
|
||||
int (*CEngineVGui_Paint)(void* thisptr, int mode) = (int (*)(void*, int))p_CEngineVGui_Paint.GetPtr(); /*41 55 41 56 48 83 EC 78 44 8B EA*/
|
||||
|
||||
ADDRESS p_CEngineVGui_Unknown = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x40\x53\x48\x83\xEC\x20\x48\x8D\x05\x00\x00\x00\x00\x48\x8B\xD9\x48\x39\x81\x00\x00\x00\x00\x74\x29", "xxxxxxxxx????xxxxxx????xx");
|
||||
void** (*CEngineVGui_Unknown)(std::int64_t a1) = (void** (*)(std::int64_t))p_CEngineVGui_Paint.GetPtr(); /*40 53 48 83 EC 20 48 8D 05 ?? ?? ?? ?? 48 8B D9 48 39 81 ?? ?? ?? ?? 74 29*/
|
||||
void** (*CEngineVGui_Unknown)(std::int64_t a1) = (void** (*)(std::int64_t))p_CEngineVGui_Unknown.GetPtr(); /*40 53 48 83 EC 20 48 8D 05 ?? ?? ?? ?? 48 8B D9 48 39 81 ?? ?? ?? ?? 74 29*/
|
||||
#endif
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user