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.

287 lines
6.0 KiB

  1. #include "shaderlib/cshader.h"
  2. class worldtwotextureblend_ps20_Static_Index
  3. {
  4. private:
  5. int m_nDETAILTEXTURE;
  6. #ifdef _DEBUG
  7. bool m_bDETAILTEXTURE;
  8. #endif
  9. public:
  10. void SetDETAILTEXTURE( int i )
  11. {
  12. Assert( i >= 0 && i <= 1 );
  13. m_nDETAILTEXTURE = i;
  14. #ifdef _DEBUG
  15. m_bDETAILTEXTURE = true;
  16. #endif
  17. }
  18. void SetDETAILTEXTURE( bool i )
  19. {
  20. m_nDETAILTEXTURE = i ? 1 : 0;
  21. #ifdef _DEBUG
  22. m_bDETAILTEXTURE = true;
  23. #endif
  24. }
  25. private:
  26. int m_nBUMPMAP;
  27. #ifdef _DEBUG
  28. bool m_bBUMPMAP;
  29. #endif
  30. public:
  31. void SetBUMPMAP( int i )
  32. {
  33. Assert( i >= 0 && i <= 1 );
  34. m_nBUMPMAP = i;
  35. #ifdef _DEBUG
  36. m_bBUMPMAP = true;
  37. #endif
  38. }
  39. void SetBUMPMAP( bool i )
  40. {
  41. m_nBUMPMAP = i ? 1 : 0;
  42. #ifdef _DEBUG
  43. m_bBUMPMAP = true;
  44. #endif
  45. }
  46. private:
  47. int m_nVERTEXCOLOR;
  48. #ifdef _DEBUG
  49. bool m_bVERTEXCOLOR;
  50. #endif
  51. public:
  52. void SetVERTEXCOLOR( int i )
  53. {
  54. Assert( i >= 0 && i <= 1 );
  55. m_nVERTEXCOLOR = i;
  56. #ifdef _DEBUG
  57. m_bVERTEXCOLOR = true;
  58. #endif
  59. }
  60. void SetVERTEXCOLOR( bool i )
  61. {
  62. m_nVERTEXCOLOR = i ? 1 : 0;
  63. #ifdef _DEBUG
  64. m_bVERTEXCOLOR = true;
  65. #endif
  66. }
  67. private:
  68. int m_nSELFILLUM;
  69. #ifdef _DEBUG
  70. bool m_bSELFILLUM;
  71. #endif
  72. public:
  73. void SetSELFILLUM( int i )
  74. {
  75. Assert( i >= 0 && i <= 1 );
  76. m_nSELFILLUM = i;
  77. #ifdef _DEBUG
  78. m_bSELFILLUM = true;
  79. #endif
  80. }
  81. void SetSELFILLUM( bool i )
  82. {
  83. m_nSELFILLUM = i ? 1 : 0;
  84. #ifdef _DEBUG
  85. m_bSELFILLUM = true;
  86. #endif
  87. }
  88. private:
  89. int m_nDIFFUSEBUMPMAP;
  90. #ifdef _DEBUG
  91. bool m_bDIFFUSEBUMPMAP;
  92. #endif
  93. public:
  94. void SetDIFFUSEBUMPMAP( int i )
  95. {
  96. Assert( i >= 0 && i <= 1 );
  97. m_nDIFFUSEBUMPMAP = i;
  98. #ifdef _DEBUG
  99. m_bDIFFUSEBUMPMAP = true;
  100. #endif
  101. }
  102. void SetDIFFUSEBUMPMAP( bool i )
  103. {
  104. m_nDIFFUSEBUMPMAP = i ? 1 : 0;
  105. #ifdef _DEBUG
  106. m_bDIFFUSEBUMPMAP = true;
  107. #endif
  108. }
  109. private:
  110. int m_nDETAIL_ALPHA_MASK_BASE_TEXTURE;
  111. #ifdef _DEBUG
  112. bool m_bDETAIL_ALPHA_MASK_BASE_TEXTURE;
  113. #endif
  114. public:
  115. void SetDETAIL_ALPHA_MASK_BASE_TEXTURE( int i )
  116. {
  117. Assert( i >= 0 && i <= 1 );
  118. m_nDETAIL_ALPHA_MASK_BASE_TEXTURE = i;
  119. #ifdef _DEBUG
  120. m_bDETAIL_ALPHA_MASK_BASE_TEXTURE = true;
  121. #endif
  122. }
  123. void SetDETAIL_ALPHA_MASK_BASE_TEXTURE( bool i )
  124. {
  125. m_nDETAIL_ALPHA_MASK_BASE_TEXTURE = i ? 1 : 0;
  126. #ifdef _DEBUG
  127. m_bDETAIL_ALPHA_MASK_BASE_TEXTURE = true;
  128. #endif
  129. }
  130. private:
  131. int m_nFLASHLIGHT;
  132. #ifdef _DEBUG
  133. bool m_bFLASHLIGHT;
  134. #endif
  135. public:
  136. void SetFLASHLIGHT( int i )
  137. {
  138. Assert( i >= 0 && i <= 1 );
  139. m_nFLASHLIGHT = i;
  140. #ifdef _DEBUG
  141. m_bFLASHLIGHT = true;
  142. #endif
  143. }
  144. void SetFLASHLIGHT( bool i )
  145. {
  146. m_nFLASHLIGHT = i ? 1 : 0;
  147. #ifdef _DEBUG
  148. m_bFLASHLIGHT = 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. public:
  173. worldtwotextureblend_ps20_Static_Index( )
  174. {
  175. #ifdef _DEBUG
  176. m_bDETAILTEXTURE = false;
  177. #endif // _DEBUG
  178. m_nDETAILTEXTURE = 0;
  179. #ifdef _DEBUG
  180. m_bBUMPMAP = false;
  181. #endif // _DEBUG
  182. m_nBUMPMAP = 0;
  183. #ifdef _DEBUG
  184. m_bVERTEXCOLOR = false;
  185. #endif // _DEBUG
  186. m_nVERTEXCOLOR = 0;
  187. #ifdef _DEBUG
  188. m_bSELFILLUM = false;
  189. #endif // _DEBUG
  190. m_nSELFILLUM = 0;
  191. #ifdef _DEBUG
  192. m_bDIFFUSEBUMPMAP = false;
  193. #endif // _DEBUG
  194. m_nDIFFUSEBUMPMAP = 0;
  195. #ifdef _DEBUG
  196. m_bDETAIL_ALPHA_MASK_BASE_TEXTURE = false;
  197. #endif // _DEBUG
  198. m_nDETAIL_ALPHA_MASK_BASE_TEXTURE = 0;
  199. #ifdef _DEBUG
  200. m_bFLASHLIGHT = false;
  201. #endif // _DEBUG
  202. m_nFLASHLIGHT = 0;
  203. #ifdef _DEBUG
  204. m_bSEAMLESS = false;
  205. #endif // _DEBUG
  206. m_nSEAMLESS = 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_bDETAILTEXTURE && m_bBUMPMAP && m_bVERTEXCOLOR && m_bSELFILLUM && m_bDIFFUSEBUMPMAP && m_bDETAIL_ALPHA_MASK_BASE_TEXTURE && m_bFLASHLIGHT && m_bSEAMLESS;
  214. Assert( bAllStaticVarsDefined );
  215. #endif // _DEBUG
  216. return ( 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;
  217. }
  218. };
  219. #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
  220. class worldtwotextureblend_ps20_Dynamic_Index
  221. {
  222. private:
  223. int m_nWRITEWATERFOGTODESTALPHA;
  224. #ifdef _DEBUG
  225. bool m_bWRITEWATERFOGTODESTALPHA;
  226. #endif
  227. public:
  228. void SetWRITEWATERFOGTODESTALPHA( int i )
  229. {
  230. Assert( i >= 0 && i <= 1 );
  231. m_nWRITEWATERFOGTODESTALPHA = i;
  232. #ifdef _DEBUG
  233. m_bWRITEWATERFOGTODESTALPHA = true;
  234. #endif
  235. }
  236. void SetWRITEWATERFOGTODESTALPHA( bool i )
  237. {
  238. m_nWRITEWATERFOGTODESTALPHA = i ? 1 : 0;
  239. #ifdef _DEBUG
  240. m_bWRITEWATERFOGTODESTALPHA = true;
  241. #endif
  242. }
  243. private:
  244. int m_nPIXELFOGTYPE;
  245. #ifdef _DEBUG
  246. bool m_bPIXELFOGTYPE;
  247. #endif
  248. public:
  249. void SetPIXELFOGTYPE( int i )
  250. {
  251. Assert( i >= 0 && i <= 1 );
  252. m_nPIXELFOGTYPE = i;
  253. #ifdef _DEBUG
  254. m_bPIXELFOGTYPE = true;
  255. #endif
  256. }
  257. void SetPIXELFOGTYPE( bool i )
  258. {
  259. m_nPIXELFOGTYPE = i ? 1 : 0;
  260. #ifdef _DEBUG
  261. m_bPIXELFOGTYPE = true;
  262. #endif
  263. }
  264. public:
  265. worldtwotextureblend_ps20_Dynamic_Index()
  266. {
  267. #ifdef _DEBUG
  268. m_bWRITEWATERFOGTODESTALPHA = false;
  269. #endif // _DEBUG
  270. m_nWRITEWATERFOGTODESTALPHA = 0;
  271. #ifdef _DEBUG
  272. m_bPIXELFOGTYPE = false;
  273. #endif // _DEBUG
  274. m_nPIXELFOGTYPE = 0;
  275. }
  276. int GetIndex()
  277. {
  278. // Asserts to make sure that we aren't using any skipped combinations.
  279. // Asserts to make sure that we are setting all of the combination vars.
  280. #ifdef _DEBUG
  281. bool bAllDynamicVarsDefined = m_bWRITEWATERFOGTODESTALPHA && m_bPIXELFOGTYPE;
  282. Assert( bAllDynamicVarsDefined );
  283. #endif // _DEBUG
  284. return ( 1 * m_nWRITEWATERFOGTODESTALPHA ) + ( 2 * m_nPIXELFOGTYPE ) + 0;
  285. }
  286. };
  287. #define shaderDynamicTest_worldtwotextureblend_ps20 psh_forgot_to_set_dynamic_WRITEWATERFOGTODESTALPHA + psh_forgot_to_set_dynamic_PIXELFOGTYPE + 0