mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
* Added ability to invert rect to calculate offsets from bottom/right as well so debug text doesn't get out of view, or obstruct view when window is resized. * Added Con_NPrintf() hook which shows detailed systems running times and VGUI panel debug information.
32 lines
1.6 KiB
C++
32 lines
1.6 KiB
C++
#pragma once
|
|
|
|
namespace
|
|
{
|
|
//-------------------------------------------------------------------------
|
|
// CGAME
|
|
//-------------------------------------------------------------------------
|
|
#if defined (GAMEDLL_S0) || defined (GAMEDLL_S1)
|
|
ADDRESS p_CVideoMode_Common__CreateGameWindow = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x40\x56\x57\x48\x83\xEC\x38\x48\x8B\xF9\xE8\x00\x00\x00\x00", "xxxxxxxxxxx????");
|
|
bool (*CVideoMode_Common__CreateGameWindow)(int* pnRect) = (bool (*)(int*))p_CVideoMode_Common__CreateGameWindow.GetPtr(); /*40 56 57 48 83 EC 38 48 8B F9 E8 ? ? ? ?*/
|
|
#elif defined (GAMEDLL_S2) || defined (GAMEDLL_S3)
|
|
ADDRESS p_CVideoMode_Common__CreateGameWindow = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x40\x56\x57\x48\x83\xEC\x28\x48\x8B\xF9\xE8\x00\x00\x00\x00\x48\x8B\xF0", "xxxxxxxxxxx????xxx");
|
|
bool (*CVideoMode_Common__CreateGameWindow)(int* pnRect) = (bool (*)(int*))p_CVideoMode_Common__CreateGameWindow.GetPtr(); /*40 56 57 48 83 EC 28 48 8B F9 E8 ? ? ? ? 48 8B F0*/
|
|
#endif
|
|
}
|
|
|
|
void HCVideoMode_Common_Attach();
|
|
void HCVideoMode_Common_Detach();
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
class HVideoMode_Common : public IDetour
|
|
{
|
|
virtual void debugp()
|
|
{
|
|
std::cout << "| FUN: CVideoMode_Common::CreateGameWindow : 0x" << std::hex << std::uppercase << p_CVideoMode_Common__CreateGameWindow.GetPtr() << std::setw(npad) << " |" << std::endl;
|
|
std::cout << "+----------------------------------------------------------------+" << std::endl;
|
|
}
|
|
};
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
REGISTER(HVideoMode_Common);
|