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

  1. #include "shaderlib/cshader.h"
  2. class example_model_ps20b_Static_Index
  3. {
  4. private:
  5. int m_nCONVERT_TO_SRGB;
  6. #ifdef _DEBUG
  7. bool m_bCONVERT_TO_SRGB;
  8. #endif
  9. public:
  10. void SetCONVERT_TO_SRGB( int i )
  11. {
  12. Assert( i >= 0 && i <= 0 );
  13. m_nCONVERT_TO_SRGB = i;
  14. #ifdef _DEBUG
  15. m_bCONVERT_TO_SRGB = true;
  16. #endif
  17. }
  18. void SetCONVERT_TO_SRGB( bool i )
  19. {
  20. m_nCONVERT_TO_SRGB = i ? 1 : 0;
  21. #ifdef _DEBUG
  22. m_bCONVERT_TO_SRGB = true;
  23. #endif
  24. }
  25. private:
  26. int m_nFLASHLIGHT;
  27. #ifdef _DEBUG
  28. bool m_bFLASHLIGHT;
  29. #endif
  30. public:
  31. void SetFLASHLIGHT( int i )
  32. {
  33. Assert( i >= 0 && i <= 1 );
  34. m_nFLASHLIGHT = i;
  35. #ifdef _DEBUG
  36. m_bFLASHLIGHT = true;
  37. #endif
  38. }
  39. void SetFLASHLIGHT( bool i )
  40. {
  41. m_nFLASHLIGHT = i ? 1 : 0;
  42. #ifdef _DEBUG
  43. m_bFLASHLIGHT = true;
  44. #endif
  45. }
  46. private:
  47. int m_nFLASHLIGHTDEPTHFILTERMODE;
  48. #ifdef _DEBUG
  49. bool m_bFLASHLIGHTDEPTHFILTERMODE;
  50. #endif
  51. public:
  52. void SetFLASHLIGHTDEPTHFILTERMODE( int i )
  53. {
  54. Assert( i >= 0 && i <= 2 );
  55. m_nFLASHLIGHTDEPTHFILTERMODE = i;
  56. #ifdef _DEBUG
  57. m_bFLASHLIGHTDEPTHFILTERMODE = true;
  58. #endif
  59. }
  60. void SetFLASHLIGHTDEPTHFILTERMODE( bool i )
  61. {
  62. m_nFLASHLIGHTDEPTHFILTERMODE = i ? 1 : 0;
  63. #ifdef _DEBUG
  64. m_bFLASHLIGHTDEPTHFILTERMODE = true;
  65. #endif
  66. }
  67. public:
  68. example_model_ps20b_Static_Index( )
  69. {
  70. #ifdef _DEBUG
  71. m_bCONVERT_TO_SRGB = false;
  72. #endif // _DEBUG
  73. m_nCONVERT_TO_SRGB = 0;
  74. #ifdef _DEBUG
  75. m_bFLASHLIGHT = false;
  76. #endif // _DEBUG
  77. m_nFLASHLIGHT = 0;
  78. #ifdef _DEBUG
  79. m_bFLASHLIGHTDEPTHFILTERMODE = false;
  80. #endif // _DEBUG
  81. m_nFLASHLIGHTDEPTHFILTERMODE = 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_bCONVERT_TO_SRGB && m_bFLASHLIGHT && m_bFLASHLIGHTDEPTHFILTERMODE;
  89. Assert( bAllStaticVarsDefined );
  90. #endif // _DEBUG
  91. return ( 80 * m_nCONVERT_TO_SRGB ) + ( 80 * m_nFLASHLIGHT ) + ( 160 * m_nFLASHLIGHTDEPTHFILTERMODE ) + 0;
  92. }
  93. };
  94. #define shaderStaticTest_example_model_ps20b psh_forgot_to_set_static_CONVERT_TO_SRGB + psh_forgot_to_set_static_FLASHLIGHT + psh_forgot_to_set_static_FLASHLIGHTDEPTHFILTERMODE + 0
  95. class example_model_ps20b_Dynamic_Index
  96. {
  97. private:
  98. int m_nWRITEWATERFOGTODESTALPHA;
  99. #ifdef _DEBUG
  100. bool m_bWRITEWATERFOGTODESTALPHA;
  101. #endif
  102. public:
  103. void SetWRITEWATERFOGTODESTALPHA( int i )
  104. {
  105. Assert( i >= 0 && i <= 1 );
  106. m_nWRITEWATERFOGTODESTALPHA = i;
  107. #ifdef _DEBUG
  108. m_bWRITEWATERFOGTODESTALPHA = true;
  109. #endif
  110. }
  111. void SetWRITEWATERFOGTODESTALPHA( bool i )
  112. {
  113. m_nWRITEWATERFOGTODESTALPHA = i ? 1 : 0;
  114. #ifdef _DEBUG
  115. m_bWRITEWATERFOGTODESTALPHA = true;
  116. #endif
  117. }
  118. private:
  119. int m_nPIXELFOGTYPE;
  120. #ifdef _DEBUG
  121. bool m_bPIXELFOGTYPE;
  122. #endif
  123. public:
  124. void SetPIXELFOGTYPE( int i )
  125. {
  126. Assert( i >= 0 && i <= 1 );
  127. m_nPIXELFOGTYPE = i;
  128. #ifdef _DEBUG
  129. m_bPIXELFOGTYPE = true;
  130. #endif
  131. }
  132. void SetPIXELFOGTYPE( bool i )
  133. {
  134. m_nPIXELFOGTYPE = i ? 1 : 0;
  135. #ifdef _DEBUG
  136. m_bPIXELFOGTYPE = true;
  137. #endif
  138. }
  139. private:
  140. int m_nNUM_LIGHTS;
  141. #ifdef _DEBUG
  142. bool m_bNUM_LIGHTS;
  143. #endif
  144. public:
  145. void SetNUM_LIGHTS( int i )
  146. {
  147. Assert( i >= 0 && i <= 4 );
  148. m_nNUM_LIGHTS = i;
  149. #ifdef _DEBUG
  150. m_bNUM_LIGHTS = true;
  151. #endif
  152. }
  153. void SetNUM_LIGHTS( bool i )
  154. {
  155. m_nNUM_LIGHTS = i ? 1 : 0;
  156. #ifdef _DEBUG
  157. m_bNUM_LIGHTS = true;
  158. #endif
  159. }
  160. private:
  161. int m_nWRITE_DEPTH_TO_DESTALPHA;
  162. #ifdef _DEBUG
  163. bool m_bWRITE_DEPTH_TO_DESTALPHA;
  164. #endif
  165. public:
  166. void SetWRITE_DEPTH_TO_DESTALPHA( int i )
  167. {
  168. Assert( i >= 0 && i <= 1 );
  169. m_nWRITE_DEPTH_TO_DESTALPHA = i;
  170. #ifdef _DEBUG
  171. m_bWRITE_DEPTH_TO_DESTALPHA = true;
  172. #endif
  173. }
  174. void SetWRITE_DEPTH_TO_DESTALPHA( bool i )
  175. {
  176. m_nWRITE_DEPTH_TO_DESTALPHA = i ? 1 : 0;
  177. #ifdef _DEBUG
  178. m_bWRITE_DEPTH_TO_DESTALPHA = true;
  179. #endif
  180. }
  181. private:
  182. int m_nFLASHLIGHTSHADOWS;
  183. #ifdef _DEBUG
  184. bool m_bFLASHLIGHTSHADOWS;
  185. #endif
  186. public:
  187. void SetFLASHLIGHTSHADOWS( int i )
  188. {
  189. Assert( i >= 0 && i <= 1 );
  190. m_nFLASHLIGHTSHADOWS = i;
  191. #ifdef _DEBUG
  192. m_bFLASHLIGHTSHADOWS = true;
  193. #endif
  194. }
  195. void SetFLASHLIGHTSHADOWS( bool i )
  196. {
  197. m_nFLASHLIGHTSHADOWS = i ? 1 : 0;
  198. #ifdef _DEBUG
  199. m_bFLASHLIGHTSHADOWS = true;
  200. #endif
  201. }
  202. public:
  203. example_model_ps20b_Dynamic_Index()
  204. {
  205. #ifdef _DEBUG
  206. m_bWRITEWATERFOGTODESTALPHA = false;
  207. #endif // _DEBUG
  208. m_nWRITEWATERFOGTODESTALPHA = 0;
  209. #ifdef _DEBUG
  210. m_bPIXELFOGTYPE = false;
  211. #endif // _DEBUG
  212. m_nPIXELFOGTYPE = 0;
  213. #ifdef _DEBUG
  214. m_bNUM_LIGHTS = false;
  215. #endif // _DEBUG
  216. m_nNUM_LIGHTS = 0;
  217. #ifdef _DEBUG
  218. m_bWRITE_DEPTH_TO_DESTALPHA = false;
  219. #endif // _DEBUG
  220. m_nWRITE_DEPTH_TO_DESTALPHA = 0;
  221. #ifdef _DEBUG
  222. m_bFLASHLIGHTSHADOWS = false;
  223. #endif // _DEBUG
  224. m_nFLASHLIGHTSHADOWS = 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_bWRITEWATERFOGTODESTALPHA && m_bPIXELFOGTYPE && m_bNUM_LIGHTS && m_bWRITE_DEPTH_TO_DESTALPHA && m_bFLASHLIGHTSHADOWS;
  232. Assert( bAllDynamicVarsDefined );
  233. #endif // _DEBUG
  234. return ( 1 * m_nWRITEWATERFOGTODESTALPHA ) + ( 2 * m_nPIXELFOGTYPE ) + ( 4 * m_nNUM_LIGHTS ) + ( 20 * m_nWRITE_DEPTH_TO_DESTALPHA ) + ( 40 * m_nFLASHLIGHTSHADOWS ) + 0;
  235. }
  236. };
  237. #define shaderDynamicTest_example_model_ps20b psh_forgot_to_set_dynamic_WRITEWATERFOGTODESTALPHA + psh_forgot_to_set_dynamic_PIXELFOGTYPE + psh_forgot_to_set_dynamic_NUM_LIGHTS + psh_forgot_to_set_dynamic_WRITE_DEPTH_TO_DESTALPHA + psh_forgot_to_set_dynamic_FLASHLIGHTSHADOWS + 0