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.

261 lines
5.2 KiB

  1. class skin_ps20_Static_Index
  2. {
  3. private:
  4. int m_nBASETEXTURE;
  5. #ifdef _DEBUG
  6. bool m_bBASETEXTURE;
  7. #endif
  8. public:
  9. void SetBASETEXTURE( int i )
  10. {
  11. Assert( i >= 0 && i <= 1 );
  12. m_nBASETEXTURE = i;
  13. #ifdef _DEBUG
  14. m_bBASETEXTURE = true;
  15. #endif
  16. }
  17. void SetBASETEXTURE( bool i )
  18. {
  19. m_nBASETEXTURE = i ? 1 : 0;
  20. #ifdef _DEBUG
  21. m_bBASETEXTURE = true;
  22. #endif
  23. }
  24. private:
  25. int m_nBUMPTEXTURE;
  26. #ifdef _DEBUG
  27. bool m_bBUMPTEXTURE;
  28. #endif
  29. public:
  30. void SetBUMPTEXTURE( int i )
  31. {
  32. Assert( i >= 0 && i <= 1 );
  33. m_nBUMPTEXTURE = i;
  34. #ifdef _DEBUG
  35. m_bBUMPTEXTURE = true;
  36. #endif
  37. }
  38. void SetBUMPTEXTURE( bool i )
  39. {
  40. m_nBUMPTEXTURE = i ? 1 : 0;
  41. #ifdef _DEBUG
  42. m_bBUMPTEXTURE = true;
  43. #endif
  44. }
  45. private:
  46. int m_nDIFFUSELIGHTING;
  47. #ifdef _DEBUG
  48. bool m_bDIFFUSELIGHTING;
  49. #endif
  50. public:
  51. void SetDIFFUSELIGHTING( int i )
  52. {
  53. Assert( i >= 0 && i <= 1 );
  54. m_nDIFFUSELIGHTING = i;
  55. #ifdef _DEBUG
  56. m_bDIFFUSELIGHTING = true;
  57. #endif
  58. }
  59. void SetDIFFUSELIGHTING( bool i )
  60. {
  61. m_nDIFFUSELIGHTING = i ? 1 : 0;
  62. #ifdef _DEBUG
  63. m_bDIFFUSELIGHTING = true;
  64. #endif
  65. }
  66. private:
  67. int m_nSELFILLUM;
  68. #ifdef _DEBUG
  69. bool m_bSELFILLUM;
  70. #endif
  71. public:
  72. void SetSELFILLUM( int i )
  73. {
  74. Assert( i >= 0 && i <= 1 );
  75. m_nSELFILLUM = i;
  76. #ifdef _DEBUG
  77. m_bSELFILLUM = true;
  78. #endif
  79. }
  80. void SetSELFILLUM( bool i )
  81. {
  82. m_nSELFILLUM = i ? 1 : 0;
  83. #ifdef _DEBUG
  84. m_bSELFILLUM = true;
  85. #endif
  86. }
  87. private:
  88. int m_nHALFLAMBERT;
  89. #ifdef _DEBUG
  90. bool m_bHALFLAMBERT;
  91. #endif
  92. public:
  93. void SetHALFLAMBERT( int i )
  94. {
  95. Assert( i >= 0 && i <= 1 );
  96. m_nHALFLAMBERT = i;
  97. #ifdef _DEBUG
  98. m_bHALFLAMBERT = true;
  99. #endif
  100. }
  101. void SetHALFLAMBERT( bool i )
  102. {
  103. m_nHALFLAMBERT = i ? 1 : 0;
  104. #ifdef _DEBUG
  105. m_bHALFLAMBERT = true;
  106. #endif
  107. }
  108. private:
  109. int m_nFLASHLIGHT;
  110. #ifdef _DEBUG
  111. bool m_bFLASHLIGHT;
  112. #endif
  113. public:
  114. void SetFLASHLIGHT( int i )
  115. {
  116. Assert( i >= 0 && i <= 1 );
  117. m_nFLASHLIGHT = i;
  118. #ifdef _DEBUG
  119. m_bFLASHLIGHT = true;
  120. #endif
  121. }
  122. void SetFLASHLIGHT( bool i )
  123. {
  124. m_nFLASHLIGHT = i ? 1 : 0;
  125. #ifdef _DEBUG
  126. m_bFLASHLIGHT = true;
  127. #endif
  128. }
  129. public:
  130. skin_ps20_Static_Index()
  131. {
  132. #ifdef _DEBUG
  133. m_bBASETEXTURE = false;
  134. #endif // _DEBUG
  135. m_nBASETEXTURE = 0;
  136. #ifdef _DEBUG
  137. m_bBUMPTEXTURE = false;
  138. #endif // _DEBUG
  139. m_nBUMPTEXTURE = 0;
  140. #ifdef _DEBUG
  141. m_bDIFFUSELIGHTING = false;
  142. #endif // _DEBUG
  143. m_nDIFFUSELIGHTING = 0;
  144. #ifdef _DEBUG
  145. m_bSELFILLUM = false;
  146. #endif // _DEBUG
  147. m_nSELFILLUM = 0;
  148. #ifdef _DEBUG
  149. m_bHALFLAMBERT = false;
  150. #endif // _DEBUG
  151. m_nHALFLAMBERT = 0;
  152. #ifdef _DEBUG
  153. m_bFLASHLIGHT = false;
  154. #endif // _DEBUG
  155. m_nFLASHLIGHT = 0;
  156. }
  157. int GetIndex()
  158. {
  159. // Asserts to make sure that we aren't using any skipped combinations.
  160. // Asserts to make sure that we are setting all of the combination vars.
  161. #ifdef _DEBUG
  162. bool bAllStaticVarsDefined = m_bBASETEXTURE && m_bBUMPTEXTURE && m_bDIFFUSELIGHTING && m_bSELFILLUM && m_bHALFLAMBERT && m_bFLASHLIGHT;
  163. Assert( bAllStaticVarsDefined );
  164. #endif // _DEBUG
  165. return ( 132 * m_nBASETEXTURE ) + ( 264 * m_nBUMPTEXTURE ) + ( 528 * m_nDIFFUSELIGHTING ) + ( 1056 * m_nSELFILLUM ) + ( 2112 * m_nHALFLAMBERT ) + ( 4224 * m_nFLASHLIGHT ) + 0;
  166. }
  167. };
  168. #define shaderStaticTest_skin_ps20 psh_forgot_to_set_static_BASETEXTURE + psh_forgot_to_set_static_BUMPTEXTURE + psh_forgot_to_set_static_DIFFUSELIGHTING + psh_forgot_to_set_static_SELFILLUM + psh_forgot_to_set_static_HALFLAMBERT + psh_forgot_to_set_static_FLASHLIGHT + 0
  169. class skin_ps20_Dynamic_Index
  170. {
  171. private:
  172. int m_nLIGHT_COMBO;
  173. #ifdef _DEBUG
  174. bool m_bLIGHT_COMBO;
  175. #endif
  176. public:
  177. void SetLIGHT_COMBO( int i )
  178. {
  179. Assert( i >= 0 && i <= 21 );
  180. m_nLIGHT_COMBO = i;
  181. #ifdef _DEBUG
  182. m_bLIGHT_COMBO = true;
  183. #endif
  184. }
  185. void SetLIGHT_COMBO( bool i )
  186. {
  187. m_nLIGHT_COMBO = i ? 1 : 0;
  188. #ifdef _DEBUG
  189. m_bLIGHT_COMBO = true;
  190. #endif
  191. }
  192. private:
  193. int m_nWRITEWATERFOGTODESTALPHA;
  194. #ifdef _DEBUG
  195. bool m_bWRITEWATERFOGTODESTALPHA;
  196. #endif
  197. public:
  198. void SetWRITEWATERFOGTODESTALPHA( int i )
  199. {
  200. Assert( i >= 0 && i <= 1 );
  201. m_nWRITEWATERFOGTODESTALPHA = i;
  202. #ifdef _DEBUG
  203. m_bWRITEWATERFOGTODESTALPHA = true;
  204. #endif
  205. }
  206. void SetWRITEWATERFOGTODESTALPHA( bool i )
  207. {
  208. m_nWRITEWATERFOGTODESTALPHA = i ? 1 : 0;
  209. #ifdef _DEBUG
  210. m_bWRITEWATERFOGTODESTALPHA = true;
  211. #endif
  212. }
  213. private:
  214. int m_nFOGTYPE;
  215. #ifdef _DEBUG
  216. bool m_bFOGTYPE;
  217. #endif
  218. public:
  219. void SetFOGTYPE( int i )
  220. {
  221. Assert( i >= 0 && i <= 2 );
  222. m_nFOGTYPE = i;
  223. #ifdef _DEBUG
  224. m_bFOGTYPE = true;
  225. #endif
  226. }
  227. void SetFOGTYPE( bool i )
  228. {
  229. m_nFOGTYPE = i ? 1 : 0;
  230. #ifdef _DEBUG
  231. m_bFOGTYPE = true;
  232. #endif
  233. }
  234. public:
  235. skin_ps20_Dynamic_Index()
  236. {
  237. #ifdef _DEBUG
  238. m_bLIGHT_COMBO = false;
  239. #endif // _DEBUG
  240. m_nLIGHT_COMBO = 0;
  241. #ifdef _DEBUG
  242. m_bWRITEWATERFOGTODESTALPHA = false;
  243. #endif // _DEBUG
  244. m_nWRITEWATERFOGTODESTALPHA = 0;
  245. #ifdef _DEBUG
  246. m_bFOGTYPE = false;
  247. #endif // _DEBUG
  248. m_nFOGTYPE = 0;
  249. }
  250. int GetIndex()
  251. {
  252. // Asserts to make sure that we aren't using any skipped combinations.
  253. // Asserts to make sure that we are setting all of the combination vars.
  254. #ifdef _DEBUG
  255. bool bAllDynamicVarsDefined = m_bLIGHT_COMBO && m_bWRITEWATERFOGTODESTALPHA && m_bFOGTYPE;
  256. Assert( bAllDynamicVarsDefined );
  257. #endif // _DEBUG
  258. return ( 1 * m_nLIGHT_COMBO ) + ( 22 * m_nWRITEWATERFOGTODESTALPHA ) + ( 44 * m_nFOGTYPE ) + 0;
  259. }
  260. };
  261. #define shaderDynamicTest_skin_ps20 psh_forgot_to_set_dynamic_LIGHT_COMBO + psh_forgot_to_set_dynamic_WRITEWATERFOGTODESTALPHA + psh_forgot_to_set_dynamic_FOGTYPE + 0