summaryrefslogtreecommitdiff
path: root/replay/replay_dbg.h
diff options
context:
space:
mode:
Diffstat (limited to 'replay/replay_dbg.h')
-rw-r--r--replay/replay_dbg.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/replay/replay_dbg.h b/replay/replay_dbg.h
new file mode 100644
index 0000000..f6765bc
--- /dev/null
+++ b/replay/replay_dbg.h
@@ -0,0 +1,40 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+//=======================================================================================//
+
+#ifndef REPLAY_DBG_H
+#define REPLAY_DBG_H
+#ifdef _WIN32
+#pragma once
+#endif
+
+//----------------------------------------------------------------------------------------
+
+#include "replay/ienginereplay.h"
+#include "convar.h"
+
+//----------------------------------------------------------------------------------------
+
+extern ConVar replay_debug;
+extern IEngineReplay *g_pEngine;
+
+//----------------------------------------------------------------------------------------
+
+#define IF_REPLAY_DBG( x_ ) if ( replay_debug.GetBool() ) { x_; }
+#define IF_REPLAY_DBGN( x_, n_ ) if ( replay_debug.GetInt() >= n_ ) { x_; }
+#define IF_REPLAY_DBG2( x_ ) IF_REPLAY_DBGN( x_, 2 )
+#define IF_REPLAY_DBG3( x_ ) IF_REPLAY_DBGN( x_, 3 )
+
+#ifndef DEDICATED
+#define DBG( x_ ) IF_REPLAY_DBG( Msg( "%f: " x_, g_pEngine->GetHostTime() ) )
+#define DBGN( x_, n_ ) IF_REPLAY_DBGN( Msg( "%f: " x_, g_pEngine->GetHostTime() ), n_ )
+#define DBG2( x_ ) DBGN( x_, 2 )
+#define DBG3( x_ ) DBGN( x_, 3 )
+#else
+#define DBG( x_ )
+#define DBG2( x_ )
+#endif
+
+//----------------------------------------------------------------------------------------
+
+#endif // REPLAY_DBG_H