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.

337 lines
6.6 KiB

  1. #include "shaderlib/cshader.h"
  2. class pyro_vision_vs30_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_nBASETEXTURE2;
  111. #ifdef _DEBUG
  112. bool m_bBASETEXTURE2;
  113. #endif
  114. public:
  115. void SetBASETEXTURE2( int i )
  116. {
  117. Assert( i >= 0 && i <= 1 );
  118. m_nBASETEXTURE2 = i;
  119. #ifdef _DEBUG
  120. m_bBASETEXTURE2 = true;
  121. #endif
  122. }
  123. void SetBASETEXTURE2( bool i )
  124. {
  125. m_nBASETEXTURE2 = i ? 1 : 0;
  126. #ifdef _DEBUG
  127. m_bBASETEXTURE2 = true;
  128. #endif
  129. }
  130. private:
  131. int m_nSTRIPES;
  132. #ifdef _DEBUG
  133. bool m_bSTRIPES;
  134. #endif
  135. public:
  136. void SetSTRIPES( int i )
  137. {
  138. Assert( i >= 0 && i <= 1 );
  139. m_nSTRIPES = i;
  140. #ifdef _DEBUG
  141. m_bSTRIPES = true;
  142. #endif
  143. }
  144. void SetSTRIPES( bool i )
  145. {
  146. m_nSTRIPES = i ? 1 : 0;
  147. #ifdef _DEBUG
  148. m_bSTRIPES = true;
  149. #endif
  150. }
  151. private:
  152. int m_nSTRIPES_USE_NORMAL2;
  153. #ifdef _DEBUG
  154. bool m_bSTRIPES_USE_NORMAL2;
  155. #endif
  156. public:
  157. void SetSTRIPES_USE_NORMAL2( int i )
  158. {
  159. Assert( i >= 0 && i <= 1 );
  160. m_nSTRIPES_USE_NORMAL2 = i;
  161. #ifdef _DEBUG
  162. m_bSTRIPES_USE_NORMAL2 = true;
  163. #endif
  164. }
  165. void SetSTRIPES_USE_NORMAL2( bool i )
  166. {
  167. m_nSTRIPES_USE_NORMAL2 = i ? 1 : 0;
  168. #ifdef _DEBUG
  169. m_bSTRIPES_USE_NORMAL2 = true;
  170. #endif
  171. }
  172. public:
  173. pyro_vision_vs30_Static_Index( )
  174. {
  175. #ifdef _DEBUG
  176. m_bEFFECT = false;
  177. #endif // _DEBUG
  178. m_nEFFECT = 0;
  179. #ifdef _DEBUG
  180. m_bVERTEXCOLOR = false;
  181. #endif // _DEBUG
  182. m_nVERTEXCOLOR = 0;
  183. #ifdef _DEBUG
  184. m_bHALFLAMBERT = false;
  185. #endif // _DEBUG
  186. m_nHALFLAMBERT = 0;
  187. #ifdef _DEBUG
  188. m_bVERTEX_LIT = false;
  189. #endif // _DEBUG
  190. m_nVERTEX_LIT = 0;
  191. #ifdef _DEBUG
  192. m_bFULLBRIGHT = false;
  193. #endif // _DEBUG
  194. m_nFULLBRIGHT = 0;
  195. #ifdef _DEBUG
  196. m_bBASETEXTURE2 = false;
  197. #endif // _DEBUG
  198. m_nBASETEXTURE2 = 0;
  199. #ifdef _DEBUG
  200. m_bSTRIPES = false;
  201. #endif // _DEBUG
  202. m_nSTRIPES = 0;
  203. #ifdef _DEBUG
  204. m_bSTRIPES_USE_NORMAL2 = false;
  205. #endif // _DEBUG
  206. m_nSTRIPES_USE_NORMAL2 = 0;
  207. }
  208. int GetIndex()
  209. {
  210. // Asserts to make sure that we aren't using any skipped combinations.
  211. // Asserts to make sure that we are setting all of the combination vars.
  212. #ifdef _DEBUG
  213. bool bAllStaticVarsDefined = m_bEFFECT && m_bVERTEXCOLOR && m_bHALFLAMBERT && m_bVERTEX_LIT && m_bFULLBRIGHT && m_bBASETEXTURE2 && m_bSTRIPES && m_bSTRIPES_USE_NORMAL2;
  214. Assert( bAllStaticVarsDefined );
  215. #endif // _DEBUG
  216. return ( 16 * m_nEFFECT ) + ( 64 * m_nVERTEXCOLOR ) + ( 128 * m_nHALFLAMBERT ) + ( 256 * m_nVERTEX_LIT ) + ( 512 * m_nFULLBRIGHT ) + ( 1024 * m_nBASETEXTURE2 ) + ( 2048 * m_nSTRIPES ) + ( 4096 * m_nSTRIPES_USE_NORMAL2 ) + 0;
  217. }
  218. };
  219. #define shaderStaticTest_pyro_vision_vs30 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_BASETEXTURE2 + vsh_forgot_to_set_static_STRIPES + vsh_forgot_to_set_static_STRIPES_USE_NORMAL2 + 0
  220. class pyro_vision_vs30_Dynamic_Index
  221. {
  222. private:
  223. int m_nCOMPRESSED_VERTS;
  224. #ifdef _DEBUG
  225. bool m_bCOMPRESSED_VERTS;
  226. #endif
  227. public:
  228. void SetCOMPRESSED_VERTS( int i )
  229. {
  230. Assert( i >= 0 && i <= 1 );
  231. m_nCOMPRESSED_VERTS = i;
  232. #ifdef _DEBUG
  233. m_bCOMPRESSED_VERTS = true;
  234. #endif
  235. }
  236. void SetCOMPRESSED_VERTS( bool i )
  237. {
  238. m_nCOMPRESSED_VERTS = i ? 1 : 0;
  239. #ifdef _DEBUG
  240. m_bCOMPRESSED_VERTS = true;
  241. #endif
  242. }
  243. private:
  244. int m_nSKINNING;
  245. #ifdef _DEBUG
  246. bool m_bSKINNING;
  247. #endif
  248. public:
  249. void SetSKINNING( int i )
  250. {
  251. Assert( i >= 0 && i <= 1 );
  252. m_nSKINNING = i;
  253. #ifdef _DEBUG
  254. m_bSKINNING = true;
  255. #endif
  256. }
  257. void SetSKINNING( bool i )
  258. {
  259. m_nSKINNING = i ? 1 : 0;
  260. #ifdef _DEBUG
  261. m_bSKINNING = true;
  262. #endif
  263. }
  264. private:
  265. int m_nDYNAMIC_LIGHT;
  266. #ifdef _DEBUG
  267. bool m_bDYNAMIC_LIGHT;
  268. #endif
  269. public:
  270. void SetDYNAMIC_LIGHT( int i )
  271. {
  272. Assert( i >= 0 && i <= 1 );
  273. m_nDYNAMIC_LIGHT = i;
  274. #ifdef _DEBUG
  275. m_bDYNAMIC_LIGHT = true;
  276. #endif
  277. }
  278. void SetDYNAMIC_LIGHT( bool i )
  279. {
  280. m_nDYNAMIC_LIGHT = i ? 1 : 0;
  281. #ifdef _DEBUG
  282. m_bDYNAMIC_LIGHT = true;
  283. #endif
  284. }
  285. private:
  286. int m_nSTATIC_LIGHT;
  287. #ifdef _DEBUG
  288. bool m_bSTATIC_LIGHT;
  289. #endif
  290. public:
  291. void SetSTATIC_LIGHT( int i )
  292. {
  293. Assert( i >= 0 && i <= 1 );
  294. m_nSTATIC_LIGHT = i;
  295. #ifdef _DEBUG
  296. m_bSTATIC_LIGHT = true;
  297. #endif
  298. }
  299. void SetSTATIC_LIGHT( bool i )
  300. {
  301. m_nSTATIC_LIGHT = i ? 1 : 0;
  302. #ifdef _DEBUG
  303. m_bSTATIC_LIGHT = true;
  304. #endif
  305. }
  306. public:
  307. pyro_vision_vs30_Dynamic_Index()
  308. {
  309. #ifdef _DEBUG
  310. m_bCOMPRESSED_VERTS = false;
  311. #endif // _DEBUG
  312. m_nCOMPRESSED_VERTS = 0;
  313. #ifdef _DEBUG
  314. m_bSKINNING = false;
  315. #endif // _DEBUG
  316. m_nSKINNING = 0;
  317. #ifdef _DEBUG
  318. m_bDYNAMIC_LIGHT = false;
  319. #endif // _DEBUG
  320. m_nDYNAMIC_LIGHT = 0;
  321. #ifdef _DEBUG
  322. m_bSTATIC_LIGHT = false;
  323. #endif // _DEBUG
  324. m_nSTATIC_LIGHT = 0;
  325. }
  326. int GetIndex()
  327. {
  328. // Asserts to make sure that we aren't using any skipped combinations.
  329. // Asserts to make sure that we are setting all of the combination vars.
  330. #ifdef _DEBUG
  331. bool bAllDynamicVarsDefined = m_bCOMPRESSED_VERTS && m_bSKINNING && m_bDYNAMIC_LIGHT && m_bSTATIC_LIGHT;
  332. Assert( bAllDynamicVarsDefined );
  333. #endif // _DEBUG
  334. return ( 1 * m_nCOMPRESSED_VERTS ) + ( 2 * m_nSKINNING ) + ( 4 * m_nDYNAMIC_LIGHT ) + ( 8 * m_nSTATIC_LIGHT ) + 0;
  335. }
  336. };
  337. #define shaderDynamicTest_pyro_vision_vs30 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 + 0