summaryrefslogtreecommitdiff
path: root/engine/dt_instrumentation.h
blob: 10df2fa205a441132b6f893bff6b3a0420324a2e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
//========= Copyright 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