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.

262 lines
5.2 KiB

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