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.6 KiB

  1. #include "shaderlib/cshader.h"
  2. class eye_refract_ps30_Static_Index
  3. {
  4. private:
  5. int m_nFLASHLIGHT;
  6. #ifdef _DEBUG
  7. bool m_bFLASHLIGHT;
  8. #endif
  9. public:
  10. void SetFLASHLIGHT( int i )
  11. {
  12. Assert( i >= 0 && i <= 1 );
  13. m_nFLASHLIGHT = i;
  14. #ifdef _DEBUG
  15. m_bFLASHLIGHT = true;
  16. #endif
  17. }
  18. void SetFLASHLIGHT( bool i )
  19. {
  20. m_nFLASHLIGHT = i ? 1 : 0;
  21. #ifdef _DEBUG
  22. m_bFLASHLIGHT = true;
  23. #endif
  24. }
  25. private:
  26. int m_nLIGHTWARPTEXTURE;
  27. #ifdef _DEBUG
  28. bool m_bLIGHTWARPTEXTURE;
  29. #endif
  30. public:
  31. void SetLIGHTWARPTEXTURE( int i )
  32. {
  33. Assert( i >= 0 && i <= 1 );
  34. m_nLIGHTWARPTEXTURE = i;
  35. #ifdef _DEBUG
  36. m_bLIGHTWARPTEXTURE = true;
  37. #endif
  38. }
  39. void SetLIGHTWARPTEXTURE( bool i )
  40. {
  41. m_nLIGHTWARPTEXTURE = i ? 1 : 0;
  42. #ifdef _DEBUG
  43. m_bLIGHTWARPTEXTURE = true;
  44. #endif
  45. }
  46. private:
  47. int m_nSPHERETEXKILLCOMBO;
  48. #ifdef _DEBUG
  49. bool m_bSPHERETEXKILLCOMBO;
  50. #endif
  51. public:
  52. void SetSPHERETEXKILLCOMBO( int i )
  53. {
  54. Assert( i >= 0 && i <= 1 );
  55. m_nSPHERETEXKILLCOMBO = i;
  56. #ifdef _DEBUG
  57. m_bSPHERETEXKILLCOMBO = true;
  58. #endif
  59. }
  60. void SetSPHERETEXKILLCOMBO( bool i )
  61. {
  62. m_nSPHERETEXKILLCOMBO = i ? 1 : 0;
  63. #ifdef _DEBUG
  64. m_bSPHERETEXKILLCOMBO = true;
  65. #endif
  66. }
  67. private:
  68. int m_nRAYTRACESPHERE;
  69. #ifdef _DEBUG
  70. bool m_bRAYTRACESPHERE;
  71. #endif
  72. public:
  73. void SetRAYTRACESPHERE( int i )
  74. {
  75. Assert( i >= 0 && i <= 1 );
  76. m_nRAYTRACESPHERE = i;
  77. #ifdef _DEBUG
  78. m_bRAYTRACESPHERE = true;
  79. #endif
  80. }
  81. void SetRAYTRACESPHERE( bool i )
  82. {
  83. m_nRAYTRACESPHERE = i ? 1 : 0;
  84. #ifdef _DEBUG
  85. m_bRAYTRACESPHERE = true;
  86. #endif
  87. }
  88. private:
  89. int m_nFLASHLIGHTDEPTHFILTERMODE;
  90. #ifdef _DEBUG
  91. bool m_bFLASHLIGHTDEPTHFILTERMODE;
  92. #endif
  93. public:
  94. void SetFLASHLIGHTDEPTHFILTERMODE( int i )
  95. {
  96. Assert( i >= 0 && i <= 2 );
  97. m_nFLASHLIGHTDEPTHFILTERMODE = i;
  98. #ifdef _DEBUG
  99. m_bFLASHLIGHTDEPTHFILTERMODE = true;
  100. #endif
  101. }
  102. void SetFLASHLIGHTDEPTHFILTERMODE( bool i )
  103. {
  104. m_nFLASHLIGHTDEPTHFILTERMODE = i ? 1 : 0;
  105. #ifdef _DEBUG
  106. m_bFLASHLIGHTDEPTHFILTERMODE = true;
  107. #endif
  108. }
  109. public:
  110. eye_refract_ps30_Static_Index( )
  111. {
  112. #ifdef _DEBUG
  113. m_bFLASHLIGHT = false;
  114. #endif // _DEBUG
  115. m_nFLASHLIGHT = 0;
  116. #ifdef _DEBUG
  117. m_bLIGHTWARPTEXTURE = false;
  118. #endif // _DEBUG
  119. m_nLIGHTWARPTEXTURE = 0;
  120. #ifdef _DEBUG
  121. m_bSPHERETEXKILLCOMBO = false;
  122. #endif // _DEBUG
  123. m_nSPHERETEXKILLCOMBO = 0;
  124. #ifdef _DEBUG
  125. m_bRAYTRACESPHERE = false;
  126. #endif // _DEBUG
  127. m_nRAYTRACESPHERE = 0;
  128. #ifdef _DEBUG
  129. m_bFLASHLIGHTDEPTHFILTERMODE = false;
  130. #endif // _DEBUG
  131. m_nFLASHLIGHTDEPTHFILTERMODE = 0;
  132. }
  133. int GetIndex()
  134. {
  135. // Asserts to make sure that we aren't using any skipped combinations.
  136. // Asserts to make sure that we are setting all of the combination vars.
  137. #ifdef _DEBUG
  138. bool bAllStaticVarsDefined = m_bFLASHLIGHT && m_bLIGHTWARPTEXTURE && m_bSPHERETEXKILLCOMBO && m_bRAYTRACESPHERE && m_bFLASHLIGHTDEPTHFILTERMODE;
  139. Assert( bAllStaticVarsDefined );
  140. #endif // _DEBUG
  141. return ( 10 * m_nFLASHLIGHT ) + ( 20 * m_nLIGHTWARPTEXTURE ) + ( 40 * m_nSPHERETEXKILLCOMBO ) + ( 80 * m_nRAYTRACESPHERE ) + ( 160 * m_nFLASHLIGHTDEPTHFILTERMODE ) + 0;
  142. }
  143. };
  144. #define shaderStaticTest_eye_refract_ps30 psh_forgot_to_set_static_FLASHLIGHT + psh_forgot_to_set_static_LIGHTWARPTEXTURE + psh_forgot_to_set_static_SPHERETEXKILLCOMBO + psh_forgot_to_set_static_RAYTRACESPHERE + psh_forgot_to_set_static_FLASHLIGHTDEPTHFILTERMODE + 0
  145. class eye_refract_ps30_Dynamic_Index
  146. {
  147. private:
  148. int m_nNUM_LIGHTS;
  149. #ifdef _DEBUG
  150. bool m_bNUM_LIGHTS;
  151. #endif
  152. public:
  153. void SetNUM_LIGHTS( int i )
  154. {
  155. Assert( i >= 0 && i <= 4 );
  156. m_nNUM_LIGHTS = i;
  157. #ifdef _DEBUG
  158. m_bNUM_LIGHTS = true;
  159. #endif
  160. }
  161. void SetNUM_LIGHTS( bool i )
  162. {
  163. m_nNUM_LIGHTS = i ? 1 : 0;
  164. #ifdef _DEBUG
  165. m_bNUM_LIGHTS = true;
  166. #endif
  167. }
  168. private:
  169. int m_nFLASHLIGHTSHADOWS;
  170. #ifdef _DEBUG
  171. bool m_bFLASHLIGHTSHADOWS;
  172. #endif
  173. public:
  174. void SetFLASHLIGHTSHADOWS( int i )
  175. {
  176. Assert( i >= 0 && i <= 1 );
  177. m_nFLASHLIGHTSHADOWS = i;
  178. #ifdef _DEBUG
  179. m_bFLASHLIGHTSHADOWS = true;
  180. #endif
  181. }
  182. void SetFLASHLIGHTSHADOWS( bool i )
  183. {
  184. m_nFLASHLIGHTSHADOWS = i ? 1 : 0;
  185. #ifdef _DEBUG
  186. m_bFLASHLIGHTSHADOWS = true;
  187. #endif
  188. }
  189. public:
  190. eye_refract_ps30_Dynamic_Index()
  191. {
  192. #ifdef _DEBUG
  193. m_bNUM_LIGHTS = false;
  194. #endif // _DEBUG
  195. m_nNUM_LIGHTS = 0;
  196. #ifdef _DEBUG
  197. m_bFLASHLIGHTSHADOWS = false;
  198. #endif // _DEBUG
  199. m_nFLASHLIGHTSHADOWS = 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_bNUM_LIGHTS && m_bFLASHLIGHTSHADOWS;
  207. Assert( bAllDynamicVarsDefined );
  208. #endif // _DEBUG
  209. return ( 1 * m_nNUM_LIGHTS ) + ( 5 * m_nFLASHLIGHTSHADOWS ) + 0;
  210. }
  211. };
  212. #define shaderDynamicTest_eye_refract_ps30 psh_forgot_to_set_dynamic_NUM_LIGHTS + psh_forgot_to_set_dynamic_FLASHLIGHTSHADOWS + 0