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 water_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_nBASETEXTURE;
  27. #ifdef _DEBUG
  28. bool m_bBASETEXTURE;
  29. #endif
  30. public:
  31. void SetBASETEXTURE( int i )
  32. {
  33. Assert( i >= 0 && i <= 1 );
  34. m_nBASETEXTURE = i;
  35. #ifdef _DEBUG
  36. m_bBASETEXTURE = true;
  37. #endif
  38. }
  39. void SetBASETEXTURE( bool i )
  40. {
  41. m_nBASETEXTURE = i ? 1 : 0;
  42. #ifdef _DEBUG
  43. m_bBASETEXTURE = true;
  44. #endif
  45. }
  46. private:
  47. int m_nMULTITEXTURE;
  48. #ifdef _DEBUG
  49. bool m_bMULTITEXTURE;
  50. #endif
  51. public:
  52. void SetMULTITEXTURE( int i )
  53. {
  54. Assert( i >= 0 && i <= 1 );
  55. m_nMULTITEXTURE = i;
  56. #ifdef _DEBUG
  57. m_bMULTITEXTURE = true;
  58. #endif
  59. }
  60. void SetMULTITEXTURE( bool i )
  61. {
  62. m_nMULTITEXTURE = i ? 1 : 0;
  63. #ifdef _DEBUG
  64. m_bMULTITEXTURE = true;
  65. #endif
  66. }
  67. private:
  68. int m_nREFLECT;
  69. #ifdef _DEBUG
  70. bool m_bREFLECT;
  71. #endif
  72. public:
  73. void SetREFLECT( int i )
  74. {
  75. Assert( i >= 0 && i <= 1 );
  76. m_nREFLECT = i;
  77. #ifdef _DEBUG
  78. m_bREFLECT = true;
  79. #endif
  80. }
  81. void SetREFLECT( bool i )
  82. {
  83. m_nREFLECT = i ? 1 : 0;
  84. #ifdef _DEBUG
  85. m_bREFLECT = true;
  86. #endif
  87. }
  88. private:
  89. int m_nREFRACT;
  90. #ifdef _DEBUG
  91. bool m_bREFRACT;
  92. #endif
  93. public:
  94. void SetREFRACT( int i )
  95. {
  96. Assert( i >= 0 && i <= 1 );
  97. m_nREFRACT = i;
  98. #ifdef _DEBUG
  99. m_bREFRACT = true;
  100. #endif
  101. }
  102. void SetREFRACT( bool i )
  103. {
  104. m_nREFRACT = i ? 1 : 0;
  105. #ifdef _DEBUG
  106. m_bREFRACT = true;
  107. #endif
  108. }
  109. private:
  110. int m_nABOVEWATER;
  111. #ifdef _DEBUG
  112. bool m_bABOVEWATER;
  113. #endif
  114. public:
  115. void SetABOVEWATER( int i )
  116. {
  117. Assert( i >= 0 && i <= 1 );
  118. m_nABOVEWATER = i;
  119. #ifdef _DEBUG
  120. m_bABOVEWATER = true;
  121. #endif
  122. }
  123. void SetABOVEWATER( bool i )
  124. {
  125. m_nABOVEWATER = i ? 1 : 0;
  126. #ifdef _DEBUG
  127. m_bABOVEWATER = true;
  128. #endif
  129. }
  130. private:
  131. int m_nNORMAL_DECODE_MODE;
  132. #ifdef _DEBUG
  133. bool m_bNORMAL_DECODE_MODE;
  134. #endif
  135. public:
  136. void SetNORMAL_DECODE_MODE( int i )
  137. {
  138. Assert( i >= 0 && i <= 0 );
  139. m_nNORMAL_DECODE_MODE = i;
  140. #ifdef _DEBUG
  141. m_bNORMAL_DECODE_MODE = true;
  142. #endif
  143. }
  144. void SetNORMAL_DECODE_MODE( bool i )
  145. {
  146. m_nNORMAL_DECODE_MODE = i ? 1 : 0;
  147. #ifdef _DEBUG
  148. m_bNORMAL_DECODE_MODE = true;
  149. #endif
  150. }
  151. public:
  152. water_ps20_Static_Index( )
  153. {
  154. #ifdef _DEBUG
  155. m_bCONVERT_TO_SRGB = true;
  156. #endif // _DEBUG
  157. m_nCONVERT_TO_SRGB = 0;
  158. #ifdef _DEBUG
  159. m_bBASETEXTURE = false;
  160. #endif // _DEBUG
  161. m_nBASETEXTURE = 0;
  162. #ifdef _DEBUG
  163. m_bMULTITEXTURE = false;
  164. #endif // _DEBUG
  165. m_nMULTITEXTURE = 0;
  166. #ifdef _DEBUG
  167. m_bREFLECT = false;
  168. #endif // _DEBUG
  169. m_nREFLECT = 0;
  170. #ifdef _DEBUG
  171. m_bREFRACT = false;
  172. #endif // _DEBUG
  173. m_nREFRACT = 0;
  174. #ifdef _DEBUG
  175. m_bABOVEWATER = false;
  176. #endif // _DEBUG
  177. m_nABOVEWATER = 0;
  178. #ifdef _DEBUG
  179. m_bNORMAL_DECODE_MODE = false;
  180. #endif // _DEBUG
  181. m_nNORMAL_DECODE_MODE = 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_bBASETEXTURE && m_bMULTITEXTURE && m_bREFLECT && m_bREFRACT && m_bABOVEWATER && m_bNORMAL_DECODE_MODE;
  189. Assert( bAllStaticVarsDefined );
  190. #endif // _DEBUG
  191. return ( 2 * m_nCONVERT_TO_SRGB ) + ( 2 * m_nBASETEXTURE ) + ( 4 * m_nMULTITEXTURE ) + ( 8 * m_nREFLECT ) + ( 16 * m_nREFRACT ) + ( 32 * m_nABOVEWATER ) + ( 64 * m_nNORMAL_DECODE_MODE ) + 0;
  192. }
  193. };
  194. #define shaderStaticTest_water_ps20 psh_forgot_to_set_static_BASETEXTURE + psh_forgot_to_set_static_MULTITEXTURE + psh_forgot_to_set_static_REFLECT + psh_forgot_to_set_static_REFRACT + psh_forgot_to_set_static_ABOVEWATER + psh_forgot_to_set_static_NORMAL_DECODE_MODE + 0
  195. class water_ps20_Dynamic_Index
  196. {
  197. private:
  198. int m_nPIXELFOGTYPE;
  199. #ifdef _DEBUG
  200. bool m_bPIXELFOGTYPE;
  201. #endif
  202. public:
  203. void SetPIXELFOGTYPE( int i )
  204. {
  205. Assert( i >= 0 && i <= 1 );
  206. m_nPIXELFOGTYPE = i;
  207. #ifdef _DEBUG
  208. m_bPIXELFOGTYPE = true;
  209. #endif
  210. }
  211. void SetPIXELFOGTYPE( bool i )
  212. {
  213. m_nPIXELFOGTYPE = i ? 1 : 0;
  214. #ifdef _DEBUG
  215. m_bPIXELFOGTYPE = true;
  216. #endif
  217. }
  218. public:
  219. water_ps20_Dynamic_Index()
  220. {
  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_bPIXELFOGTYPE;
  232. Assert( bAllDynamicVarsDefined );
  233. #endif // _DEBUG
  234. return ( 1 * m_nPIXELFOGTYPE ) + 0;
  235. }
  236. };
  237. #define shaderDynamicTest_water_ps20 psh_forgot_to_set_dynamic_PIXELFOGTYPE + 0