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.

320 lines
9.5 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: Defines game-specific data
  4. //
  5. // $Revision: $
  6. // $NoKeywords: $
  7. //=============================================================================//
  8. #ifndef GAMEBSPFILE_H
  9. #define GAMEBSPFILE_H
  10. #ifdef _WIN32
  11. #pragma once
  12. #endif
  13. #include "mathlib/vector.h"
  14. #include "basetypes.h"
  15. //-----------------------------------------------------------------------------
  16. // This enumerations defines all the four-CC codes for the client lump names
  17. //-----------------------------------------------------------------------------
  18. enum
  19. {
  20. GAMELUMP_DETAIL_PROPS = 'dprp',
  21. GAMELUMP_DETAIL_PROP_LIGHTING = 'dplt',
  22. GAMELUMP_STATIC_PROPS = 'sprp',
  23. GAMELUMP_DETAIL_PROP_LIGHTING_HDR = 'dplh',
  24. };
  25. // Versions...
  26. enum
  27. {
  28. GAMELUMP_DETAIL_PROPS_VERSION = 4,
  29. GAMELUMP_DETAIL_PROP_LIGHTING_VERSION = 0,
  30. GAMELUMP_STATIC_PROPS_MIN_VERSION = 4,
  31. GAMELUMP_STATIC_PROPS_VERSION = 10,
  32. GAMELUMP_STATIC_PROP_LIGHTING_VERSION = 0,
  33. GAMELUMP_DETAIL_PROP_LIGHTING_HDR_VERSION = 0,
  34. };
  35. //-----------------------------------------------------------------------------
  36. // This is the data associated with the GAMELUMP_DETAIL_PROPS lump
  37. //-----------------------------------------------------------------------------
  38. #define DETAIL_NAME_LENGTH 128
  39. enum DetailPropOrientation_t
  40. {
  41. DETAIL_PROP_ORIENT_NORMAL = 0,
  42. DETAIL_PROP_ORIENT_SCREEN_ALIGNED,
  43. DETAIL_PROP_ORIENT_SCREEN_ALIGNED_VERTICAL,
  44. };
  45. // NOTE: If DetailPropType_t enum changes, change CDetailModel::QuadsToDraw
  46. // in detailobjectsystem.cpp
  47. enum DetailPropType_t
  48. {
  49. DETAIL_PROP_TYPE_MODEL = 0,
  50. DETAIL_PROP_TYPE_SPRITE,
  51. DETAIL_PROP_TYPE_SHAPE_CROSS,
  52. DETAIL_PROP_TYPE_SHAPE_TRI,
  53. };
  54. //-----------------------------------------------------------------------------
  55. // Model index when using studiomdls for detail props
  56. //-----------------------------------------------------------------------------
  57. struct DetailObjectDictLump_t
  58. {
  59. DECLARE_BYTESWAP_DATADESC();
  60. char m_Name[DETAIL_NAME_LENGTH]; // model name
  61. };
  62. //-----------------------------------------------------------------------------
  63. // Information about the sprite to render
  64. //-----------------------------------------------------------------------------
  65. struct DetailSpriteDictLump_t
  66. {
  67. DECLARE_BYTESWAP_DATADESC();
  68. // NOTE: All detail prop sprites must lie in the material detail/detailsprites
  69. Vector2D m_UL; // Coordinate of upper left
  70. Vector2D m_LR; // Coordinate of lower right
  71. Vector2D m_TexUL; // Texcoords of upper left
  72. Vector2D m_TexLR; // Texcoords of lower left
  73. };
  74. struct DetailObjectLump_t
  75. {
  76. DECLARE_BYTESWAP_DATADESC();
  77. Vector m_Origin;
  78. QAngle m_Angles;
  79. unsigned short m_DetailModel; // either index into DetailObjectDictLump_t or DetailPropSpriteLump_t
  80. unsigned short m_Leaf;
  81. ColorRGBExp32 m_Lighting;
  82. unsigned int m_LightStyles;
  83. unsigned char m_LightStyleCount;
  84. unsigned char m_SwayAmount; // how much do the details sway
  85. unsigned char m_ShapeAngle; // angle param for shaped sprites
  86. unsigned char m_ShapeSize; // size param for shaped sprites
  87. unsigned char m_Orientation; // See DetailPropOrientation_t
  88. unsigned char m_Padding2[3]; // FIXME: Remove when we rev the detail lump again..
  89. unsigned char m_Type; // See DetailPropType_t
  90. unsigned char m_Padding3[3]; // FIXME: Remove when we rev the detail lump again..
  91. float m_flScale; // For sprites only currently
  92. };
  93. //-----------------------------------------------------------------------------
  94. // This is the data associated with the GAMELUMP_DETAIL_PROP_LIGHTING lump
  95. //-----------------------------------------------------------------------------
  96. struct DetailPropLightstylesLump_t
  97. {
  98. DECLARE_BYTESWAP_DATADESC();
  99. ColorRGBExp32 m_Lighting;
  100. unsigned char m_Style;
  101. };
  102. //-----------------------------------------------------------------------------
  103. // This is the data associated with the GAMELUMP_STATIC_PROPS lump
  104. //-----------------------------------------------------------------------------
  105. enum
  106. {
  107. STATIC_PROP_NAME_LENGTH = 128,
  108. // Flags field
  109. // These are automatically computed
  110. STATIC_PROP_FLAG_FADES = 0x1,
  111. STATIC_PROP_USE_LIGHTING_ORIGIN = 0x2,
  112. // These are set in WC
  113. STATIC_PROP_NO_FLASHLIGHT = 0x4, // computed at run time based on dx level
  114. STATIC_PROP_IGNORE_NORMALS = 0x8,
  115. STATIC_PROP_NO_SHADOW = 0x10,
  116. STATIC_PROP_MARKED_FOR_FAST_REFLECTION = 0x20,
  117. STATIC_PROP_NO_PER_VERTEX_LIGHTING = 0x40, // in vrad, compute smoother lighting by ignoring occlusion
  118. STATIC_PROP_NO_SELF_SHADOWING = 0x80, // disable self shadowing in vrad
  119. STATIC_PROP_WC_MASK = 0xdc, // all flags settable in hammer (?)
  120. };
  121. // Extended flags (new for version V10) - so we don't need to keep re-purposing the torturted old 8-bit m_Flags field in each branch/project.
  122. enum
  123. {
  124. STATIC_PROP_FLAGS_EX_DISABLE_SHADOW_DEPTH = 0x1, // do not render this prop into the CSM or flashlight shadow depth buffers (but still cast shadows into lightmaps)
  125. STATIC_PROP_FLAGS_EX_DISABLE_CSM = 0x2, // do not render this prop into the CSM depth buffers (but still cast shadows into lightmaps and potentially draw into flashlight shadow buffers) - currently only set at runtime
  126. STATIC_PROP_FLAGS_EX_ENABLE_LIGHT_BOUNCE = 0x4, // Allow indirect light to bounce off this static prop in vrad
  127. };
  128. struct StaticPropDictLump_t
  129. {
  130. DECLARE_BYTESWAP_DATADESC();
  131. char m_Name[STATIC_PROP_NAME_LENGTH]; // model name
  132. };
  133. struct StaticPropLumpV4_t
  134. {
  135. DECLARE_BYTESWAP_DATADESC();
  136. Vector m_Origin;
  137. QAngle m_Angles;
  138. unsigned short m_PropType;
  139. unsigned short m_FirstLeaf;
  140. unsigned short m_LeafCount;
  141. unsigned char m_Solid;
  142. unsigned char m_Flags;
  143. int m_Skin;
  144. float m_FadeMinDist;
  145. float m_FadeMaxDist;
  146. Vector m_LightingOrigin;
  147. // int m_Lighting; // index into the GAMELUMP_STATIC_PROP_LIGHTING lump
  148. };
  149. struct StaticPropLumpV5_t
  150. {
  151. DECLARE_BYTESWAP_DATADESC();
  152. Vector m_Origin;
  153. QAngle m_Angles;
  154. unsigned short m_PropType;
  155. unsigned short m_FirstLeaf;
  156. unsigned short m_LeafCount;
  157. unsigned char m_Solid;
  158. unsigned char m_Flags;
  159. int m_Skin;
  160. float m_FadeMinDist;
  161. float m_FadeMaxDist;
  162. Vector m_LightingOrigin;
  163. float m_flForcedFadeScale;
  164. // int m_Lighting; // index into the GAMELUMP_STATIC_PROP_LIGHTING lump
  165. };
  166. struct StaticPropLumpV6_t
  167. {
  168. DECLARE_BYTESWAP_DATADESC();
  169. Vector m_Origin;
  170. QAngle m_Angles;
  171. unsigned short m_PropType;
  172. unsigned short m_FirstLeaf;
  173. unsigned short m_LeafCount;
  174. unsigned char m_Solid;
  175. unsigned char m_Flags;
  176. int m_Skin;
  177. float m_FadeMinDist;
  178. float m_FadeMaxDist;
  179. Vector m_LightingOrigin;
  180. float m_flForcedFadeScale;
  181. unsigned short m_nMinDXLevel;
  182. unsigned short m_nMaxDXLevel;
  183. // int m_Lighting; // index into the GAMELUMP_STATIC_PROP_LIGHTING lump
  184. };
  185. struct StaticPropLumpV7_t
  186. {
  187. DECLARE_BYTESWAP_DATADESC();
  188. Vector m_Origin;
  189. QAngle m_Angles;
  190. unsigned short m_PropType;
  191. unsigned short m_FirstLeaf;
  192. unsigned short m_LeafCount;
  193. unsigned char m_Solid;
  194. unsigned char m_Flags;
  195. int m_Skin;
  196. float m_FadeMinDist;
  197. float m_FadeMaxDist;
  198. Vector m_LightingOrigin;
  199. float m_flForcedFadeScale;
  200. unsigned short m_nMinDXLevel;
  201. unsigned short m_nMaxDXLevel;
  202. // int m_Lighting; // index into the GAMELUMP_STATIC_PROP_LIGHTING lump
  203. color32 m_DiffuseModulation; // per instance color and alpha modulation
  204. };
  205. struct StaticPropLumpV8_t
  206. {
  207. DECLARE_BYTESWAP_DATADESC();
  208. Vector m_Origin;
  209. QAngle m_Angles;
  210. unsigned short m_PropType;
  211. unsigned short m_FirstLeaf;
  212. unsigned short m_LeafCount;
  213. unsigned char m_Solid;
  214. unsigned char m_Flags;
  215. int m_Skin;
  216. float m_FadeMinDist;
  217. float m_FadeMaxDist;
  218. Vector m_LightingOrigin;
  219. float m_flForcedFadeScale;
  220. unsigned char m_nMinCPULevel;
  221. unsigned char m_nMaxCPULevel;
  222. unsigned char m_nMinGPULevel;
  223. unsigned char m_nMaxGPULevel;
  224. // int m_Lighting; // index into the GAMELUMP_STATIC_PROP_LIGHTING lump
  225. color32 m_DiffuseModulation; // per instance color and alpha modulation
  226. };
  227. struct StaticPropLumpV9_t
  228. {
  229. DECLARE_BYTESWAP_DATADESC();
  230. Vector m_Origin;
  231. QAngle m_Angles;
  232. unsigned short m_PropType;
  233. unsigned short m_FirstLeaf;
  234. unsigned short m_LeafCount;
  235. unsigned char m_Solid;
  236. unsigned char m_Flags;
  237. int m_Skin;
  238. float m_FadeMinDist;
  239. float m_FadeMaxDist;
  240. Vector m_LightingOrigin;
  241. float m_flForcedFadeScale;
  242. unsigned char m_nMinCPULevel;
  243. unsigned char m_nMaxCPULevel;
  244. unsigned char m_nMinGPULevel;
  245. unsigned char m_nMaxGPULevel;
  246. // int m_Lighting; // index into the GAMELUMP_STATIC_PROP_LIGHTING lump
  247. color32 m_DiffuseModulation; // per instance color and alpha modulation
  248. bool m_bDisableX360;
  249. };
  250. // version 10
  251. struct StaticPropLump_t
  252. {
  253. DECLARE_BYTESWAP_DATADESC();
  254. Vector m_Origin;
  255. QAngle m_Angles;
  256. unsigned short m_PropType;
  257. unsigned short m_FirstLeaf;
  258. unsigned short m_LeafCount;
  259. unsigned char m_Solid;
  260. unsigned char m_Flags;
  261. int m_Skin;
  262. float m_FadeMinDist;
  263. float m_FadeMaxDist;
  264. Vector m_LightingOrigin;
  265. float m_flForcedFadeScale;
  266. unsigned char m_nMinCPULevel;
  267. unsigned char m_nMaxCPULevel;
  268. unsigned char m_nMinGPULevel;
  269. unsigned char m_nMaxGPULevel;
  270. // int m_Lighting; // index into the GAMELUMP_STATIC_PROP_LIGHTING lump
  271. color32 m_DiffuseModulation; // per instance color and alpha modulation
  272. bool m_bDisableX360;
  273. int m_FlagsEx; // more flags (introduced in v10)
  274. };
  275. struct StaticPropLeafLump_t
  276. {
  277. DECLARE_BYTESWAP_DATADESC();
  278. unsigned short m_Leaf;
  279. };
  280. //-----------------------------------------------------------------------------
  281. // This is the data associated with the GAMELUMP_STATIC_PROP_LIGHTING lump
  282. //-----------------------------------------------------------------------------
  283. struct StaticPropLightstylesLump_t
  284. {
  285. ColorRGBExp32 m_Lighting;
  286. };
  287. #endif // GAMEBSPFILE_H