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.

88 lines
2.6 KiB

  1. //========= Copyright 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. void DevMsg( CAI_BaseNPC *pAI, unsigned flags, PRINTF_FORMAT_STRING const char *pszFormat, ... ) FMTFUNCTION( 3, 4 );
  45. void DevMsg( CAI_BaseNPC *pAI, PRINTF_FORMAT_STRING const char *pszFormat, ... ) FMTFUNCTION( 2, 3 );
  46. //-----------------------------------------------------------------------------
  47. // Purpose: Use this to perform AI tracelines that are trying to determine LOS between points.
  48. // LOS checks between entities should use FVisible.
  49. //-----------------------------------------------------------------------------
  50. void AI_TraceLOS( const Vector& vecAbsStart, const Vector& vecAbsEnd, CBaseEntity *pLooker, trace_t *ptr, ITraceFilter *pFilter = NULL );
  51. //-----------------------------------------------------------------------------
  52. #ifdef DEBUG
  53. extern bool g_fTestSteering;
  54. #define TestingSteering() g_fTestSteering
  55. #else
  56. #define TestingSteering() false
  57. #endif
  58. //-----------------------------------------------------------------------------
  59. #ifdef _DEBUG
  60. extern ConVar ai_debug_doors;
  61. #define AIIsDebuggingDoors( pNPC ) ( ai_debug_doors.GetBool() && pNPC->m_bSelected )
  62. #define AIDoorDebugMsg( pNPC, msg ) if ( !AIIsDebuggingDoors( pNPC ) ) ; else Msg( msg )
  63. #else
  64. #define AIIsDebuggingDoors( pNPC ) (false)
  65. #define AIDoorDebugMsg( pNPC, msg ) ((void)(0))
  66. #endif
  67. //-----------------------------------------------------------------------------
  68. #endif // AI_DEBUG_H