Counter Strike : Global Offensive Source Code
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.

90 lines
2.7 KiB

  1. //========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef AI_DEBUG_H
  8. #define AI_DEBUG_H
  9. #include "fmtstr.h"
  10. #include "ai_debug_shared.h"
  11. #if defined( _WIN32 )
  12. #pragma once
  13. #endif
  14. // This dumps a summary result on exit
  15. //#define PROFILE_AI 1
  16. #define AI_PROFILE_SCOPE_BEGIN( tag ) if (0) ; else { AI_PROFILE_SCOPE( tag )
  17. #define AI_PROFILE_SCOPE_BEGIN_( pszName ) if (0) ; else { AI_PROFILE_SCOPE_( pszName )
  18. #define AI_PROFILE_SCOPE_END() } do {} while (0)
  19. #if defined(VPROF_AI)
  20. #define VProfAI() true
  21. #else
  22. #define VProfAI() false
  23. #endif
  24. #if defined(VPROF_AI)
  25. #include "tier0/vprof.h"
  26. #define AI_PROFILE_SCOPE( tag ) VPROF( #tag )
  27. #define AI_PROFILE_SCOPE_( pszName ) VPROF( pszName )
  28. #define AI_PROFILE_MEASURE_SCOPE( tag ) VPROF( #tag )
  29. #elif defined(PROFILE_AI)
  30. #include "tier0/fasttimer.h"
  31. #define AI_PROFILE_SCOPE( tag ) PROFILE_SCOPE( tag )
  32. #define AI_PROFILE_MEASURE_SCOPE( tag ) PROFILE_SCOPE( tag )
  33. #else
  34. #define AI_PROFILE_MEASURE_SCOPE( tag ) ((void)0)
  35. #define AI_PROFILE_SCOPE( tag ) ((void)0)
  36. #endif
  37. #ifndef AI_PROFILE_SCOPE_
  38. #define AI_PROFILE_SCOPE_( pszName ) ((void)0)
  39. #endif
  40. enum AIMsgFlags
  41. {
  42. AIMF_IGNORE_SELECTED = 0x01
  43. };
  44. #ifndef DBGFLAG_STRINGS_STRIP
  45. void DevMsg( CAI_BaseNPC *pAI, unsigned flags, PRINTF_FORMAT_STRING const char *pszFormat, ... ) FMTFUNCTION( 3, 4 );
  46. void DevMsg( CAI_BaseNPC *pAI, PRINTF_FORMAT_STRING const char *pszFormat, ... ) FMTFUNCTION( 2, 3 );
  47. #endif
  48. //-----------------------------------------------------------------------------
  49. // Purpose: Use this to perform AI tracelines that are trying to determine LOS between points.
  50. // LOS checks between entities should use FVisible.
  51. //-----------------------------------------------------------------------------
  52. void AI_TraceLOS( const Vector& vecAbsStart, const Vector& vecAbsEnd, CBaseEntity *pLooker, trace_t *ptr, ITraceFilter *pFilter = NULL );
  53. //-----------------------------------------------------------------------------
  54. #ifdef DEBUG
  55. extern bool g_fTestSteering;
  56. #define TestingSteering() g_fTestSteering
  57. #else
  58. #define TestingSteering() false
  59. #endif
  60. //-----------------------------------------------------------------------------
  61. #ifdef _DEBUG
  62. extern ConVar ai_debug_doors;
  63. #define AIIsDebuggingDoors( pNPC ) ( ai_debug_doors.GetBool() && pNPC->m_bSelected )
  64. #define AIDoorDebugMsg( pNPC, msg ) if ( !AIIsDebuggingDoors( pNPC ) ) ; else Msg( msg )
  65. #else
  66. #define AIIsDebuggingDoors( pNPC ) (false)
  67. #define AIDoorDebugMsg( pNPC, msg ) ((void)(0))
  68. #endif
  69. //-----------------------------------------------------------------------------
  70. #endif // AI_DEBUG_H