pbsp.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. /*
  2. ==============================================================================
  3. Packed .BSP structures
  4. ==============================================================================
  5. */
  6. #pragma pack(push, 1)
  7. typedef struct {
  8. char shader[MAX_QPATH];
  9. int brushNum;
  10. int visibleSide; // the brush side that ray tests need to clip against (-1 == none)
  11. } pdfog_t;
  12. typedef struct {
  13. int firstSide;
  14. byte numSides;
  15. unsigned short shaderNum; // the shader that determines the contents flags
  16. } pdbrush_t;
  17. typedef struct {
  18. int planeNum; // positive plane side faces out of the leaf
  19. byte shaderNum;
  20. } pdbrushside_t;
  21. typedef struct {
  22. int planeNum;
  23. short children[2]; // negative numbers are -(leafs+1), not nodes
  24. short mins[3]; // for frustom culling
  25. short maxs[3];
  26. } pdnode_t;
  27. typedef struct {
  28. short cluster; // -1 = opaque cluster (do I still store these?)
  29. signed char area;
  30. short mins[3]; // for frustum culling
  31. short maxs[3];
  32. unsigned short firstLeafSurface;
  33. unsigned short numLeafSurfaces;
  34. unsigned short firstLeafBrush;
  35. unsigned short numLeafBrushes;
  36. } pdleaf_t;
  37. typedef struct {
  38. float mins[3], maxs[3];
  39. int firstSurface;
  40. unsigned short numSurfaces;
  41. int firstBrush;
  42. unsigned short numBrushes;
  43. } pdmodel_t;
  44. typedef struct {
  45. byte flags;
  46. byte latLong[2];
  47. int data;
  48. } pdgrid_t;
  49. typedef struct {
  50. char shader[MAX_QPATH];
  51. int surfaceFlags;
  52. int contentFlags;
  53. } pdshader_t;
  54. typedef struct {
  55. float normal[3];
  56. float dist;
  57. } pdplane_t;
  58. typedef struct {
  59. float lightmap[MAXLIGHTMAPS][2];
  60. float st[2];
  61. short xyz[3];
  62. short normal[3];
  63. byte color[MAXLIGHTMAPS][4];
  64. } pmapVert_t;
  65. typedef struct {
  66. int code;
  67. byte shaderNum;
  68. signed char fogNum;
  69. unsigned int verts; // high 20 bits are first vert, low 12 are num verts
  70. byte lightmapStyles[MAXLIGHTMAPS];
  71. byte lightmapNum[MAXLIGHTMAPS];
  72. short lightmapVecs[2][3]; // for patches, [0] and [1] are lodbounds
  73. byte patchWidth;
  74. byte patchHeight;
  75. } pdpatch_t;
  76. typedef struct {
  77. int code;
  78. byte shaderNum;
  79. signed char fogNum;
  80. unsigned int verts; // high 20 bits are first vert, low 12 are num verts
  81. unsigned int indexes; // high 20 bits are first index, low 12 are num indices
  82. byte lightmapStyles[MAXLIGHTMAPS];
  83. byte lightmapNum[MAXLIGHTMAPS];
  84. short lightmapVecs[3];
  85. } pdface_t;
  86. typedef struct {
  87. int code;
  88. byte shaderNum;
  89. signed char fogNum;
  90. unsigned int verts; // high 20 bits are first vert, low 12 are num verts
  91. unsigned int indexes; // high 20 bits are first index, low 12 are num indices
  92. byte lightmapStyles[MAXLIGHTMAPS];
  93. } pdtrisurf_t;
  94. typedef struct {
  95. int code;
  96. byte shaderNum;
  97. signed char fogNum;
  98. short origin[3];
  99. short normal[3];
  100. byte color[3];
  101. } pdflare_t;
  102. #pragma pack(pop)