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.

312 lines
6.5 KiB

  1. #include "shaderlib/cshader.h"
  2. class worldtwotextureblend_ps20_Static_Index
  3. {
  4. private:
  5. int m_nCONVERT_TO_SRGB;
  6. #ifdef _DEBUG
  7. bool m_bCONVERT_TO_SRGB;
  8. #endif
  9. public:
  10. void SetCONVERT_TO_SRGB( int i )
  11. {
  12. Assert( i >= 0 && i <= 0 );
  13. m_nCONVERT_TO_SRGB = i;
  14. #ifdef _DEBUG
  15. m_bCONVERT_TO_SRGB = true;
  16. #endif
  17. }
  18. void SetCONVERT_TO_SRGB( bool i )
  19. {
  20. m_nCONVERT_TO_SRGB = i ? 1 : 0;
  21. #ifdef _DEBUG
  22. m_bCONVERT_TO_SRGB = true;
  23. #endif
  24. }
  25. private:
  26. int m_nDETAILTEXTURE;
  27. #ifdef _DEBUG
  28. bool m_bDETAILTEXTURE;
  29. #endif
  30. public:
  31. void SetDETAILTEXTURE( int i )
  32. {
  33. Assert( i >= 0 && i <= 1 );
  34. m_nDETAILTEXTURE = i;
  35. #ifdef _DEBUG
  36. m_bDETAILTEXTURE = true;
  37. #endif
  38. }
  39. void SetDETAILTEXTURE( bool i )
  40. {
  41. m_nDETAILTEXTURE = i ? 1 : 0;
  42. #ifdef _DEBUG
  43. m_bDETAILTEXTURE = 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_nVERTEXCOLOR;
  69. #ifdef _DEBUG
  70. bool m_bVERTEXCOLOR;
  71. #endif
  72. public:
  73. void SetVERTEXCOLOR( int i )
  74. {
  75. Assert( i >= 0 && i <= 1 );
  76. m_nVERTEXCOLOR = i;
  77. #ifdef _DEBUG
  78. m_bVERTEXCOLOR = true;
  79. #endif
  80. }
  81. void SetVERTEXCOLOR( bool i )
  82. {
  83. m_nVERTEXCOLOR = i ? 1 : 0;
  84. #ifdef _DEBUG
  85. m_bVERTEXCOLOR = true;
  86. #endif
  87. }
  88. private:
  89. int m_nSELFILLUM;
  90. #ifdef _DEBUG
  91. bool m_bSELFILLUM;
  92. #endif
  93. public:
  94. void SetSELFILLUM( int i )
  95. {
  96. Assert( i >= 0 && i <= 1 );
  97. m_nSELFILLUM = i;
  98. #ifdef _DEBUG
  99. m_bSELFILLUM = true;
  100. #endif
  101. }
  102. void SetSELFILLUM( bool i )
  103. {
  104. m_nSELFILLUM = i ? 1 : 0;
  105. #ifdef _DEBUG
  106. m_bSELFILLUM = true;
  107. #endif
  108. }
  109. private:
  110. int m_nDIFFUSEBUMPMAP;
  111. #ifdef _DEBUG
  112. bool m_bDIFFUSEBUMPMAP;
  113. #endif
  114. public:
  115. void SetDIFFUSEBUMPMAP( int i )
  116. {
  117. Assert( i >= 0 && i <= 1 );
  118. m_nDIFFUSEBUMPMAP = i;
  119. #ifdef _DEBUG
  120. m_bDIFFUSEBUMPMAP = true;
  121. #endif
  122. }
  123. void SetDIFFUSEBUMPMAP( bool i )
  124. {
  125. m_nDIFFUSEBUMPMAP = i ? 1 : 0;
  126. #ifdef _DEBUG
  127. m_bDIFFUSEBUMPMAP = true;
  128. #endif
  129. }
  130. private:
  131. int m_nDETAIL_ALPHA_MASK_BASE_TEXTURE;
  132. #ifdef _DEBUG
  133. bool m_bDETAIL_ALPHA_MASK_BASE_TEXTURE;
  134. #endif
  135. public:
  136. void SetDETAIL_ALPHA_MASK_BASE_TEXTURE( int i )
  137. {
  138. Assert( i >= 0 && i <= 1 );
  139. m_nDETAIL_ALPHA_MASK_BASE_TEXTURE = i;
  140. #ifdef _DEBUG
  141. m_bDETAIL_ALPHA_MASK_BASE_TEXTURE = true;
  142. #endif
  143. }
  144. void SetDETAIL_ALPHA_MASK_BASE_TEXTURE( bool i )
  145. {
  146. m_nDETAIL_ALPHA_MASK_BASE_TEXTURE = i ? 1 : 0;
  147. #ifdef _DEBUG
  148. m_bDETAIL_ALPHA_MASK_BASE_TEXTURE = true;
  149. #endif
  150. }
  151. private:
  152. int m_nFLASHLIGHT;
  153. #ifdef _DEBUG
  154. bool m_bFLASHLIGHT;
  155. #endif
  156. public:
  157. void SetFLASHLIGHT( int i )
  158. {
  159. Assert( i >= 0 && i <= 1 );
  160. m_nFLASHLIGHT = i;
  161. #ifdef _DEBUG
  162. m_bFLASHLIGHT = true;
  163. #endif
  164. }
  165. void SetFLASHLIGHT( bool i )
  166. {
  167. m_nFLASHLIGHT = i ? 1 : 0;
  168. #ifdef _DEBUG
  169. m_bFLASHLIGHT = true;
  170. #endif
  171. }
  172. private:
  173. int m_nSEAMLESS;
  174. #ifdef _DEBUG
  175. bool m_bSEAMLESS;
  176. #endif
  177. public:
  178. void SetSEAMLESS( int i )
  179. {
  180. Assert( i >= 0 && i <= 1 );
  181. m_nSEAMLESS = i;
  182. #ifdef _DEBUG
  183. m_bSEAMLESS = true;
  184. #endif
  185. }
  186. void SetSEAMLESS( bool i )
  187. {
  188. m_nSEAMLESS = i ? 1 : 0;
  189. #ifdef _DEBUG
  190. m_bSEAMLESS = true;
  191. #endif
  192. }
  193. public:
  194. worldtwotextureblend_ps20_Static_Index( )
  195. {
  196. #ifdef _DEBUG
  197. m_bCONVERT_TO_SRGB = true;
  198. #endif // _DEBUG
  199. m_nCONVERT_TO_SRGB = 0;
  200. #ifdef _DEBUG
  201. m_bDETAILTEXTURE = false;
  202. #endif // _DEBUG
  203. m_nDETAILTEXTURE = 0;
  204. #ifdef _DEBUG
  205. m_bBUMPMAP = false;
  206. #endif // _DEBUG
  207. m_nBUMPMAP = 0;
  208. #ifdef _DEBUG
  209. m_bVERTEXCOLOR = false;
  210. #endif // _DEBUG
  211. m_nVERTEXCOLOR = 0;
  212. #ifdef _DEBUG
  213. m_bSELFILLUM = false;
  214. #endif // _DEBUG
  215. m_nSELFILLUM = 0;
  216. #ifdef _DEBUG
  217. m_bDIFFUSEBUMPMAP = false;
  218. #endif // _DEBUG
  219. m_nDIFFUSEBUMPMAP = 0;
  220. #ifdef _DEBUG
  221. m_bDETAIL_ALPHA_MASK_BASE_TEXTURE = false;
  222. #endif // _DEBUG
  223. m_nDETAIL_ALPHA_MASK_BASE_TEXTURE = 0;
  224. #ifdef _DEBUG
  225. m_bFLASHLIGHT = false;
  226. #endif // _DEBUG
  227. m_nFLASHLIGHT = 0;
  228. #ifdef _DEBUG
  229. m_bSEAMLESS = false;
  230. #endif // _DEBUG
  231. m_nSEAMLESS = 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_bCONVERT_TO_SRGB && m_bDETAILTEXTURE && m_bBUMPMAP && m_bVERTEXCOLOR && m_bSELFILLUM && m_bDIFFUSEBUMPMAP && m_bDETAIL_ALPHA_MASK_BASE_TEXTURE && m_bFLASHLIGHT && m_bSEAMLESS;
  239. Assert( bAllStaticVarsDefined );
  240. #endif // _DEBUG
  241. return ( 4 * m_nCONVERT_TO_SRGB ) + ( 4 * m_nDETAILTEXTURE ) + ( 8 * m_nBUMPMAP ) + ( 16 * m_nVERTEXCOLOR ) + ( 32 * m_nSELFILLUM ) + ( 64 * m_nDIFFUSEBUMPMAP ) + ( 128 * m_nDETAIL_ALPHA_MASK_BASE_TEXTURE ) + ( 256 * m_nFLASHLIGHT ) + ( 512 * m_nSEAMLESS ) + 0;
  242. }
  243. };
  244. #define shaderStaticTest_worldtwotextureblend_ps20 psh_forgot_to_set_static_DETAILTEXTURE + psh_forgot_to_set_static_BUMPMAP + psh_forgot_to_set_static_VERTEXCOLOR + psh_forgot_to_set_static_SELFILLUM + psh_forgot_to_set_static_DIFFUSEBUMPMAP + psh_forgot_to_set_static_DETAIL_ALPHA_MASK_BASE_TEXTURE + psh_forgot_to_set_static_FLASHLIGHT + psh_forgot_to_set_static_SEAMLESS + 0
  245. class worldtwotextureblend_ps20_Dynamic_Index
  246. {
  247. private:
  248. int m_nWRITEWATERFOGTODESTALPHA;
  249. #ifdef _DEBUG
  250. bool m_bWRITEWATERFOGTODESTALPHA;
  251. #endif
  252. public:
  253. void SetWRITEWATERFOGTODESTALPHA( int i )
  254. {
  255. Assert( i >= 0 && i <= 1 );
  256. m_nWRITEWATERFOGTODESTALPHA = i;
  257. #ifdef _DEBUG
  258. m_bWRITEWATERFOGTODESTALPHA = true;
  259. #endif
  260. }
  261. void SetWRITEWATERFOGTODESTALPHA( bool i )
  262. {
  263. m_nWRITEWATERFOGTODESTALPHA = i ? 1 : 0;
  264. #ifdef _DEBUG
  265. m_bWRITEWATERFOGTODESTALPHA = true;
  266. #endif
  267. }
  268. private:
  269. int m_nPIXELFOGTYPE;
  270. #ifdef _DEBUG
  271. bool m_bPIXELFOGTYPE;
  272. #endif
  273. public:
  274. void SetPIXELFOGTYPE( int i )
  275. {
  276. Assert( i >= 0 && i <= 1 );
  277. m_nPIXELFOGTYPE = i;
  278. #ifdef _DEBUG
  279. m_bPIXELFOGTYPE = true;
  280. #endif
  281. }
  282. void SetPIXELFOGTYPE( bool i )
  283. {
  284. m_nPIXELFOGTYPE = i ? 1 : 0;
  285. #ifdef _DEBUG
  286. m_bPIXELFOGTYPE = true;
  287. #endif
  288. }
  289. public:
  290. worldtwotextureblend_ps20_Dynamic_Index()
  291. {
  292. #ifdef _DEBUG
  293. m_bWRITEWATERFOGTODESTALPHA = false;
  294. #endif // _DEBUG
  295. m_nWRITEWATERFOGTODESTALPHA = 0;
  296. #ifdef _DEBUG
  297. m_bPIXELFOGTYPE = false;
  298. #endif // _DEBUG
  299. m_nPIXELFOGTYPE = 0;
  300. }
  301. int GetIndex()
  302. {
  303. // Asserts to make sure that we aren't using any skipped combinations.
  304. // Asserts to make sure that we are setting all of the combination vars.
  305. #ifdef _DEBUG
  306. bool bAllDynamicVarsDefined = m_bWRITEWATERFOGTODESTALPHA && m_bPIXELFOGTYPE;
  307. Assert( bAllDynamicVarsDefined );
  308. #endif // _DEBUG
  309. return ( 1 * m_nWRITEWATERFOGTODESTALPHA ) + ( 2 * m_nPIXELFOGTYPE ) + 0;
  310. }
  311. };
  312. #define shaderDynamicTest_worldtwotextureblend_ps20 psh_forgot_to_set_dynamic_WRITEWATERFOGTODESTALPHA + psh_forgot_to_set_dynamic_PIXELFOGTYPE + 0