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

  1. #include "shaderlib/cshader.h"
  2. class shatteredglass_ps20_Static_Index
  3. {
  4. private:
  5. int m_nCUBEMAP;
  6. #ifdef _DEBUG
  7. bool m_bCUBEMAP;
  8. #endif
  9. public:
  10. void SetCUBEMAP( int i )
  11. {
  12. Assert( i >= 0 && i <= 1 );
  13. m_nCUBEMAP = i;
  14. #ifdef _DEBUG
  15. m_bCUBEMAP = true;
  16. #endif
  17. }
  18. void SetCUBEMAP( bool i )
  19. {
  20. m_nCUBEMAP = i ? 1 : 0;
  21. #ifdef _DEBUG
  22. m_bCUBEMAP = true;
  23. #endif
  24. }
  25. private:
  26. int m_nVERTEXCOLOR;
  27. #ifdef _DEBUG
  28. bool m_bVERTEXCOLOR;
  29. #endif
  30. public:
  31. void SetVERTEXCOLOR( int i )
  32. {
  33. Assert( i >= 0 && i <= 1 );
  34. m_nVERTEXCOLOR = i;
  35. #ifdef _DEBUG
  36. m_bVERTEXCOLOR = true;
  37. #endif
  38. }
  39. void SetVERTEXCOLOR( bool i )
  40. {
  41. m_nVERTEXCOLOR = i ? 1 : 0;
  42. #ifdef _DEBUG
  43. m_bVERTEXCOLOR = true;
  44. #endif
  45. }
  46. private:
  47. int m_nENVMAPMASK;
  48. #ifdef _DEBUG
  49. bool m_bENVMAPMASK;
  50. #endif
  51. public:
  52. void SetENVMAPMASK( int i )
  53. {
  54. Assert( i >= 0 && i <= 1 );
  55. m_nENVMAPMASK = i;
  56. #ifdef _DEBUG
  57. m_bENVMAPMASK = true;
  58. #endif
  59. }
  60. void SetENVMAPMASK( bool i )
  61. {
  62. m_nENVMAPMASK = i ? 1 : 0;
  63. #ifdef _DEBUG
  64. m_bENVMAPMASK = true;
  65. #endif
  66. }
  67. private:
  68. int m_nBASEALPHAENVMAPMASK;
  69. #ifdef _DEBUG
  70. bool m_bBASEALPHAENVMAPMASK;
  71. #endif
  72. public:
  73. void SetBASEALPHAENVMAPMASK( int i )
  74. {
  75. Assert( i >= 0 && i <= 1 );
  76. m_nBASEALPHAENVMAPMASK = i;
  77. #ifdef _DEBUG
  78. m_bBASEALPHAENVMAPMASK = true;
  79. #endif
  80. }
  81. void SetBASEALPHAENVMAPMASK( bool i )
  82. {
  83. m_nBASEALPHAENVMAPMASK = i ? 1 : 0;
  84. #ifdef _DEBUG
  85. m_bBASEALPHAENVMAPMASK = 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. public:
  110. shatteredglass_ps20_Static_Index( )
  111. {
  112. #ifdef _DEBUG
  113. m_bCUBEMAP = false;
  114. #endif // _DEBUG
  115. m_nCUBEMAP = 0;
  116. #ifdef _DEBUG
  117. m_bVERTEXCOLOR = false;
  118. #endif // _DEBUG
  119. m_nVERTEXCOLOR = 0;
  120. #ifdef _DEBUG
  121. m_bENVMAPMASK = false;
  122. #endif // _DEBUG
  123. m_nENVMAPMASK = 0;
  124. #ifdef _DEBUG
  125. m_bBASEALPHAENVMAPMASK = false;
  126. #endif // _DEBUG
  127. m_nBASEALPHAENVMAPMASK = 0;
  128. #ifdef _DEBUG
  129. m_bHDRTYPE = false;
  130. #endif // _DEBUG
  131. m_nHDRTYPE = 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_bCUBEMAP && m_bVERTEXCOLOR && m_bENVMAPMASK && m_bBASEALPHAENVMAPMASK && m_bHDRTYPE;
  139. Assert( bAllStaticVarsDefined );
  140. #endif // _DEBUG
  141. return ( 4 * m_nCUBEMAP ) + ( 8 * m_nVERTEXCOLOR ) + ( 16 * m_nENVMAPMASK ) + ( 32 * m_nBASEALPHAENVMAPMASK ) + ( 64 * m_nHDRTYPE ) + 0;
  142. }
  143. };
  144. #define shaderStaticTest_shatteredglass_ps20 psh_forgot_to_set_static_CUBEMAP + psh_forgot_to_set_static_VERTEXCOLOR + psh_forgot_to_set_static_ENVMAPMASK + psh_forgot_to_set_static_BASEALPHAENVMAPMASK + psh_forgot_to_set_static_HDRTYPE + 0
  145. class shatteredglass_ps20_Dynamic_Index
  146. {
  147. private:
  148. int m_nHDRENABLED;
  149. #ifdef _DEBUG
  150. bool m_bHDRENABLED;
  151. #endif
  152. public:
  153. void SetHDRENABLED( int i )
  154. {
  155. Assert( i >= 0 && i <= 1 );
  156. m_nHDRENABLED = i;
  157. #ifdef _DEBUG
  158. m_bHDRENABLED = true;
  159. #endif
  160. }
  161. void SetHDRENABLED( bool i )
  162. {
  163. m_nHDRENABLED = i ? 1 : 0;
  164. #ifdef _DEBUG
  165. m_bHDRENABLED = true;
  166. #endif
  167. }
  168. private:
  169. int m_nPIXELFOGTYPE;
  170. #ifdef _DEBUG
  171. bool m_bPIXELFOGTYPE;
  172. #endif
  173. public:
  174. void SetPIXELFOGTYPE( int i )
  175. {
  176. Assert( i >= 0 && i <= 1 );
  177. m_nPIXELFOGTYPE = i;
  178. #ifdef _DEBUG
  179. m_bPIXELFOGTYPE = true;
  180. #endif
  181. }
  182. void SetPIXELFOGTYPE( bool i )
  183. {
  184. m_nPIXELFOGTYPE = i ? 1 : 0;
  185. #ifdef _DEBUG
  186. m_bPIXELFOGTYPE = true;
  187. #endif
  188. }
  189. public:
  190. shatteredglass_ps20_Dynamic_Index()
  191. {
  192. #ifdef _DEBUG
  193. m_bHDRENABLED = false;
  194. #endif // _DEBUG
  195. m_nHDRENABLED = 0;
  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_bHDRENABLED && m_bPIXELFOGTYPE;
  207. Assert( bAllDynamicVarsDefined );
  208. #endif // _DEBUG
  209. return ( 1 * m_nHDRENABLED ) + ( 2 * m_nPIXELFOGTYPE ) + 0;
  210. }
  211. };
  212. #define shaderDynamicTest_shatteredglass_ps20 psh_forgot_to_set_dynamic_HDRENABLED + psh_forgot_to_set_dynamic_PIXELFOGTYPE + 0