Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
1.3 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. //=======================================================================================//
  4. #ifndef REPLAY_DBG_H
  5. #define REPLAY_DBG_H
  6. #ifdef _WIN32
  7. #pragma once
  8. #endif
  9. //----------------------------------------------------------------------------------------
  10. #include "replay/ienginereplay.h"
  11. #include "convar.h"
  12. //----------------------------------------------------------------------------------------
  13. extern ConVar replay_debug;
  14. extern IEngineReplay *g_pEngine;
  15. //----------------------------------------------------------------------------------------
  16. #define IF_REPLAY_DBG( x_ ) if ( replay_debug.GetBool() ) { x_; }
  17. #define IF_REPLAY_DBGN( x_, n_ ) if ( replay_debug.GetInt() >= n_ ) { x_; }
  18. #define IF_REPLAY_DBG2( x_ ) IF_REPLAY_DBGN( x_, 2 )
  19. #define IF_REPLAY_DBG3( x_ ) IF_REPLAY_DBGN( x_, 3 )
  20. #ifndef DEDICATED
  21. #define DBG( x_ ) IF_REPLAY_DBG( Msg( "%f: " x_, g_pEngine->GetHostTime() ) )
  22. #define DBGN( x_, n_ ) IF_REPLAY_DBGN( Msg( "%f: " x_, g_pEngine->GetHostTime() ), n_ )
  23. #define DBG2( x_ ) DBGN( x_, 2 )
  24. #define DBG3( x_ ) DBGN( x_, 3 )
  25. #else
  26. #define DBG( x_ )
  27. #define DBG2( x_ )
  28. #endif
  29. //----------------------------------------------------------------------------------------
  30. #endif // REPLAY_DBG_H