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.

156 lines
7.7 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $Workfile: $
  6. // $Date: $
  7. // $NoKeywords: $
  8. //=============================================================================//
  9. #ifndef BSPFLAGS_H
  10. #define BSPFLAGS_H
  11. #ifdef _WIN32
  12. #pragma once
  13. #endif
  14. // contents flags are seperate bits
  15. // a given brush can contribute multiple content bits
  16. // multiple brushes can be in a single leaf
  17. // these definitions also need to be in q_shared.h!
  18. // lower bits are stronger, and will eat weaker brushes completely
  19. #define CONTENTS_EMPTY 0 // No contents
  20. #define CONTENTS_SOLID 0x1 // an eye is never valid in a solid
  21. #define CONTENTS_WINDOW 0x2 // translucent, but not watery (glass)
  22. #define CONTENTS_AUX 0x4
  23. #define CONTENTS_GRATE 0x8 // alpha-tested "grate" textures. Bullets/sight pass through, but solids don't
  24. #define CONTENTS_SLIME 0x10
  25. #define CONTENTS_WATER 0x20
  26. #define CONTENTS_BLOCKLOS 0x40 // block AI line of sight
  27. #define CONTENTS_OPAQUE 0x80 // things that cannot be seen through (may be non-solid though)
  28. #define LAST_VISIBLE_CONTENTS CONTENTS_OPAQUE
  29. #define ALL_VISIBLE_CONTENTS (LAST_VISIBLE_CONTENTS | (LAST_VISIBLE_CONTENTS-1))
  30. #define CONTENTS_TESTFOGVOLUME 0x100
  31. #define CONTENTS_UNUSED 0x200
  32. // unused
  33. // NOTE: If it's visible, grab from the top + update LAST_VISIBLE_CONTENTS
  34. // if not visible, then grab from the bottom.
  35. // CONTENTS_OPAQUE + SURF_NODRAW count as CONTENTS_OPAQUE (shadow-casting toolsblocklight textures)
  36. #define CONTENTS_BLOCKLIGHT 0x400
  37. #define CONTENTS_TEAM1 0x800 // per team contents used to differentiate collisions
  38. #define CONTENTS_TEAM2 0x1000 // between players and objects on different teams
  39. // ignore CONTENTS_OPAQUE on surfaces that have SURF_NODRAW
  40. #define CONTENTS_IGNORE_NODRAW_OPAQUE 0x2000
  41. // hits entities which are MOVETYPE_PUSH (doors, plats, etc.)
  42. #define CONTENTS_MOVEABLE 0x4000
  43. // remaining contents are non-visible, and don't eat brushes
  44. #define CONTENTS_AREAPORTAL 0x8000
  45. #define CONTENTS_PLAYERCLIP 0x10000
  46. #define CONTENTS_MONSTERCLIP 0x20000
  47. #define CONTENTS_BRUSH_PAINT 0x40000
  48. #define CONTENTS_GRENADECLIP 0x80000
  49. #define CONTENTS_UNUSED2 0x100000
  50. #define CONTENTS_UNUSED3 0x200000
  51. #define CONTENTS_UNUSED4 0x400000
  52. #define CONTENTS_UNUSED5 0x800000
  53. #define CONTENTS_ORIGIN 0x1000000 // removed before bsping an entity
  54. #define CONTENTS_MONSTER 0x2000000 // should never be on a brush, only in game
  55. #define CONTENTS_DEBRIS 0x4000000
  56. #define CONTENTS_DETAIL 0x8000000 // brushes to be added after vis leafs
  57. #define CONTENTS_TRANSLUCENT 0x10000000 // auto set if any surface has trans
  58. #define CONTENTS_LADDER 0x20000000
  59. #define CONTENTS_HITBOX 0x40000000 // use accurate hitboxes on trace
  60. // NOTE: These are stored in a short in the engine now. Don't use more than 16 bits
  61. #define SURF_LIGHT 0x0001 // value will hold the light strength
  62. #define SURF_SKY2D 0x0002 // don't draw, indicates we should skylight + draw 2d sky but not draw the 3D skybox
  63. #define SURF_SKY 0x0004 // don't draw, but add to skybox
  64. #define SURF_WARP 0x0008 // turbulent water warp
  65. #define SURF_TRANS 0x0010
  66. #define SURF_NOPORTAL 0x0020 // the surface can not have a portal placed on it
  67. #define SURF_TRIGGER 0x0040 // FIXME: This is an xbox hack to work around elimination of trigger surfaces, which breaks occluders
  68. #define SURF_NODRAW 0x0080 // don't bother referencing the texture
  69. #define SURF_HINT 0x0100 // make a primary bsp splitter
  70. #define SURF_SKIP 0x0200 // completely ignore, allowing non-closed brushes
  71. #define SURF_NOLIGHT 0x0400 // Don't calculate light
  72. #define SURF_BUMPLIGHT 0x0800 // calculate three lightmaps for the surface for bumpmapping
  73. #define SURF_NOSHADOWS 0x1000 // Don't receive shadows
  74. #define SURF_NODECALS 0x2000 // Don't receive decals
  75. #define SURF_NOPAINT SURF_NODECALS // the surface can not have paint placed on it
  76. #define SURF_NOCHOP 0x4000 // Don't subdivide patches on this surface
  77. #define SURF_HITBOX 0x8000 // surface is part of a hitbox
  78. // -----------------------------------------------------
  79. // spatial content masks - used for spatial queries (traceline,etc.)
  80. // -----------------------------------------------------
  81. #define MASK_ALL (0xFFFFFFFF)
  82. // everything that is normally solid
  83. #define MASK_SOLID (CONTENTS_SOLID|CONTENTS_MOVEABLE|CONTENTS_WINDOW|CONTENTS_MONSTER|CONTENTS_GRATE)
  84. // everything that blocks player movement
  85. #define MASK_PLAYERSOLID (CONTENTS_SOLID|CONTENTS_MOVEABLE|CONTENTS_PLAYERCLIP|CONTENTS_WINDOW|CONTENTS_MONSTER|CONTENTS_GRATE)
  86. // blocks npc movement
  87. #define MASK_NPCSOLID (CONTENTS_SOLID|CONTENTS_MOVEABLE|CONTENTS_MONSTERCLIP|CONTENTS_WINDOW|CONTENTS_MONSTER|CONTENTS_GRATE)
  88. // blocks fluid movement
  89. #define MASK_NPCFLUID (CONTENTS_SOLID|CONTENTS_MOVEABLE|CONTENTS_MONSTERCLIP|CONTENTS_WINDOW|CONTENTS_MONSTER)
  90. // water physics in these contents
  91. #define MASK_WATER (CONTENTS_WATER|CONTENTS_MOVEABLE|CONTENTS_SLIME)
  92. // everything that blocks lighting
  93. #define MASK_OPAQUE (CONTENTS_SOLID|CONTENTS_MOVEABLE|CONTENTS_OPAQUE)
  94. // everything that blocks lighting, but with monsters added.
  95. #define MASK_OPAQUE_AND_NPCS (MASK_OPAQUE|CONTENTS_MONSTER)
  96. // everything that blocks line of sight for AI
  97. #define MASK_BLOCKLOS (CONTENTS_SOLID|CONTENTS_MOVEABLE|CONTENTS_BLOCKLOS)
  98. // everything that blocks line of sight for AI plus NPCs
  99. #define MASK_BLOCKLOS_AND_NPCS (MASK_BLOCKLOS|CONTENTS_MONSTER)
  100. // everything that blocks line of sight for players
  101. #define MASK_VISIBLE (MASK_OPAQUE|CONTENTS_IGNORE_NODRAW_OPAQUE)
  102. // everything that blocks line of sight for players, but with monsters added.
  103. #define MASK_VISIBLE_AND_NPCS (MASK_OPAQUE_AND_NPCS|CONTENTS_IGNORE_NODRAW_OPAQUE)
  104. // bullets see these as solid
  105. #define MASK_SHOT (CONTENTS_SOLID|CONTENTS_MOVEABLE|CONTENTS_MONSTER|CONTENTS_WINDOW|CONTENTS_DEBRIS|CONTENTS_HITBOX)
  106. // for finding floor height
  107. #define MASK_FLOORTRACE (CONTENTS_SOLID|CONTENTS_MOVEABLE| CONTENTS_WINDOW|CONTENTS_DEBRIS)
  108. // for csgo weapon clipping
  109. #define MASK_WEAPONCLIPPING (CONTENTS_SOLID|CONTENTS_MOVEABLE|CONTENTS_MONSTER|CONTENTS_WINDOW|CONTENTS_DEBRIS)
  110. // bullets see these as solid, except monsters (world+brush only)
  111. #define MASK_SHOT_BRUSHONLY (CONTENTS_SOLID|CONTENTS_MOVEABLE|CONTENTS_WINDOW|CONTENTS_DEBRIS)
  112. // non-raycasted weapons see this as solid (includes grates)
  113. #define MASK_SHOT_HULL (CONTENTS_SOLID|CONTENTS_MOVEABLE|CONTENTS_MONSTER|CONTENTS_WINDOW|CONTENTS_DEBRIS|CONTENTS_GRATE)
  114. // hits solids (not grates) and passes through everything else
  115. #define MASK_SHOT_PORTAL (CONTENTS_SOLID|CONTENTS_MOVEABLE|CONTENTS_WINDOW|CONTENTS_MONSTER)
  116. // everything normally solid, except monsters (world+brush only)
  117. #define MASK_SOLID_BRUSHONLY (CONTENTS_SOLID|CONTENTS_MOVEABLE|CONTENTS_WINDOW|CONTENTS_GRATE)
  118. // everything normally solid for player movement, except monsters (world+brush only)
  119. #define MASK_PLAYERSOLID_BRUSHONLY (CONTENTS_SOLID|CONTENTS_MOVEABLE|CONTENTS_WINDOW|CONTENTS_PLAYERCLIP|CONTENTS_GRATE)
  120. // everything normally solid for npc movement, except monsters (world+brush only)
  121. #define MASK_NPCSOLID_BRUSHONLY (CONTENTS_SOLID|CONTENTS_MOVEABLE|CONTENTS_WINDOW|CONTENTS_MONSTERCLIP|CONTENTS_GRATE)
  122. // just the world, used for route rebuilding
  123. #define MASK_NPCWORLDSTATIC (CONTENTS_SOLID|CONTENTS_WINDOW|CONTENTS_MONSTERCLIP|CONTENTS_GRATE)
  124. // just the world, used for route rebuilding
  125. #define MASK_NPCWORLDSTATIC_FLUID (CONTENTS_SOLID|CONTENTS_WINDOW|CONTENTS_MONSTERCLIP)
  126. // These are things that can split areaportals
  127. #define MASK_SPLITAREAPORTAL (CONTENTS_WATER|CONTENTS_SLIME)
  128. // everything that blocks corpse movement
  129. // UNDONE: Not used yet / may be deleted
  130. #define MASK_DEADSOLID (CONTENTS_SOLID|CONTENTS_PLAYERCLIP|CONTENTS_WINDOW|CONTENTS_GRATE)
  131. #endif // BSPFLAGS_H