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.

237 lines
4.6 KiB

  1. #include "shaderlib/cshader.h"
  2. class watercheap_ps20_Static_Index
  3. {
  4. private:
  5. int m_nMULTITEXTURE;
  6. #ifdef _DEBUG
  7. bool m_bMULTITEXTURE;
  8. #endif
  9. public:
  10. void SetMULTITEXTURE( int i )
  11. {
  12. Assert( i >= 0 && i <= 1 );
  13. m_nMULTITEXTURE = i;
  14. #ifdef _DEBUG
  15. m_bMULTITEXTURE = true;
  16. #endif
  17. }
  18. void SetMULTITEXTURE( bool i )
  19. {
  20. m_nMULTITEXTURE = i ? 1 : 0;
  21. #ifdef _DEBUG
  22. m_bMULTITEXTURE = true;
  23. #endif
  24. }
  25. private:
  26. int m_nFRESNEL;
  27. #ifdef _DEBUG
  28. bool m_bFRESNEL;
  29. #endif
  30. public:
  31. void SetFRESNEL( int i )
  32. {
  33. Assert( i >= 0 && i <= 1 );
  34. m_nFRESNEL = i;
  35. #ifdef _DEBUG
  36. m_bFRESNEL = true;
  37. #endif
  38. }
  39. void SetFRESNEL( bool i )
  40. {
  41. m_nFRESNEL = i ? 1 : 0;
  42. #ifdef _DEBUG
  43. m_bFRESNEL = true;
  44. #endif
  45. }
  46. private:
  47. int m_nBLEND;
  48. #ifdef _DEBUG
  49. bool m_bBLEND;
  50. #endif
  51. public:
  52. void SetBLEND( int i )
  53. {
  54. Assert( i >= 0 && i <= 1 );
  55. m_nBLEND = i;
  56. #ifdef _DEBUG
  57. m_bBLEND = true;
  58. #endif
  59. }
  60. void SetBLEND( bool i )
  61. {
  62. m_nBLEND = i ? 1 : 0;
  63. #ifdef _DEBUG
  64. m_bBLEND = true;
  65. #endif
  66. }
  67. private:
  68. int m_nREFRACTALPHA;
  69. #ifdef _DEBUG
  70. bool m_bREFRACTALPHA;
  71. #endif
  72. public:
  73. void SetREFRACTALPHA( int i )
  74. {
  75. Assert( i >= 0 && i <= 1 );
  76. m_nREFRACTALPHA = i;
  77. #ifdef _DEBUG
  78. m_bREFRACTALPHA = true;
  79. #endif
  80. }
  81. void SetREFRACTALPHA( bool i )
  82. {
  83. m_nREFRACTALPHA = i ? 1 : 0;
  84. #ifdef _DEBUG
  85. m_bREFRACTALPHA = true;
  86. #endif
  87. }
  88. private:
  89. int m_nHDRTYPE;
  90. #ifdef _DEBUG
  91. bool m_bHDRTYPE;
  92. #endif
  93. public:
  94. void SetHDRTYPE( int i )
  95. {
  96. Assert( i >= 0 && i <= 2 );
  97. m_nHDRTYPE = i;
  98. #ifdef _DEBUG
  99. m_bHDRTYPE = true;
  100. #endif
  101. }
  102. void SetHDRTYPE( bool i )
  103. {
  104. m_nHDRTYPE = i ? 1 : 0;
  105. #ifdef _DEBUG
  106. m_bHDRTYPE = true;
  107. #endif
  108. }
  109. private:
  110. int m_nNORMAL_DECODE_MODE;
  111. #ifdef _DEBUG
  112. bool m_bNORMAL_DECODE_MODE;
  113. #endif
  114. public:
  115. void SetNORMAL_DECODE_MODE( int i )
  116. {
  117. Assert( i >= 0 && i <= 0 );
  118. m_nNORMAL_DECODE_MODE = i;
  119. #ifdef _DEBUG
  120. m_bNORMAL_DECODE_MODE = true;
  121. #endif
  122. }
  123. void SetNORMAL_DECODE_MODE( bool i )
  124. {
  125. m_nNORMAL_DECODE_MODE = i ? 1 : 0;
  126. #ifdef _DEBUG
  127. m_bNORMAL_DECODE_MODE = true;
  128. #endif
  129. }
  130. public:
  131. watercheap_ps20_Static_Index( )
  132. {
  133. #ifdef _DEBUG
  134. m_bMULTITEXTURE = false;
  135. #endif // _DEBUG
  136. m_nMULTITEXTURE = 0;
  137. #ifdef _DEBUG
  138. m_bFRESNEL = false;
  139. #endif // _DEBUG
  140. m_nFRESNEL = 0;
  141. #ifdef _DEBUG
  142. m_bBLEND = false;
  143. #endif // _DEBUG
  144. m_nBLEND = 0;
  145. #ifdef _DEBUG
  146. m_bREFRACTALPHA = false;
  147. #endif // _DEBUG
  148. m_nREFRACTALPHA = 0;
  149. #ifdef _DEBUG
  150. m_bHDRTYPE = false;
  151. #endif // _DEBUG
  152. m_nHDRTYPE = 0;
  153. #ifdef _DEBUG
  154. m_bNORMAL_DECODE_MODE = false;
  155. #endif // _DEBUG
  156. m_nNORMAL_DECODE_MODE = 0;
  157. }
  158. int GetIndex()
  159. {
  160. // Asserts to make sure that we aren't using any skipped combinations.
  161. // Asserts to make sure that we are setting all of the combination vars.
  162. #ifdef _DEBUG
  163. bool bAllStaticVarsDefined = m_bMULTITEXTURE && m_bFRESNEL && m_bBLEND && m_bREFRACTALPHA && m_bHDRTYPE && m_bNORMAL_DECODE_MODE;
  164. Assert( bAllStaticVarsDefined );
  165. #endif // _DEBUG
  166. return ( 4 * m_nMULTITEXTURE ) + ( 8 * m_nFRESNEL ) + ( 16 * m_nBLEND ) + ( 32 * m_nREFRACTALPHA ) + ( 64 * m_nHDRTYPE ) + ( 192 * m_nNORMAL_DECODE_MODE ) + 0;
  167. }
  168. };
  169. #define shaderStaticTest_watercheap_ps20 psh_forgot_to_set_static_MULTITEXTURE + psh_forgot_to_set_static_FRESNEL + psh_forgot_to_set_static_BLEND + psh_forgot_to_set_static_REFRACTALPHA + psh_forgot_to_set_static_HDRTYPE + psh_forgot_to_set_static_NORMAL_DECODE_MODE + 0
  170. class watercheap_ps20_Dynamic_Index
  171. {
  172. private:
  173. int m_nHDRENABLED;
  174. #ifdef _DEBUG
  175. bool m_bHDRENABLED;
  176. #endif
  177. public:
  178. void SetHDRENABLED( int i )
  179. {
  180. Assert( i >= 0 && i <= 1 );
  181. m_nHDRENABLED = i;
  182. #ifdef _DEBUG
  183. m_bHDRENABLED = true;
  184. #endif
  185. }
  186. void SetHDRENABLED( bool i )
  187. {
  188. m_nHDRENABLED = i ? 1 : 0;
  189. #ifdef _DEBUG
  190. m_bHDRENABLED = true;
  191. #endif
  192. }
  193. private:
  194. int m_nPIXELFOGTYPE;
  195. #ifdef _DEBUG
  196. bool m_bPIXELFOGTYPE;
  197. #endif
  198. public:
  199. void SetPIXELFOGTYPE( int i )
  200. {
  201. Assert( i >= 0 && i <= 1 );
  202. m_nPIXELFOGTYPE = i;
  203. #ifdef _DEBUG
  204. m_bPIXELFOGTYPE = true;
  205. #endif
  206. }
  207. void SetPIXELFOGTYPE( bool i )
  208. {
  209. m_nPIXELFOGTYPE = i ? 1 : 0;
  210. #ifdef _DEBUG
  211. m_bPIXELFOGTYPE = true;
  212. #endif
  213. }
  214. public:
  215. watercheap_ps20_Dynamic_Index()
  216. {
  217. #ifdef _DEBUG
  218. m_bHDRENABLED = false;
  219. #endif // _DEBUG
  220. m_nHDRENABLED = 0;
  221. #ifdef _DEBUG
  222. m_bPIXELFOGTYPE = false;
  223. #endif // _DEBUG
  224. m_nPIXELFOGTYPE = 0;
  225. }
  226. int GetIndex()
  227. {
  228. // Asserts to make sure that we aren't using any skipped combinations.
  229. // Asserts to make sure that we are setting all of the combination vars.
  230. #ifdef _DEBUG
  231. bool bAllDynamicVarsDefined = m_bHDRENABLED && m_bPIXELFOGTYPE;
  232. Assert( bAllDynamicVarsDefined );
  233. #endif // _DEBUG
  234. return ( 1 * m_nHDRENABLED ) + ( 2 * m_nPIXELFOGTYPE ) + 0;
  235. }
  236. };
  237. #define shaderDynamicTest_watercheap_ps20 psh_forgot_to_set_dynamic_HDRENABLED + psh_forgot_to_set_dynamic_PIXELFOGTYPE + 0