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.

262 lines
5.1 KiB

  1. #include "shaderlib/cshader.h"
  2. class eyes_cloak_ps20b_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 <= 1 );
  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_nHDRTYPE;
  27. #ifdef _DEBUG
  28. bool m_bHDRTYPE;
  29. #endif
  30. public:
  31. void SetHDRTYPE( int i )
  32. {
  33. Assert( i >= 0 && i <= 2 );
  34. m_nHDRTYPE = i;
  35. #ifdef _DEBUG
  36. m_bHDRTYPE = true;
  37. #endif
  38. }
  39. void SetHDRTYPE( bool i )
  40. {
  41. m_nHDRTYPE = i ? 1 : 0;
  42. #ifdef _DEBUG
  43. m_bHDRTYPE = true;
  44. #endif
  45. }
  46. private:
  47. int m_nBLUR;
  48. #ifdef _DEBUG
  49. bool m_bBLUR;
  50. #endif
  51. public:
  52. void SetBLUR( int i )
  53. {
  54. Assert( i >= 0 && i <= 1 );
  55. m_nBLUR = i;
  56. #ifdef _DEBUG
  57. m_bBLUR = true;
  58. #endif
  59. }
  60. void SetBLUR( bool i )
  61. {
  62. m_nBLUR = i ? 1 : 0;
  63. #ifdef _DEBUG
  64. m_bBLUR = true;
  65. #endif
  66. }
  67. private:
  68. int m_nFADEOUTONSILHOUETTE;
  69. #ifdef _DEBUG
  70. bool m_bFADEOUTONSILHOUETTE;
  71. #endif
  72. public:
  73. void SetFADEOUTONSILHOUETTE( int i )
  74. {
  75. Assert( i >= 0 && i <= 1 );
  76. m_nFADEOUTONSILHOUETTE = i;
  77. #ifdef _DEBUG
  78. m_bFADEOUTONSILHOUETTE = true;
  79. #endif
  80. }
  81. void SetFADEOUTONSILHOUETTE( bool i )
  82. {
  83. m_nFADEOUTONSILHOUETTE = i ? 1 : 0;
  84. #ifdef _DEBUG
  85. m_bFADEOUTONSILHOUETTE = true;
  86. #endif
  87. }
  88. private:
  89. int m_nCUBEMAP;
  90. #ifdef _DEBUG
  91. bool m_bCUBEMAP;
  92. #endif
  93. public:
  94. void SetCUBEMAP( int i )
  95. {
  96. Assert( i >= 0 && i <= 1 );
  97. m_nCUBEMAP = i;
  98. #ifdef _DEBUG
  99. m_bCUBEMAP = true;
  100. #endif
  101. }
  102. void SetCUBEMAP( bool i )
  103. {
  104. m_nCUBEMAP = i ? 1 : 0;
  105. #ifdef _DEBUG
  106. m_bCUBEMAP = true;
  107. #endif
  108. }
  109. private:
  110. int m_nREFRACTTINTTEXTURE;
  111. #ifdef _DEBUG
  112. bool m_bREFRACTTINTTEXTURE;
  113. #endif
  114. public:
  115. void SetREFRACTTINTTEXTURE( int i )
  116. {
  117. Assert( i >= 0 && i <= 1 );
  118. m_nREFRACTTINTTEXTURE = i;
  119. #ifdef _DEBUG
  120. m_bREFRACTTINTTEXTURE = true;
  121. #endif
  122. }
  123. void SetREFRACTTINTTEXTURE( bool i )
  124. {
  125. m_nREFRACTTINTTEXTURE = i ? 1 : 0;
  126. #ifdef _DEBUG
  127. m_bREFRACTTINTTEXTURE = true;
  128. #endif
  129. }
  130. private:
  131. int m_nMASKED;
  132. #ifdef _DEBUG
  133. bool m_bMASKED;
  134. #endif
  135. public:
  136. void SetMASKED( int i )
  137. {
  138. Assert( i >= 0 && i <= 1 );
  139. m_nMASKED = i;
  140. #ifdef _DEBUG
  141. m_bMASKED = true;
  142. #endif
  143. }
  144. void SetMASKED( bool i )
  145. {
  146. m_nMASKED = i ? 1 : 0;
  147. #ifdef _DEBUG
  148. m_bMASKED = true;
  149. #endif
  150. }
  151. public:
  152. eyes_cloak_ps20b_Static_Index( )
  153. {
  154. #ifdef _DEBUG
  155. m_bCONVERT_TO_SRGB = true;
  156. #endif // _DEBUG
  157. m_nCONVERT_TO_SRGB = g_pHardwareConfig->NeedsShaderSRGBConversion();
  158. #ifdef _DEBUG
  159. m_bHDRTYPE = false;
  160. #endif // _DEBUG
  161. m_nHDRTYPE = 0;
  162. #ifdef _DEBUG
  163. m_bBLUR = false;
  164. #endif // _DEBUG
  165. m_nBLUR = 0;
  166. #ifdef _DEBUG
  167. m_bFADEOUTONSILHOUETTE = false;
  168. #endif // _DEBUG
  169. m_nFADEOUTONSILHOUETTE = 0;
  170. #ifdef _DEBUG
  171. m_bCUBEMAP = false;
  172. #endif // _DEBUG
  173. m_nCUBEMAP = 0;
  174. #ifdef _DEBUG
  175. m_bREFRACTTINTTEXTURE = false;
  176. #endif // _DEBUG
  177. m_nREFRACTTINTTEXTURE = 0;
  178. #ifdef _DEBUG
  179. m_bMASKED = false;
  180. #endif // _DEBUG
  181. m_nMASKED = 0;
  182. }
  183. int GetIndex()
  184. {
  185. // Asserts to make sure that we aren't using any skipped combinations.
  186. // Asserts to make sure that we are setting all of the combination vars.
  187. #ifdef _DEBUG
  188. bool bAllStaticVarsDefined = m_bCONVERT_TO_SRGB && m_bHDRTYPE && m_bBLUR && m_bFADEOUTONSILHOUETTE && m_bCUBEMAP && m_bREFRACTTINTTEXTURE && m_bMASKED;
  189. Assert( bAllStaticVarsDefined );
  190. #endif // _DEBUG
  191. return ( 4 * m_nCONVERT_TO_SRGB ) + ( 8 * m_nHDRTYPE ) + ( 24 * m_nBLUR ) + ( 48 * m_nFADEOUTONSILHOUETTE ) + ( 96 * m_nCUBEMAP ) + ( 192 * m_nREFRACTTINTTEXTURE ) + ( 384 * m_nMASKED ) + 0;
  192. }
  193. };
  194. #define shaderStaticTest_eyes_cloak_ps20b psh_forgot_to_set_static_HDRTYPE + psh_forgot_to_set_static_BLUR + psh_forgot_to_set_static_FADEOUTONSILHOUETTE + psh_forgot_to_set_static_CUBEMAP + psh_forgot_to_set_static_REFRACTTINTTEXTURE + psh_forgot_to_set_static_MASKED + 0
  195. class eyes_cloak_ps20b_Dynamic_Index
  196. {
  197. private:
  198. int m_nHDRENABLED;
  199. #ifdef _DEBUG
  200. bool m_bHDRENABLED;
  201. #endif
  202. public:
  203. void SetHDRENABLED( int i )
  204. {
  205. Assert( i >= 0 && i <= 1 );
  206. m_nHDRENABLED = i;
  207. #ifdef _DEBUG
  208. m_bHDRENABLED = true;
  209. #endif
  210. }
  211. void SetHDRENABLED( bool i )
  212. {
  213. m_nHDRENABLED = i ? 1 : 0;
  214. #ifdef _DEBUG
  215. m_bHDRENABLED = true;
  216. #endif
  217. }
  218. private:
  219. int m_nPIXELFOGTYPE;
  220. #ifdef _DEBUG
  221. bool m_bPIXELFOGTYPE;
  222. #endif
  223. public:
  224. void SetPIXELFOGTYPE( int i )
  225. {
  226. Assert( i >= 0 && i <= 1 );
  227. m_nPIXELFOGTYPE = i;
  228. #ifdef _DEBUG
  229. m_bPIXELFOGTYPE = true;
  230. #endif
  231. }
  232. void SetPIXELFOGTYPE( bool i )
  233. {
  234. m_nPIXELFOGTYPE = i ? 1 : 0;
  235. #ifdef _DEBUG
  236. m_bPIXELFOGTYPE = true;
  237. #endif
  238. }
  239. public:
  240. eyes_cloak_ps20b_Dynamic_Index()
  241. {
  242. #ifdef _DEBUG
  243. m_bHDRENABLED = false;
  244. #endif // _DEBUG
  245. m_nHDRENABLED = 0;
  246. #ifdef _DEBUG
  247. m_bPIXELFOGTYPE = false;
  248. #endif // _DEBUG
  249. m_nPIXELFOGTYPE = 0;
  250. }
  251. int GetIndex()
  252. {
  253. // Asserts to make sure that we aren't using any skipped combinations.
  254. // Asserts to make sure that we are setting all of the combination vars.
  255. #ifdef _DEBUG
  256. bool bAllDynamicVarsDefined = m_bHDRENABLED && m_bPIXELFOGTYPE;
  257. Assert( bAllDynamicVarsDefined );
  258. #endif // _DEBUG
  259. return ( 1 * m_nHDRENABLED ) + ( 2 * m_nPIXELFOGTYPE ) + 0;
  260. }
  261. };
  262. #define shaderDynamicTest_eyes_cloak_ps20b psh_forgot_to_set_dynamic_HDRENABLED + psh_forgot_to_set_dynamic_PIXELFOGTYPE + 0