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.8 KiB

  1. #include "shaderlib/cshader.h"
  2. class lightmappedgeneric_vs20_Static_Index
  3. {
  4. private:
  5. int m_nENVMAP_MASK;
  6. #ifdef _DEBUG
  7. bool m_bENVMAP_MASK;
  8. #endif
  9. public:
  10. void SetENVMAP_MASK( int i )
  11. {
  12. Assert( i >= 0 && i <= 1 );
  13. m_nENVMAP_MASK = i;
  14. #ifdef _DEBUG
  15. m_bENVMAP_MASK = true;
  16. #endif
  17. }
  18. void SetENVMAP_MASK( bool i )
  19. {
  20. m_nENVMAP_MASK = i ? 1 : 0;
  21. #ifdef _DEBUG
  22. m_bENVMAP_MASK = true;
  23. #endif
  24. }
  25. private:
  26. int m_nTANGENTSPACE;
  27. #ifdef _DEBUG
  28. bool m_bTANGENTSPACE;
  29. #endif
  30. public:
  31. void SetTANGENTSPACE( int i )
  32. {
  33. Assert( i >= 0 && i <= 1 );
  34. m_nTANGENTSPACE = i;
  35. #ifdef _DEBUG
  36. m_bTANGENTSPACE = true;
  37. #endif
  38. }
  39. void SetTANGENTSPACE( bool i )
  40. {
  41. m_nTANGENTSPACE = i ? 1 : 0;
  42. #ifdef _DEBUG
  43. m_bTANGENTSPACE = true;
  44. #endif
  45. }
  46. private:
  47. int m_nBUMPMAP;
  48. #ifdef _DEBUG
  49. bool m_bBUMPMAP;
  50. #endif
  51. public:
  52. void SetBUMPMAP( int i )
  53. {
  54. Assert( i >= 0 && i <= 1 );
  55. m_nBUMPMAP = i;
  56. #ifdef _DEBUG
  57. m_bBUMPMAP = true;
  58. #endif
  59. }
  60. void SetBUMPMAP( bool i )
  61. {
  62. m_nBUMPMAP = i ? 1 : 0;
  63. #ifdef _DEBUG
  64. m_bBUMPMAP = true;
  65. #endif
  66. }
  67. private:
  68. int m_nDIFFUSEBUMPMAP;
  69. #ifdef _DEBUG
  70. bool m_bDIFFUSEBUMPMAP;
  71. #endif
  72. public:
  73. void SetDIFFUSEBUMPMAP( int i )
  74. {
  75. Assert( i >= 0 && i <= 1 );
  76. m_nDIFFUSEBUMPMAP = i;
  77. #ifdef _DEBUG
  78. m_bDIFFUSEBUMPMAP = true;
  79. #endif
  80. }
  81. void SetDIFFUSEBUMPMAP( bool i )
  82. {
  83. m_nDIFFUSEBUMPMAP = i ? 1 : 0;
  84. #ifdef _DEBUG
  85. m_bDIFFUSEBUMPMAP = true;
  86. #endif
  87. }
  88. private:
  89. int m_nVERTEXCOLOR;
  90. #ifdef _DEBUG
  91. bool m_bVERTEXCOLOR;
  92. #endif
  93. public:
  94. void SetVERTEXCOLOR( int i )
  95. {
  96. Assert( i >= 0 && i <= 1 );
  97. m_nVERTEXCOLOR = i;
  98. #ifdef _DEBUG
  99. m_bVERTEXCOLOR = true;
  100. #endif
  101. }
  102. void SetVERTEXCOLOR( bool i )
  103. {
  104. m_nVERTEXCOLOR = i ? 1 : 0;
  105. #ifdef _DEBUG
  106. m_bVERTEXCOLOR = true;
  107. #endif
  108. }
  109. private:
  110. int m_nVERTEXALPHATEXBLENDFACTOR;
  111. #ifdef _DEBUG
  112. bool m_bVERTEXALPHATEXBLENDFACTOR;
  113. #endif
  114. public:
  115. void SetVERTEXALPHATEXBLENDFACTOR( int i )
  116. {
  117. Assert( i >= 0 && i <= 1 );
  118. m_nVERTEXALPHATEXBLENDFACTOR = i;
  119. #ifdef _DEBUG
  120. m_bVERTEXALPHATEXBLENDFACTOR = true;
  121. #endif
  122. }
  123. void SetVERTEXALPHATEXBLENDFACTOR( bool i )
  124. {
  125. m_nVERTEXALPHATEXBLENDFACTOR = i ? 1 : 0;
  126. #ifdef _DEBUG
  127. m_bVERTEXALPHATEXBLENDFACTOR = true;
  128. #endif
  129. }
  130. private:
  131. int m_nRELIEF_MAPPING;
  132. #ifdef _DEBUG
  133. bool m_bRELIEF_MAPPING;
  134. #endif
  135. public:
  136. void SetRELIEF_MAPPING( int i )
  137. {
  138. Assert( i >= 0 && i <= 0 );
  139. m_nRELIEF_MAPPING = i;
  140. #ifdef _DEBUG
  141. m_bRELIEF_MAPPING = true;
  142. #endif
  143. }
  144. void SetRELIEF_MAPPING( bool i )
  145. {
  146. m_nRELIEF_MAPPING = i ? 1 : 0;
  147. #ifdef _DEBUG
  148. m_bRELIEF_MAPPING = true;
  149. #endif
  150. }
  151. private:
  152. int m_nSEAMLESS;
  153. #ifdef _DEBUG
  154. bool m_bSEAMLESS;
  155. #endif
  156. public:
  157. void SetSEAMLESS( int i )
  158. {
  159. Assert( i >= 0 && i <= 1 );
  160. m_nSEAMLESS = i;
  161. #ifdef _DEBUG
  162. m_bSEAMLESS = true;
  163. #endif
  164. }
  165. void SetSEAMLESS( bool i )
  166. {
  167. m_nSEAMLESS = i ? 1 : 0;
  168. #ifdef _DEBUG
  169. m_bSEAMLESS = true;
  170. #endif
  171. }
  172. private:
  173. int m_nBUMPMASK;
  174. #ifdef _DEBUG
  175. bool m_bBUMPMASK;
  176. #endif
  177. public:
  178. void SetBUMPMASK( int i )
  179. {
  180. Assert( i >= 0 && i <= 1 );
  181. m_nBUMPMASK = i;
  182. #ifdef _DEBUG
  183. m_bBUMPMASK = true;
  184. #endif
  185. }
  186. void SetBUMPMASK( bool i )
  187. {
  188. m_nBUMPMASK = i ? 1 : 0;
  189. #ifdef _DEBUG
  190. m_bBUMPMASK = true;
  191. #endif
  192. }
  193. public:
  194. lightmappedgeneric_vs20_Static_Index( )
  195. {
  196. #ifdef _DEBUG
  197. m_bENVMAP_MASK = false;
  198. #endif // _DEBUG
  199. m_nENVMAP_MASK = 0;
  200. #ifdef _DEBUG
  201. m_bTANGENTSPACE = false;
  202. #endif // _DEBUG
  203. m_nTANGENTSPACE = 0;
  204. #ifdef _DEBUG
  205. m_bBUMPMAP = false;
  206. #endif // _DEBUG
  207. m_nBUMPMAP = 0;
  208. #ifdef _DEBUG
  209. m_bDIFFUSEBUMPMAP = false;
  210. #endif // _DEBUG
  211. m_nDIFFUSEBUMPMAP = 0;
  212. #ifdef _DEBUG
  213. m_bVERTEXCOLOR = false;
  214. #endif // _DEBUG
  215. m_nVERTEXCOLOR = 0;
  216. #ifdef _DEBUG
  217. m_bVERTEXALPHATEXBLENDFACTOR = false;
  218. #endif // _DEBUG
  219. m_nVERTEXALPHATEXBLENDFACTOR = 0;
  220. #ifdef _DEBUG
  221. m_bRELIEF_MAPPING = false;
  222. #endif // _DEBUG
  223. m_nRELIEF_MAPPING = 0;
  224. #ifdef _DEBUG
  225. m_bSEAMLESS = false;
  226. #endif // _DEBUG
  227. m_nSEAMLESS = 0;
  228. #ifdef _DEBUG
  229. m_bBUMPMASK = false;
  230. #endif // _DEBUG
  231. m_nBUMPMASK = 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_bENVMAP_MASK && m_bTANGENTSPACE && m_bBUMPMAP && m_bDIFFUSEBUMPMAP && m_bVERTEXCOLOR && m_bVERTEXALPHATEXBLENDFACTOR && m_bRELIEF_MAPPING && m_bSEAMLESS && m_bBUMPMASK;
  239. Assert( bAllStaticVarsDefined );
  240. #endif // _DEBUG
  241. return ( 8 * m_nENVMAP_MASK ) + ( 16 * m_nTANGENTSPACE ) + ( 32 * m_nBUMPMAP ) + ( 64 * m_nDIFFUSEBUMPMAP ) + ( 128 * m_nVERTEXCOLOR ) + ( 256 * m_nVERTEXALPHATEXBLENDFACTOR ) + ( 512 * m_nRELIEF_MAPPING ) + ( 512 * m_nSEAMLESS ) + ( 1024 * m_nBUMPMASK ) + 0;
  242. }
  243. };
  244. #define shaderStaticTest_lightmappedgeneric_vs20 vsh_forgot_to_set_static_ENVMAP_MASK + vsh_forgot_to_set_static_TANGENTSPACE + vsh_forgot_to_set_static_BUMPMAP + vsh_forgot_to_set_static_DIFFUSEBUMPMAP + vsh_forgot_to_set_static_VERTEXCOLOR + vsh_forgot_to_set_static_VERTEXALPHATEXBLENDFACTOR + vsh_forgot_to_set_static_RELIEF_MAPPING + vsh_forgot_to_set_static_SEAMLESS + vsh_forgot_to_set_static_BUMPMASK + 0
  245. class lightmappedgeneric_vs20_Dynamic_Index
  246. {
  247. private:
  248. int m_nFASTPATH;
  249. #ifdef _DEBUG
  250. bool m_bFASTPATH;
  251. #endif
  252. public:
  253. void SetFASTPATH( int i )
  254. {
  255. Assert( i >= 0 && i <= 1 );
  256. m_nFASTPATH = i;
  257. #ifdef _DEBUG
  258. m_bFASTPATH = true;
  259. #endif
  260. }
  261. void SetFASTPATH( bool i )
  262. {
  263. m_nFASTPATH = i ? 1 : 0;
  264. #ifdef _DEBUG
  265. m_bFASTPATH = true;
  266. #endif
  267. }
  268. private:
  269. int m_nDOWATERFOG;
  270. #ifdef _DEBUG
  271. bool m_bDOWATERFOG;
  272. #endif
  273. public:
  274. void SetDOWATERFOG( int i )
  275. {
  276. Assert( i >= 0 && i <= 1 );
  277. m_nDOWATERFOG = i;
  278. #ifdef _DEBUG
  279. m_bDOWATERFOG = true;
  280. #endif
  281. }
  282. void SetDOWATERFOG( bool i )
  283. {
  284. m_nDOWATERFOG = i ? 1 : 0;
  285. #ifdef _DEBUG
  286. m_bDOWATERFOG = true;
  287. #endif
  288. }
  289. private:
  290. int m_nLIGHTING_PREVIEW;
  291. #ifdef _DEBUG
  292. bool m_bLIGHTING_PREVIEW;
  293. #endif
  294. public:
  295. void SetLIGHTING_PREVIEW( int i )
  296. {
  297. Assert( i >= 0 && i <= 1 );
  298. m_nLIGHTING_PREVIEW = i;
  299. #ifdef _DEBUG
  300. m_bLIGHTING_PREVIEW = true;
  301. #endif
  302. }
  303. void SetLIGHTING_PREVIEW( bool i )
  304. {
  305. m_nLIGHTING_PREVIEW = i ? 1 : 0;
  306. #ifdef _DEBUG
  307. m_bLIGHTING_PREVIEW = true;
  308. #endif
  309. }
  310. public:
  311. lightmappedgeneric_vs20_Dynamic_Index()
  312. {
  313. #ifdef _DEBUG
  314. m_bFASTPATH = false;
  315. #endif // _DEBUG
  316. m_nFASTPATH = 0;
  317. #ifdef _DEBUG
  318. m_bDOWATERFOG = false;
  319. #endif // _DEBUG
  320. m_nDOWATERFOG = 0;
  321. #ifdef _DEBUG
  322. m_bLIGHTING_PREVIEW = false;
  323. #endif // _DEBUG
  324. m_nLIGHTING_PREVIEW = 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_bFASTPATH && m_bDOWATERFOG && m_bLIGHTING_PREVIEW;
  332. Assert( bAllDynamicVarsDefined );
  333. #endif // _DEBUG
  334. return ( 1 * m_nFASTPATH ) + ( 2 * m_nDOWATERFOG ) + ( 4 * m_nLIGHTING_PREVIEW ) + 0;
  335. }
  336. };
  337. #define shaderDynamicTest_lightmappedgeneric_vs20 vsh_forgot_to_set_dynamic_FASTPATH + vsh_forgot_to_set_dynamic_DOWATERFOG + vsh_forgot_to_set_dynamic_LIGHTING_PREVIEW + 0