2022-07-12 17:46:47 +02:00
//===== Copyright <20> 1996-2005, Valve Corporation, All rights reserved. ======//
//
// Purpose: Debug overlay engine interface.
//
//===========================================================================//
//
///////////////////////////////////////////////////////////////////////////////
# ifndef IDEBUGOVERLAY_H
# define IDEBUGOVERLAY_H
# include "mathlib/vector.h"
class IVDebugOverlay
{
void * __vftable /*VFT*/ ;
} ;
class CIVDebugOverlay : public IVDebugOverlay
{
public :
void AddBoxOverlay ( __m128i & vTransforms , const Vector3D & vMins , const Vector3D & vMaxs , int r , int g , int b , int a , bool bZBuffer , float flDuration )
{
2022-08-31 14:38:49 +02:00
const static int index = 1 ;
2022-07-12 17:46:47 +02:00
CallVFunc < void > ( index , this , vTransforms , vMins , vMaxs , r , g , b , a , bZBuffer , flDuration ) ;
}
void AddSphereOverlay ( const Vector3D & vOrigin , float flRadius , int nTheta , int nPhi , int r , int g , int b , int a , float flDuration )
{
2022-08-31 14:38:49 +02:00
const static int index = 3 ;
2022-07-12 17:46:47 +02:00
CallVFunc < void > ( index , this , vOrigin , flRadius , nTheta , nPhi , r , g , b , a , flDuration ) ;
}
void AddLineOverlay ( const Vector3D & vStart , const Vector3D & vEnd , int r , int g , int b , char bZBuffer , float flDuration )
{
2022-08-31 14:38:49 +02:00
const static int index = 5 ;
2022-07-12 17:46:47 +02:00
CallVFunc < void > ( index , this , vStart , vEnd , r , g , b , bZBuffer , flDuration ) ;
}
void AddCapsuleOverlay ( const Vector3D & vStart , const Vector3D & vEnd , const Vector3D & vRadius , const Vector3D & vTop , const Vector3D & vBottom , int r , int g , int b , int a , float flDuration )
{
2022-08-31 14:38:49 +02:00
const static int index = 12 ;
2022-07-12 17:46:47 +02:00
CallVFunc < void > ( index , this , vStart , vEnd , vRadius , vTop , vBottom , r , g , b , a , flDuration ) ;
}
} ;
inline CIVDebugOverlay * g_pDebugOverlay = nullptr ;
///////////////////////////////////////////////////////////////////////////////
class VDebugOverlayBase : public IDetour
{
virtual void GetAdr ( void ) const
{
spdlog : : debug ( " | VAR: g_pDebugOverlay : {:#18x} | \n " , reinterpret_cast < uintptr_t > ( g_pDebugOverlay ) ) ;
spdlog : : debug ( " +----------------------------------------------------------------+ \n " ) ;
}
virtual void GetFun ( void ) const { }
virtual void GetVar ( void ) const
{
2022-12-01 22:44:55 +01:00
g_pDebugOverlay = g_GameDll . FindPatternSIMD ( " 48 8D 05 ?? ?? ?? ?? C3 CC CC CC CC CC CC CC CC 48 8D 05 ?? ?? ?? ?? C3 CC CC CC CC CC CC CC CC 48 83 EC 28 F3 0F 10 41 ?? " )
2022-07-12 17:46:47 +02:00
. ResolveRelativeAddressSelf ( 0x3 , 0x7 ) . RCast < CIVDebugOverlay * > ( ) ;
}
virtual void GetCon ( void ) const { }
virtual void Attach ( void ) const { }
virtual void Detach ( void ) const { }
} ;
///////////////////////////////////////////////////////////////////////////////
REGISTER ( VDebugOverlayBase ) ;
# endif // IDEBUGOVERLAY_H