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.

126 lines
2.8 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //
  7. //=============================================================================//
  8. // NavMesh.cpp
  9. // Implementation of Navigation Mesh interface
  10. // Author: Michael S. Booth, 2003-2004
  11. #include "cbase.h"
  12. #include "filesystem.h"
  13. #include "cs_nav_mesh.h"
  14. #include "cs_nav_node.h"
  15. #include "cs_nav_area.h"
  16. #include "fmtstr.h"
  17. #include "utlbuffer.h"
  18. #include "tier0/vprof.h"
  19. //--------------------------------------------------------------------------------------------------------------
  20. CSNavMesh::CSNavMesh( void )
  21. {
  22. }
  23. //--------------------------------------------------------------------------------------------------------------
  24. CSNavMesh::~CSNavMesh()
  25. {
  26. }
  27. CNavArea * CSNavMesh::CreateArea( void ) const
  28. {
  29. return new CCSNavArea;
  30. }
  31. //-------------------------------------------------------------------------
  32. void CSNavMesh::BeginCustomAnalysis( bool bIncremental )
  33. {
  34. }
  35. //-------------------------------------------------------------------------
  36. // invoked when custom analysis step is complete
  37. void CSNavMesh::PostCustomAnalysis( void )
  38. {
  39. }
  40. //-------------------------------------------------------------------------
  41. void CSNavMesh::EndCustomAnalysis()
  42. {
  43. }
  44. //-------------------------------------------------------------------------
  45. /**
  46. * Returns sub-version number of data format used by derived classes
  47. */
  48. unsigned int CSNavMesh::GetSubVersionNumber( void ) const
  49. {
  50. // 1: initial implementation - added ApproachArea data
  51. return 1;
  52. }
  53. //-------------------------------------------------------------------------
  54. /**
  55. * Store custom mesh data for derived classes
  56. */
  57. void CSNavMesh::SaveCustomData( CUtlBuffer &fileBuffer ) const
  58. {
  59. }
  60. //-------------------------------------------------------------------------
  61. /**
  62. * Load custom mesh data for derived classes
  63. */
  64. void CSNavMesh::LoadCustomData( CUtlBuffer &fileBuffer, unsigned int subVersion )
  65. {
  66. }
  67. //--------------------------------------------------------------------------------------------------------------
  68. /**
  69. * Reset the Navigation Mesh to initial values
  70. */
  71. void CSNavMesh::Reset( void )
  72. {
  73. CNavMesh::Reset();
  74. }
  75. //--------------------------------------------------------------------------------------------------------------
  76. /**
  77. * Zero player counts in all areas
  78. */
  79. void CSNavMesh::ClearPlayerCounts( void )
  80. {
  81. FOR_EACH_VEC( TheNavAreas, it )
  82. {
  83. CCSNavArea *area = (CCSNavArea*)TheNavAreas[ it ];
  84. area->ClearPlayerCount();
  85. }
  86. }
  87. void CSNavMesh::Update( void )
  88. {
  89. CNavMesh::Update();
  90. }
  91. NavErrorType CSNavMesh::Load( void )
  92. {
  93. return CNavMesh::Load();
  94. }
  95. bool CSNavMesh::Save( void ) const
  96. {
  97. return CNavMesh::Save();
  98. }
  99. NavErrorType CSNavMesh::PostLoad( unsigned int version )
  100. {
  101. return CNavMesh::PostLoad(version);
  102. }