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

  1. #include "shaderlib/cshader.h"
  2. class flashlight_ps20_Static_Index
  3. {
  4. private:
  5. int m_nNORMALMAP;
  6. #ifdef _DEBUG
  7. bool m_bNORMALMAP;
  8. #endif
  9. public:
  10. void SetNORMALMAP( int i )
  11. {
  12. Assert( i >= 0 && i <= 2 );
  13. m_nNORMALMAP = i;
  14. #ifdef _DEBUG
  15. m_bNORMALMAP = true;
  16. #endif
  17. }
  18. void SetNORMALMAP( bool i )
  19. {
  20. m_nNORMALMAP = i ? 1 : 0;
  21. #ifdef _DEBUG
  22. m_bNORMALMAP = true;
  23. #endif
  24. }
  25. private:
  26. int m_nNORMALMAP2;
  27. #ifdef _DEBUG
  28. bool m_bNORMALMAP2;
  29. #endif
  30. public:
  31. void SetNORMALMAP2( int i )
  32. {
  33. Assert( i >= 0 && i <= 1 );
  34. m_nNORMALMAP2 = i;
  35. #ifdef _DEBUG
  36. m_bNORMALMAP2 = true;
  37. #endif
  38. }
  39. void SetNORMALMAP2( bool i )
  40. {
  41. m_nNORMALMAP2 = i ? 1 : 0;
  42. #ifdef _DEBUG
  43. m_bNORMALMAP2 = true;
  44. #endif
  45. }
  46. private:
  47. int m_nWORLDVERTEXTRANSITION;
  48. #ifdef _DEBUG
  49. bool m_bWORLDVERTEXTRANSITION;
  50. #endif
  51. public:
  52. void SetWORLDVERTEXTRANSITION( int i )
  53. {
  54. Assert( i >= 0 && i <= 1 );
  55. m_nWORLDVERTEXTRANSITION = i;
  56. #ifdef _DEBUG
  57. m_bWORLDVERTEXTRANSITION = true;
  58. #endif
  59. }
  60. void SetWORLDVERTEXTRANSITION( bool i )
  61. {
  62. m_nWORLDVERTEXTRANSITION = i ? 1 : 0;
  63. #ifdef _DEBUG
  64. m_bWORLDVERTEXTRANSITION = true;
  65. #endif
  66. }
  67. private:
  68. int m_nSEAMLESS;
  69. #ifdef _DEBUG
  70. bool m_bSEAMLESS;
  71. #endif
  72. public:
  73. void SetSEAMLESS( int i )
  74. {
  75. Assert( i >= 0 && i <= 1 );
  76. m_nSEAMLESS = i;
  77. #ifdef _DEBUG
  78. m_bSEAMLESS = true;
  79. #endif
  80. }
  81. void SetSEAMLESS( bool i )
  82. {
  83. m_nSEAMLESS = i ? 1 : 0;
  84. #ifdef _DEBUG
  85. m_bSEAMLESS = true;
  86. #endif
  87. }
  88. private:
  89. int m_nDETAILTEXTURE;
  90. #ifdef _DEBUG
  91. bool m_bDETAILTEXTURE;
  92. #endif
  93. public:
  94. void SetDETAILTEXTURE( int i )
  95. {
  96. Assert( i >= 0 && i <= 1 );
  97. m_nDETAILTEXTURE = i;
  98. #ifdef _DEBUG
  99. m_bDETAILTEXTURE = true;
  100. #endif
  101. }
  102. void SetDETAILTEXTURE( bool i )
  103. {
  104. m_nDETAILTEXTURE = i ? 1 : 0;
  105. #ifdef _DEBUG
  106. m_bDETAILTEXTURE = true;
  107. #endif
  108. }
  109. private:
  110. int m_nDETAIL_BLEND_MODE;
  111. #ifdef _DEBUG
  112. bool m_bDETAIL_BLEND_MODE;
  113. #endif
  114. public:
  115. void SetDETAIL_BLEND_MODE( int i )
  116. {
  117. Assert( i >= 0 && i <= 1 );
  118. m_nDETAIL_BLEND_MODE = i;
  119. #ifdef _DEBUG
  120. m_bDETAIL_BLEND_MODE = true;
  121. #endif
  122. }
  123. void SetDETAIL_BLEND_MODE( bool i )
  124. {
  125. m_nDETAIL_BLEND_MODE = i ? 1 : 0;
  126. #ifdef _DEBUG
  127. m_bDETAIL_BLEND_MODE = true;
  128. #endif
  129. }
  130. public:
  131. flashlight_ps20_Static_Index( )
  132. {
  133. #ifdef _DEBUG
  134. m_bNORMALMAP = false;
  135. #endif // _DEBUG
  136. m_nNORMALMAP = 0;
  137. #ifdef _DEBUG
  138. m_bNORMALMAP2 = false;
  139. #endif // _DEBUG
  140. m_nNORMALMAP2 = 0;
  141. #ifdef _DEBUG
  142. m_bWORLDVERTEXTRANSITION = false;
  143. #endif // _DEBUG
  144. m_nWORLDVERTEXTRANSITION = 0;
  145. #ifdef _DEBUG
  146. m_bSEAMLESS = false;
  147. #endif // _DEBUG
  148. m_nSEAMLESS = 0;
  149. #ifdef _DEBUG
  150. m_bDETAILTEXTURE = false;
  151. #endif // _DEBUG
  152. m_nDETAILTEXTURE = 0;
  153. #ifdef _DEBUG
  154. m_bDETAIL_BLEND_MODE = false;
  155. #endif // _DEBUG
  156. m_nDETAIL_BLEND_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_bNORMALMAP && m_bNORMALMAP2 && m_bWORLDVERTEXTRANSITION && m_bSEAMLESS && m_bDETAILTEXTURE && m_bDETAIL_BLEND_MODE;
  164. Assert( bAllStaticVarsDefined );
  165. #endif // _DEBUG
  166. return ( 2 * m_nNORMALMAP ) + ( 6 * m_nNORMALMAP2 ) + ( 12 * m_nWORLDVERTEXTRANSITION ) + ( 24 * m_nSEAMLESS ) + ( 48 * m_nDETAILTEXTURE ) + ( 96 * m_nDETAIL_BLEND_MODE ) + 0;
  167. }
  168. };
  169. #define shaderStaticTest_flashlight_ps20 psh_forgot_to_set_static_NORMALMAP + psh_forgot_to_set_static_NORMALMAP2 + psh_forgot_to_set_static_WORLDVERTEXTRANSITION + psh_forgot_to_set_static_SEAMLESS + psh_forgot_to_set_static_DETAILTEXTURE + psh_forgot_to_set_static_DETAIL_BLEND_MODE + 0
  170. class flashlight_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. flashlight_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_flashlight_ps20 psh_forgot_to_set_dynamic_PIXELFOGTYPE + 0