Team Fortress 2 Source Code as on 22/4/2020
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.

387 lines
7.7 KiB

  1. #include "shaderlib/cshader.h"
  2. class pyro_vision_vs20_Static_Index
  3. {
  4. private:
  5. int m_nEFFECT;
  6. #ifdef _DEBUG
  7. bool m_bEFFECT;
  8. #endif
  9. public:
  10. void SetEFFECT( int i )
  11. {
  12. Assert( i >= 0 && i <= 3 );
  13. m_nEFFECT = i;
  14. #ifdef _DEBUG
  15. m_bEFFECT = true;
  16. #endif
  17. }
  18. void SetEFFECT( bool i )
  19. {
  20. m_nEFFECT = i ? 1 : 0;
  21. #ifdef _DEBUG
  22. m_bEFFECT = true;
  23. #endif
  24. }
  25. private:
  26. int m_nVERTEXCOLOR;
  27. #ifdef _DEBUG
  28. bool m_bVERTEXCOLOR;
  29. #endif
  30. public:
  31. void SetVERTEXCOLOR( int i )
  32. {
  33. Assert( i >= 0 && i <= 1 );
  34. m_nVERTEXCOLOR = i;
  35. #ifdef _DEBUG
  36. m_bVERTEXCOLOR = true;
  37. #endif
  38. }
  39. void SetVERTEXCOLOR( bool i )
  40. {
  41. m_nVERTEXCOLOR = i ? 1 : 0;
  42. #ifdef _DEBUG
  43. m_bVERTEXCOLOR = true;
  44. #endif
  45. }
  46. private:
  47. int m_nHALFLAMBERT;
  48. #ifdef _DEBUG
  49. bool m_bHALFLAMBERT;
  50. #endif
  51. public:
  52. void SetHALFLAMBERT( int i )
  53. {
  54. Assert( i >= 0 && i <= 1 );
  55. m_nHALFLAMBERT = i;
  56. #ifdef _DEBUG
  57. m_bHALFLAMBERT = true;
  58. #endif
  59. }
  60. void SetHALFLAMBERT( bool i )
  61. {
  62. m_nHALFLAMBERT = i ? 1 : 0;
  63. #ifdef _DEBUG
  64. m_bHALFLAMBERT = true;
  65. #endif
  66. }
  67. private:
  68. int m_nVERTEX_LIT;
  69. #ifdef _DEBUG
  70. bool m_bVERTEX_LIT;
  71. #endif
  72. public:
  73. void SetVERTEX_LIT( int i )
  74. {
  75. Assert( i >= 0 && i <= 1 );
  76. m_nVERTEX_LIT = i;
  77. #ifdef _DEBUG
  78. m_bVERTEX_LIT = true;
  79. #endif
  80. }
  81. void SetVERTEX_LIT( bool i )
  82. {
  83. m_nVERTEX_LIT = i ? 1 : 0;
  84. #ifdef _DEBUG
  85. m_bVERTEX_LIT = true;
  86. #endif
  87. }
  88. private:
  89. int m_nFULLBRIGHT;
  90. #ifdef _DEBUG
  91. bool m_bFULLBRIGHT;
  92. #endif
  93. public:
  94. void SetFULLBRIGHT( int i )
  95. {
  96. Assert( i >= 0 && i <= 1 );
  97. m_nFULLBRIGHT = i;
  98. #ifdef _DEBUG
  99. m_bFULLBRIGHT = true;
  100. #endif
  101. }
  102. void SetFULLBRIGHT( bool i )
  103. {
  104. m_nFULLBRIGHT = i ? 1 : 0;
  105. #ifdef _DEBUG
  106. m_bFULLBRIGHT = true;
  107. #endif
  108. }
  109. private:
  110. int m_nUSE_STATIC_CONTROL_FLOW;
  111. #ifdef _DEBUG
  112. bool m_bUSE_STATIC_CONTROL_FLOW;
  113. #endif
  114. public:
  115. void SetUSE_STATIC_CONTROL_FLOW( int i )
  116. {
  117. Assert( i >= 0 && i <= 1 );
  118. m_nUSE_STATIC_CONTROL_FLOW = i;
  119. #ifdef _DEBUG
  120. m_bUSE_STATIC_CONTROL_FLOW = true;
  121. #endif
  122. }
  123. void SetUSE_STATIC_CONTROL_FLOW( bool i )
  124. {
  125. m_nUSE_STATIC_CONTROL_FLOW = i ? 1 : 0;
  126. #ifdef _DEBUG
  127. m_bUSE_STATIC_CONTROL_FLOW = true;
  128. #endif
  129. }
  130. private:
  131. int m_nBASETEXTURE2;
  132. #ifdef _DEBUG
  133. bool m_bBASETEXTURE2;
  134. #endif
  135. public:
  136. void SetBASETEXTURE2( int i )
  137. {
  138. Assert( i >= 0 && i <= 1 );
  139. m_nBASETEXTURE2 = i;
  140. #ifdef _DEBUG
  141. m_bBASETEXTURE2 = true;
  142. #endif
  143. }
  144. void SetBASETEXTURE2( bool i )
  145. {
  146. m_nBASETEXTURE2 = i ? 1 : 0;
  147. #ifdef _DEBUG
  148. m_bBASETEXTURE2 = true;
  149. #endif
  150. }
  151. private:
  152. int m_nSTRIPES;
  153. #ifdef _DEBUG
  154. bool m_bSTRIPES;
  155. #endif
  156. public:
  157. void SetSTRIPES( int i )
  158. {
  159. Assert( i >= 0 && i <= 1 );
  160. m_nSTRIPES = i;
  161. #ifdef _DEBUG
  162. m_bSTRIPES = true;
  163. #endif
  164. }
  165. void SetSTRIPES( bool i )
  166. {
  167. m_nSTRIPES = i ? 1 : 0;
  168. #ifdef _DEBUG
  169. m_bSTRIPES = true;
  170. #endif
  171. }
  172. private:
  173. int m_nSTRIPES_USE_NORMAL2;
  174. #ifdef _DEBUG
  175. bool m_bSTRIPES_USE_NORMAL2;
  176. #endif
  177. public:
  178. void SetSTRIPES_USE_NORMAL2( int i )
  179. {
  180. Assert( i >= 0 && i <= 1 );
  181. m_nSTRIPES_USE_NORMAL2 = i;
  182. #ifdef _DEBUG
  183. m_bSTRIPES_USE_NORMAL2 = true;
  184. #endif
  185. }
  186. void SetSTRIPES_USE_NORMAL2( bool i )
  187. {
  188. m_nSTRIPES_USE_NORMAL2 = i ? 1 : 0;
  189. #ifdef _DEBUG
  190. m_bSTRIPES_USE_NORMAL2 = true;
  191. #endif
  192. }
  193. public:
  194. pyro_vision_vs20_Static_Index( )
  195. {
  196. #ifdef _DEBUG
  197. m_bEFFECT = false;
  198. #endif // _DEBUG
  199. m_nEFFECT = 0;
  200. #ifdef _DEBUG
  201. m_bVERTEXCOLOR = false;
  202. #endif // _DEBUG
  203. m_nVERTEXCOLOR = 0;
  204. #ifdef _DEBUG
  205. m_bHALFLAMBERT = false;
  206. #endif // _DEBUG
  207. m_nHALFLAMBERT = 0;
  208. #ifdef _DEBUG
  209. m_bVERTEX_LIT = false;
  210. #endif // _DEBUG
  211. m_nVERTEX_LIT = 0;
  212. #ifdef _DEBUG
  213. m_bFULLBRIGHT = false;
  214. #endif // _DEBUG
  215. m_nFULLBRIGHT = 0;
  216. #ifdef _DEBUG
  217. m_bUSE_STATIC_CONTROL_FLOW = false;
  218. #endif // _DEBUG
  219. m_nUSE_STATIC_CONTROL_FLOW = 0;
  220. #ifdef _DEBUG
  221. m_bBASETEXTURE2 = false;
  222. #endif // _DEBUG
  223. m_nBASETEXTURE2 = 0;
  224. #ifdef _DEBUG
  225. m_bSTRIPES = false;
  226. #endif // _DEBUG
  227. m_nSTRIPES = 0;
  228. #ifdef _DEBUG
  229. m_bSTRIPES_USE_NORMAL2 = false;
  230. #endif // _DEBUG
  231. m_nSTRIPES_USE_NORMAL2 = 0;
  232. }
  233. int GetIndex()
  234. {
  235. // Asserts to make sure that we aren't using any skipped combinations.
  236. // Asserts to make sure that we are setting all of the combination vars.
  237. #ifdef _DEBUG
  238. bool bAllStaticVarsDefined = m_bEFFECT && m_bVERTEXCOLOR && m_bHALFLAMBERT && m_bVERTEX_LIT && m_bFULLBRIGHT && m_bUSE_STATIC_CONTROL_FLOW && m_bBASETEXTURE2 && m_bSTRIPES && m_bSTRIPES_USE_NORMAL2;
  239. Assert( bAllStaticVarsDefined );
  240. #endif // _DEBUG
  241. return ( 48 * m_nEFFECT ) + ( 192 * m_nVERTEXCOLOR ) + ( 384 * m_nHALFLAMBERT ) + ( 768 * m_nVERTEX_LIT ) + ( 1536 * m_nFULLBRIGHT ) + ( 3072 * m_nUSE_STATIC_CONTROL_FLOW ) + ( 6144 * m_nBASETEXTURE2 ) + ( 12288 * m_nSTRIPES ) + ( 24576 * m_nSTRIPES_USE_NORMAL2 ) + 0;
  242. }
  243. };
  244. #define shaderStaticTest_pyro_vision_vs20 vsh_forgot_to_set_static_EFFECT + vsh_forgot_to_set_static_VERTEXCOLOR + vsh_forgot_to_set_static_HALFLAMBERT + vsh_forgot_to_set_static_VERTEX_LIT + vsh_forgot_to_set_static_FULLBRIGHT + vsh_forgot_to_set_static_USE_STATIC_CONTROL_FLOW + vsh_forgot_to_set_static_BASETEXTURE2 + vsh_forgot_to_set_static_STRIPES + vsh_forgot_to_set_static_STRIPES_USE_NORMAL2 + 0
  245. class pyro_vision_vs20_Dynamic_Index
  246. {
  247. private:
  248. int m_nCOMPRESSED_VERTS;
  249. #ifdef _DEBUG
  250. bool m_bCOMPRESSED_VERTS;
  251. #endif
  252. public:
  253. void SetCOMPRESSED_VERTS( int i )
  254. {
  255. Assert( i >= 0 && i <= 1 );
  256. m_nCOMPRESSED_VERTS = i;
  257. #ifdef _DEBUG
  258. m_bCOMPRESSED_VERTS = true;
  259. #endif
  260. }
  261. void SetCOMPRESSED_VERTS( bool i )
  262. {
  263. m_nCOMPRESSED_VERTS = i ? 1 : 0;
  264. #ifdef _DEBUG
  265. m_bCOMPRESSED_VERTS = true;
  266. #endif
  267. }
  268. private:
  269. int m_nSKINNING;
  270. #ifdef _DEBUG
  271. bool m_bSKINNING;
  272. #endif
  273. public:
  274. void SetSKINNING( int i )
  275. {
  276. Assert( i >= 0 && i <= 1 );
  277. m_nSKINNING = i;
  278. #ifdef _DEBUG
  279. m_bSKINNING = true;
  280. #endif
  281. }
  282. void SetSKINNING( bool i )
  283. {
  284. m_nSKINNING = i ? 1 : 0;
  285. #ifdef _DEBUG
  286. m_bSKINNING = true;
  287. #endif
  288. }
  289. private:
  290. int m_nDYNAMIC_LIGHT;
  291. #ifdef _DEBUG
  292. bool m_bDYNAMIC_LIGHT;
  293. #endif
  294. public:
  295. void SetDYNAMIC_LIGHT( int i )
  296. {
  297. Assert( i >= 0 && i <= 1 );
  298. m_nDYNAMIC_LIGHT = i;
  299. #ifdef _DEBUG
  300. m_bDYNAMIC_LIGHT = true;
  301. #endif
  302. }
  303. void SetDYNAMIC_LIGHT( bool i )
  304. {
  305. m_nDYNAMIC_LIGHT = i ? 1 : 0;
  306. #ifdef _DEBUG
  307. m_bDYNAMIC_LIGHT = true;
  308. #endif
  309. }
  310. private:
  311. int m_nSTATIC_LIGHT;
  312. #ifdef _DEBUG
  313. bool m_bSTATIC_LIGHT;
  314. #endif
  315. public:
  316. void SetSTATIC_LIGHT( int i )
  317. {
  318. Assert( i >= 0 && i <= 1 );
  319. m_nSTATIC_LIGHT = i;
  320. #ifdef _DEBUG
  321. m_bSTATIC_LIGHT = true;
  322. #endif
  323. }
  324. void SetSTATIC_LIGHT( bool i )
  325. {
  326. m_nSTATIC_LIGHT = i ? 1 : 0;
  327. #ifdef _DEBUG
  328. m_bSTATIC_LIGHT = true;
  329. #endif
  330. }
  331. private:
  332. int m_nNUM_LIGHTS;
  333. #ifdef _DEBUG
  334. bool m_bNUM_LIGHTS;
  335. #endif
  336. public:
  337. void SetNUM_LIGHTS( int i )
  338. {
  339. Assert( i >= 0 && i <= 2 );
  340. m_nNUM_LIGHTS = i;
  341. #ifdef _DEBUG
  342. m_bNUM_LIGHTS = true;
  343. #endif
  344. }
  345. void SetNUM_LIGHTS( bool i )
  346. {
  347. m_nNUM_LIGHTS = i ? 1 : 0;
  348. #ifdef _DEBUG
  349. m_bNUM_LIGHTS = true;
  350. #endif
  351. }
  352. public:
  353. pyro_vision_vs20_Dynamic_Index()
  354. {
  355. #ifdef _DEBUG
  356. m_bCOMPRESSED_VERTS = false;
  357. #endif // _DEBUG
  358. m_nCOMPRESSED_VERTS = 0;
  359. #ifdef _DEBUG
  360. m_bSKINNING = false;
  361. #endif // _DEBUG
  362. m_nSKINNING = 0;
  363. #ifdef _DEBUG
  364. m_bDYNAMIC_LIGHT = false;
  365. #endif // _DEBUG
  366. m_nDYNAMIC_LIGHT = 0;
  367. #ifdef _DEBUG
  368. m_bSTATIC_LIGHT = false;
  369. #endif // _DEBUG
  370. m_nSTATIC_LIGHT = 0;
  371. #ifdef _DEBUG
  372. m_bNUM_LIGHTS = false;
  373. #endif // _DEBUG
  374. m_nNUM_LIGHTS = 0;
  375. }
  376. int GetIndex()
  377. {
  378. // Asserts to make sure that we aren't using any skipped combinations.
  379. // Asserts to make sure that we are setting all of the combination vars.
  380. #ifdef _DEBUG
  381. bool bAllDynamicVarsDefined = m_bCOMPRESSED_VERTS && m_bSKINNING && m_bDYNAMIC_LIGHT && m_bSTATIC_LIGHT && m_bNUM_LIGHTS;
  382. Assert( bAllDynamicVarsDefined );
  383. #endif // _DEBUG
  384. return ( 1 * m_nCOMPRESSED_VERTS ) + ( 2 * m_nSKINNING ) + ( 4 * m_nDYNAMIC_LIGHT ) + ( 8 * m_nSTATIC_LIGHT ) + ( 16 * m_nNUM_LIGHTS ) + 0;
  385. }
  386. };
  387. #define shaderDynamicTest_pyro_vision_vs20 vsh_forgot_to_set_dynamic_COMPRESSED_VERTS + vsh_forgot_to_set_dynamic_SKINNING + vsh_forgot_to_set_dynamic_DYNAMIC_LIGHT + vsh_forgot_to_set_dynamic_STATIC_LIGHT + vsh_forgot_to_set_dynamic_NUM_LIGHTS + 0