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
1.5 KiB

  1. //====== Copyright � 1996-2008, Valve Corporation, All rights reserved. =======
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================
  6. #ifndef VOXFILE_H
  7. #define VOXFILE_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #pragma pack(1)
  12. const uint16 DVOX_CHILD_NOT_PRESENT = 0xFFFF;
  13. struct dvoxtreenode_t
  14. {
  15. uint16 childNodes[8];
  16. uint32 voxelIndex;
  17. uint32 treeLevel;
  18. };
  19. struct dvoxelvert_t
  20. {
  21. int16 pos[3];
  22. uint32 normal;
  23. };
  24. struct dvoxel_t
  25. {
  26. uint32 fileOffset;
  27. uint32 fileSize;
  28. uint32 vertexCount;
  29. uint32 indexCount;
  30. float vertexScale;
  31. Vector origin; // quantized grid origin
  32. Vector localMins; // origin relative bbox
  33. Vector localMaxs; // ...
  34. };
  35. struct dvoxfilechunk_t
  36. {
  37. uint32 identFourCC;
  38. uint32 version;
  39. uint32 fileOffset;
  40. uint32 fileSize;
  41. };
  42. // 1KB header
  43. struct dvoxelfileheader_t
  44. {
  45. uint32 identFourCC;
  46. uint32 voxelCount; // number of voxels in the file including LODs etc
  47. uint32 voxTreeNodeCount; // number of nodes in the tree
  48. uint32 voxTreeNodeRefCount; // number of references to nodes
  49. uint32 voxTreeTopLevelNodeCount; // number of top level nodes in the tree
  50. uint32 chunkCount;
  51. uint32 pad0;
  52. uint32 pad1;
  53. dvoxfilechunk_t chunks[62];
  54. };
  55. #pragma pack()
  56. #define VOXEL_FILEID MAKEID('V','M','A','P')
  57. #define VOX_CHUNK_VOXELS MAKEID('V','V','O','X')
  58. #define VOX_CHUNK_VOXELTREE MAKEID('T','R','E','E')
  59. #define VOX_CHUNK_VOXELGRID MAKEID('G','R','I','D')
  60. #define VOX_CHUNK_ENTITIES MAKEID('E','N','T','S')
  61. #endif // VOXFILE_H