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.

73 lines
2.3 KiB

  1. //========= Copyright � 1996-2009, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=====================================================================================//
  6. #ifndef __MANIFEST_H
  7. #define __MANIFEST_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "boundbox.h"
  12. //
  13. // Each cordon is a named collection of bounding boxes.
  14. //
  15. struct Cordon_t
  16. {
  17. inline Cordon_t()
  18. {
  19. m_bActive = false;
  20. }
  21. CUtlString m_szName;
  22. bool m_bActive; // True means cull using this cordon when cordoning is enabled.
  23. CUtlVector<BoundBox> m_Boxes;
  24. };
  25. class CManifestMap
  26. {
  27. public:
  28. CManifestMap( void );
  29. char m_RelativeMapFileName[ MAX_PATH ];
  30. bool m_bTopLevelMap;
  31. };
  32. class CManifest
  33. {
  34. public:
  35. CManifest( void );
  36. static ChunkFileResult_t LoadManifestMapKeyCallback( const char *szKey, const char *szValue, CManifestMap *pManifestMap );
  37. static ChunkFileResult_t LoadManifestVMFCallback( CChunkFile *pFile, CManifest *pManifest );
  38. static ChunkFileResult_t LoadManifestMapsCallback( CChunkFile *pFile, CManifest *pManifest );
  39. static ChunkFileResult_t LoadCordonBoxCallback( CChunkFile *pFile, Cordon_t *pCordon );
  40. static ChunkFileResult_t LoadCordonBoxKeyCallback( const char *szKey, const char *szValue, BoundBox *pBox );
  41. static ChunkFileResult_t LoadCordonKeyCallback( const char *szKey, const char *szValue, Cordon_t *pCordon );
  42. static ChunkFileResult_t LoadCordonCallback( CChunkFile *pFile, CManifest *pManifest );
  43. static ChunkFileResult_t LoadCordonsKeyCallback( const char *pszKey, const char *pszValue, CManifest *pManifest );
  44. static ChunkFileResult_t LoadCordonsCallback( CChunkFile *pFile, CManifest *pManifest );
  45. static ChunkFileResult_t LoadManifestCordoningPrefsCallback( CChunkFile *pFile, CManifest *pManifest );
  46. bool LoadSubMaps( CMapFile *pMapFile, const char *pszFileName );
  47. epair_t *CreateEPair( char *pKey, char *pValue );
  48. bool LoadVMFManifest( const char *pszFileName );
  49. const char *GetInstancePath( ) { return m_InstancePath; }
  50. void CordonWorld( );
  51. private:
  52. bool LoadVMFManifestUserPrefs( const char *pszFileName );
  53. CUtlVector< CManifestMap * > m_Maps;
  54. char m_InstancePath[ MAX_PATH ];
  55. bool m_bIsCordoning;
  56. CUtlVector< Cordon_t > m_Cordons;
  57. entity_t *m_CordoningMapEnt;
  58. };
  59. #endif // #ifndef __MANIFEST_H