csgo-2018-source/engine/dt_instrumentation.h

57 lines
1.6 KiB
C
Raw Permalink Normal View History

2021-07-25 12:11:47 +08:00
//========= Copyright <20> 1996-2005, Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================//
#ifndef DATATABLE_INSTRUMENTATION_H
#define DATATABLE_INSTRUMENTATION_H
#ifdef _WIN32
#pragma once
#endif
#include "dt_recv_eng.h"
#include "dt_encode.h"
// Is instrumentation enabled?
extern bool g_bDTIEnabled;
// ------------------------------------------------------------------------------------------ //
// Instrumentation functions.
// ------------------------------------------------------------------------------------------ //
// This is called at startup to enable instrumentation.
void DTI_Init();
// Calls DTI_Flush and cleans up.
void DTI_Term();
// This writes out the instrumentation file.
void DTI_Flush();
// Setup instrumentation on a CRecvDecoder.
void DTI_HookRecvDecoder( CRecvDecoder *pDecoder );
// Notify the instrumentation that a delta bit has been read.
void DTI_HookDeltaBits( CRecvDecoder *pDecoder, int iProp, int nDataBits, int nIndexBits );
// ------------------------------------------------------------------------------------------ //
// Inlines.
// ------------------------------------------------------------------------------------------ //
inline void DTI_HookDeltaBits( CRecvDecoder *pDecoder, int iProp, int nDataBits, int nIndexBits )
{
if( g_bDTIEnabled )
{
extern void _DTI_HookDeltaBits( CRecvDecoder *pDecoder, int iProp, int nDataBits, int nIndexBits );
_DTI_HookDeltaBits( pDecoder, iProp, nDataBits, nIndexBits );
}
}
#endif // DATATABLE_INSTRUMENTATION_H