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.

212 lines
4.1 KiB

  1. #include "shaderlib/cshader.h"
  2. class water_ps20_Static_Index
  3. {
  4. private:
  5. int m_nBASETEXTURE;
  6. #ifdef _DEBUG
  7. bool m_bBASETEXTURE;
  8. #endif
  9. public:
  10. void SetBASETEXTURE( int i )
  11. {
  12. Assert( i >= 0 && i <= 1 );
  13. m_nBASETEXTURE = i;
  14. #ifdef _DEBUG
  15. m_bBASETEXTURE = true;
  16. #endif
  17. }
  18. void SetBASETEXTURE( bool i )
  19. {
  20. m_nBASETEXTURE = i ? 1 : 0;
  21. #ifdef _DEBUG
  22. m_bBASETEXTURE = true;
  23. #endif
  24. }
  25. private:
  26. int m_nMULTITEXTURE;
  27. #ifdef _DEBUG
  28. bool m_bMULTITEXTURE;
  29. #endif
  30. public:
  31. void SetMULTITEXTURE( int i )
  32. {
  33. Assert( i >= 0 && i <= 1 );
  34. m_nMULTITEXTURE = i;
  35. #ifdef _DEBUG
  36. m_bMULTITEXTURE = true;
  37. #endif
  38. }
  39. void SetMULTITEXTURE( bool i )
  40. {
  41. m_nMULTITEXTURE = i ? 1 : 0;
  42. #ifdef _DEBUG
  43. m_bMULTITEXTURE = true;
  44. #endif
  45. }
  46. private:
  47. int m_nREFLECT;
  48. #ifdef _DEBUG
  49. bool m_bREFLECT;
  50. #endif
  51. public:
  52. void SetREFLECT( int i )
  53. {
  54. Assert( i >= 0 && i <= 1 );
  55. m_nREFLECT = i;
  56. #ifdef _DEBUG
  57. m_bREFLECT = true;
  58. #endif
  59. }
  60. void SetREFLECT( bool i )
  61. {
  62. m_nREFLECT = i ? 1 : 0;
  63. #ifdef _DEBUG
  64. m_bREFLECT = true;
  65. #endif
  66. }
  67. private:
  68. int m_nREFRACT;
  69. #ifdef _DEBUG
  70. bool m_bREFRACT;
  71. #endif
  72. public:
  73. void SetREFRACT( int i )
  74. {
  75. Assert( i >= 0 && i <= 1 );
  76. m_nREFRACT = i;
  77. #ifdef _DEBUG
  78. m_bREFRACT = true;
  79. #endif
  80. }
  81. void SetREFRACT( bool i )
  82. {
  83. m_nREFRACT = i ? 1 : 0;
  84. #ifdef _DEBUG
  85. m_bREFRACT = true;
  86. #endif
  87. }
  88. private:
  89. int m_nABOVEWATER;
  90. #ifdef _DEBUG
  91. bool m_bABOVEWATER;
  92. #endif
  93. public:
  94. void SetABOVEWATER( int i )
  95. {
  96. Assert( i >= 0 && i <= 1 );
  97. m_nABOVEWATER = i;
  98. #ifdef _DEBUG
  99. m_bABOVEWATER = true;
  100. #endif
  101. }
  102. void SetABOVEWATER( bool i )
  103. {
  104. m_nABOVEWATER = i ? 1 : 0;
  105. #ifdef _DEBUG
  106. m_bABOVEWATER = 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. water_ps20_Static_Index( )
  132. {
  133. #ifdef _DEBUG
  134. m_bBASETEXTURE = false;
  135. #endif // _DEBUG
  136. m_nBASETEXTURE = 0;
  137. #ifdef _DEBUG
  138. m_bMULTITEXTURE = false;
  139. #endif // _DEBUG
  140. m_nMULTITEXTURE = 0;
  141. #ifdef _DEBUG
  142. m_bREFLECT = false;
  143. #endif // _DEBUG
  144. m_nREFLECT = 0;
  145. #ifdef _DEBUG
  146. m_bREFRACT = false;
  147. #endif // _DEBUG
  148. m_nREFRACT = 0;
  149. #ifdef _DEBUG
  150. m_bABOVEWATER = false;
  151. #endif // _DEBUG
  152. m_nABOVEWATER = 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_bBASETEXTURE && m_bMULTITEXTURE && m_bREFLECT && m_bREFRACT && m_bABOVEWATER && m_bNORMAL_DECODE_MODE;
  164. Assert( bAllStaticVarsDefined );
  165. #endif // _DEBUG
  166. return ( 2 * m_nBASETEXTURE ) + ( 4 * m_nMULTITEXTURE ) + ( 8 * m_nREFLECT ) + ( 16 * m_nREFRACT ) + ( 32 * m_nABOVEWATER ) + ( 64 * m_nNORMAL_DECODE_MODE ) + 0;
  167. }
  168. };
  169. #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
  170. class water_ps20_Dynamic_Index
  171. {
  172. private:
  173. int m_nPIXELFOGTYPE;
  174. #ifdef _DEBUG
  175. bool m_bPIXELFOGTYPE;
  176. #endif
  177. public:
  178. void SetPIXELFOGTYPE( int i )
  179. {
  180. Assert( i >= 0 && i <= 1 );
  181. m_nPIXELFOGTYPE = i;
  182. #ifdef _DEBUG
  183. m_bPIXELFOGTYPE = true;
  184. #endif
  185. }
  186. void SetPIXELFOGTYPE( bool i )
  187. {
  188. m_nPIXELFOGTYPE = i ? 1 : 0;
  189. #ifdef _DEBUG
  190. m_bPIXELFOGTYPE = true;
  191. #endif
  192. }
  193. public:
  194. water_ps20_Dynamic_Index()
  195. {
  196. #ifdef _DEBUG
  197. m_bPIXELFOGTYPE = false;
  198. #endif // _DEBUG
  199. m_nPIXELFOGTYPE = 0;
  200. }
  201. int GetIndex()
  202. {
  203. // Asserts to make sure that we aren't using any skipped combinations.
  204. // Asserts to make sure that we are setting all of the combination vars.
  205. #ifdef _DEBUG
  206. bool bAllDynamicVarsDefined = m_bPIXELFOGTYPE;
  207. Assert( bAllDynamicVarsDefined );
  208. #endif // _DEBUG
  209. return ( 1 * m_nPIXELFOGTYPE ) + 0;
  210. }
  211. };
  212. #define shaderDynamicTest_water_ps20 psh_forgot_to_set_dynamic_PIXELFOGTYPE + 0