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

  1. #include "shaderlib/cshader.h"
  2. class teeth_vs20_Static_Index
  3. {
  4. private:
  5. int m_nINTRO;
  6. #ifdef _DEBUG
  7. bool m_bINTRO;
  8. #endif
  9. public:
  10. void SetINTRO( int i )
  11. {
  12. Assert( i >= 0 && i <= 1 );
  13. m_nINTRO = i;
  14. #ifdef _DEBUG
  15. m_bINTRO = true;
  16. #endif
  17. }
  18. void SetINTRO( bool i )
  19. {
  20. m_nINTRO = i ? 1 : 0;
  21. #ifdef _DEBUG
  22. m_bINTRO = true;
  23. #endif
  24. }
  25. private:
  26. int m_nUSE_STATIC_CONTROL_FLOW;
  27. #ifdef _DEBUG
  28. bool m_bUSE_STATIC_CONTROL_FLOW;
  29. #endif
  30. public:
  31. void SetUSE_STATIC_CONTROL_FLOW( int i )
  32. {
  33. Assert( i >= 0 && i <= 1 );
  34. m_nUSE_STATIC_CONTROL_FLOW = i;
  35. #ifdef _DEBUG
  36. m_bUSE_STATIC_CONTROL_FLOW = true;
  37. #endif
  38. }
  39. void SetUSE_STATIC_CONTROL_FLOW( bool i )
  40. {
  41. m_nUSE_STATIC_CONTROL_FLOW = i ? 1 : 0;
  42. #ifdef _DEBUG
  43. m_bUSE_STATIC_CONTROL_FLOW = true;
  44. #endif
  45. }
  46. public:
  47. teeth_vs20_Static_Index( )
  48. {
  49. #ifdef _DEBUG
  50. m_bINTRO = false;
  51. #endif // _DEBUG
  52. m_nINTRO = 0;
  53. #ifdef _DEBUG
  54. m_bUSE_STATIC_CONTROL_FLOW = false;
  55. #endif // _DEBUG
  56. m_nUSE_STATIC_CONTROL_FLOW = 0;
  57. }
  58. int GetIndex()
  59. {
  60. // Asserts to make sure that we aren't using any skipped combinations.
  61. // Asserts to make sure that we are setting all of the combination vars.
  62. #ifdef _DEBUG
  63. bool bAllStaticVarsDefined = m_bINTRO && m_bUSE_STATIC_CONTROL_FLOW;
  64. Assert( bAllStaticVarsDefined );
  65. #endif // _DEBUG
  66. return ( 96 * m_nINTRO ) + ( 192 * m_nUSE_STATIC_CONTROL_FLOW ) + 0;
  67. }
  68. };
  69. #define shaderStaticTest_teeth_vs20 vsh_forgot_to_set_static_INTRO + vsh_forgot_to_set_static_USE_STATIC_CONTROL_FLOW + 0
  70. class teeth_vs20_Dynamic_Index
  71. {
  72. private:
  73. int m_nCOMPRESSED_VERTS;
  74. #ifdef _DEBUG
  75. bool m_bCOMPRESSED_VERTS;
  76. #endif
  77. public:
  78. void SetCOMPRESSED_VERTS( int i )
  79. {
  80. Assert( i >= 0 && i <= 1 );
  81. m_nCOMPRESSED_VERTS = i;
  82. #ifdef _DEBUG
  83. m_bCOMPRESSED_VERTS = true;
  84. #endif
  85. }
  86. void SetCOMPRESSED_VERTS( bool i )
  87. {
  88. m_nCOMPRESSED_VERTS = i ? 1 : 0;
  89. #ifdef _DEBUG
  90. m_bCOMPRESSED_VERTS = true;
  91. #endif
  92. }
  93. private:
  94. int m_nDOWATERFOG;
  95. #ifdef _DEBUG
  96. bool m_bDOWATERFOG;
  97. #endif
  98. public:
  99. void SetDOWATERFOG( int i )
  100. {
  101. Assert( i >= 0 && i <= 1 );
  102. m_nDOWATERFOG = i;
  103. #ifdef _DEBUG
  104. m_bDOWATERFOG = true;
  105. #endif
  106. }
  107. void SetDOWATERFOG( bool i )
  108. {
  109. m_nDOWATERFOG = i ? 1 : 0;
  110. #ifdef _DEBUG
  111. m_bDOWATERFOG = true;
  112. #endif
  113. }
  114. private:
  115. int m_nSKINNING;
  116. #ifdef _DEBUG
  117. bool m_bSKINNING;
  118. #endif
  119. public:
  120. void SetSKINNING( int i )
  121. {
  122. Assert( i >= 0 && i <= 1 );
  123. m_nSKINNING = i;
  124. #ifdef _DEBUG
  125. m_bSKINNING = true;
  126. #endif
  127. }
  128. void SetSKINNING( bool i )
  129. {
  130. m_nSKINNING = i ? 1 : 0;
  131. #ifdef _DEBUG
  132. m_bSKINNING = true;
  133. #endif
  134. }
  135. private:
  136. int m_nDYNAMIC_LIGHT;
  137. #ifdef _DEBUG
  138. bool m_bDYNAMIC_LIGHT;
  139. #endif
  140. public:
  141. void SetDYNAMIC_LIGHT( int i )
  142. {
  143. Assert( i >= 0 && i <= 1 );
  144. m_nDYNAMIC_LIGHT = i;
  145. #ifdef _DEBUG
  146. m_bDYNAMIC_LIGHT = true;
  147. #endif
  148. }
  149. void SetDYNAMIC_LIGHT( bool i )
  150. {
  151. m_nDYNAMIC_LIGHT = i ? 1 : 0;
  152. #ifdef _DEBUG
  153. m_bDYNAMIC_LIGHT = true;
  154. #endif
  155. }
  156. private:
  157. int m_nSTATIC_LIGHT;
  158. #ifdef _DEBUG
  159. bool m_bSTATIC_LIGHT;
  160. #endif
  161. public:
  162. void SetSTATIC_LIGHT( int i )
  163. {
  164. Assert( i >= 0 && i <= 1 );
  165. m_nSTATIC_LIGHT = i;
  166. #ifdef _DEBUG
  167. m_bSTATIC_LIGHT = true;
  168. #endif
  169. }
  170. void SetSTATIC_LIGHT( bool i )
  171. {
  172. m_nSTATIC_LIGHT = i ? 1 : 0;
  173. #ifdef _DEBUG
  174. m_bSTATIC_LIGHT = true;
  175. #endif
  176. }
  177. private:
  178. int m_nNUM_LIGHTS;
  179. #ifdef _DEBUG
  180. bool m_bNUM_LIGHTS;
  181. #endif
  182. public:
  183. void SetNUM_LIGHTS( int i )
  184. {
  185. Assert( i >= 0 && i <= 2 );
  186. m_nNUM_LIGHTS = i;
  187. #ifdef _DEBUG
  188. m_bNUM_LIGHTS = true;
  189. #endif
  190. }
  191. void SetNUM_LIGHTS( bool i )
  192. {
  193. m_nNUM_LIGHTS = i ? 1 : 0;
  194. #ifdef _DEBUG
  195. m_bNUM_LIGHTS = true;
  196. #endif
  197. }
  198. public:
  199. teeth_vs20_Dynamic_Index()
  200. {
  201. #ifdef _DEBUG
  202. m_bCOMPRESSED_VERTS = false;
  203. #endif // _DEBUG
  204. m_nCOMPRESSED_VERTS = 0;
  205. #ifdef _DEBUG
  206. m_bDOWATERFOG = false;
  207. #endif // _DEBUG
  208. m_nDOWATERFOG = 0;
  209. #ifdef _DEBUG
  210. m_bSKINNING = false;
  211. #endif // _DEBUG
  212. m_nSKINNING = 0;
  213. #ifdef _DEBUG
  214. m_bDYNAMIC_LIGHT = false;
  215. #endif // _DEBUG
  216. m_nDYNAMIC_LIGHT = 0;
  217. #ifdef _DEBUG
  218. m_bSTATIC_LIGHT = false;
  219. #endif // _DEBUG
  220. m_nSTATIC_LIGHT = 0;
  221. #ifdef _DEBUG
  222. m_bNUM_LIGHTS = false;
  223. #endif // _DEBUG
  224. m_nNUM_LIGHTS = 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_bCOMPRESSED_VERTS && m_bDOWATERFOG && m_bSKINNING && m_bDYNAMIC_LIGHT && m_bSTATIC_LIGHT && m_bNUM_LIGHTS;
  232. Assert( bAllDynamicVarsDefined );
  233. #endif // _DEBUG
  234. return ( 1 * m_nCOMPRESSED_VERTS ) + ( 2 * m_nDOWATERFOG ) + ( 4 * m_nSKINNING ) + ( 8 * m_nDYNAMIC_LIGHT ) + ( 16 * m_nSTATIC_LIGHT ) + ( 32 * m_nNUM_LIGHTS ) + 0;
  235. }
  236. };
  237. #define shaderDynamicTest_teeth_vs20 vsh_forgot_to_set_dynamic_COMPRESSED_VERTS + vsh_forgot_to_set_dynamic_DOWATERFOG + vsh_forgot_to_set_dynamic_SKINNING + vsh_forgot_to_set_dynamic_DYNAMIC_LIGHT + vsh_forgot_to_set_dynamic_STATIC_LIGHT + vsh_forgot_to_set_dynamic_NUM_LIGHTS + 0