summaryrefslogtreecommitdiff
path: root/engine/dt_instrumentation.h
diff options
context:
space:
mode:
authorFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
committerFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
commit3bf9df6b2785fa6d951086978a3e66f49427166a (patch)
tree2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /engine/dt_instrumentation.h
downloadarchived-source-engine-2018-hl2-src-master.tar.xz
archived-source-engine-2018-hl2-src-master.zip
Diffstat (limited to 'engine/dt_instrumentation.h')
-rw-r--r--engine/dt_instrumentation.h56
1 files changed, 56 insertions, 0 deletions
diff --git a/engine/dt_instrumentation.h b/engine/dt_instrumentation.h
new file mode 100644
index 0000000..10df2fa
--- /dev/null
+++ b/engine/dt_instrumentation.h
@@ -0,0 +1,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