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.

187 lines
3.8 KiB

  1. #include "shaderlib/cshader.h"
  2. class portal_vs11_Static_Index
  3. {
  4. private:
  5. int m_nMAXTEXTURESTAGES;
  6. #ifdef _DEBUG
  7. bool m_bMAXTEXTURESTAGES;
  8. #endif
  9. public:
  10. void SetMAXTEXTURESTAGES( int i )
  11. {
  12. Assert( i >= 0 && i <= 2 );
  13. m_nMAXTEXTURESTAGES = i;
  14. #ifdef _DEBUG
  15. m_bMAXTEXTURESTAGES = true;
  16. #endif
  17. }
  18. void SetMAXTEXTURESTAGES( bool i )
  19. {
  20. m_nMAXTEXTURESTAGES = i ? 1 : 0;
  21. #ifdef _DEBUG
  22. m_bMAXTEXTURESTAGES = true;
  23. #endif
  24. }
  25. private:
  26. int m_nHASALPHAMASK;
  27. #ifdef _DEBUG
  28. bool m_bHASALPHAMASK;
  29. #endif
  30. public:
  31. void SetHASALPHAMASK( int i )
  32. {
  33. Assert( i >= 0 && i <= 1 );
  34. m_nHASALPHAMASK = i;
  35. #ifdef _DEBUG
  36. m_bHASALPHAMASK = true;
  37. #endif
  38. }
  39. void SetHASALPHAMASK( bool i )
  40. {
  41. m_nHASALPHAMASK = i ? 1 : 0;
  42. #ifdef _DEBUG
  43. m_bHASALPHAMASK = true;
  44. #endif
  45. }
  46. private:
  47. int m_nHASSTATICTEXTURE;
  48. #ifdef _DEBUG
  49. bool m_bHASSTATICTEXTURE;
  50. #endif
  51. public:
  52. void SetHASSTATICTEXTURE( int i )
  53. {
  54. Assert( i >= 0 && i <= 1 );
  55. m_nHASSTATICTEXTURE = i;
  56. #ifdef _DEBUG
  57. m_bHASSTATICTEXTURE = true;
  58. #endif
  59. }
  60. void SetHASSTATICTEXTURE( bool i )
  61. {
  62. m_nHASSTATICTEXTURE = i ? 1 : 0;
  63. #ifdef _DEBUG
  64. m_bHASSTATICTEXTURE = true;
  65. #endif
  66. }
  67. private:
  68. int m_nUSEALTERNATEVIEW;
  69. #ifdef _DEBUG
  70. bool m_bUSEALTERNATEVIEW;
  71. #endif
  72. public:
  73. void SetUSEALTERNATEVIEW( int i )
  74. {
  75. Assert( i >= 0 && i <= 1 );
  76. m_nUSEALTERNATEVIEW = i;
  77. #ifdef _DEBUG
  78. m_bUSEALTERNATEVIEW = true;
  79. #endif
  80. }
  81. void SetUSEALTERNATEVIEW( bool i )
  82. {
  83. m_nUSEALTERNATEVIEW = i ? 1 : 0;
  84. #ifdef _DEBUG
  85. m_bUSEALTERNATEVIEW = true;
  86. #endif
  87. }
  88. public:
  89. portal_vs11_Static_Index( )
  90. {
  91. #ifdef _DEBUG
  92. m_bMAXTEXTURESTAGES = false;
  93. #endif // _DEBUG
  94. m_nMAXTEXTURESTAGES = 0;
  95. #ifdef _DEBUG
  96. m_bHASALPHAMASK = false;
  97. #endif // _DEBUG
  98. m_nHASALPHAMASK = 0;
  99. #ifdef _DEBUG
  100. m_bHASSTATICTEXTURE = false;
  101. #endif // _DEBUG
  102. m_nHASSTATICTEXTURE = 0;
  103. #ifdef _DEBUG
  104. m_bUSEALTERNATEVIEW = false;
  105. #endif // _DEBUG
  106. m_nUSEALTERNATEVIEW = 0;
  107. }
  108. int GetIndex()
  109. {
  110. // Asserts to make sure that we aren't using any skipped combinations.
  111. // Asserts to make sure that we are setting all of the combination vars.
  112. #ifdef _DEBUG
  113. bool bAllStaticVarsDefined = m_bMAXTEXTURESTAGES && m_bHASALPHAMASK && m_bHASSTATICTEXTURE && m_bUSEALTERNATEVIEW;
  114. Assert( bAllStaticVarsDefined );
  115. #endif // _DEBUG
  116. return ( 4 * m_nMAXTEXTURESTAGES ) + ( 12 * m_nHASALPHAMASK ) + ( 24 * m_nHASSTATICTEXTURE ) + ( 48 * m_nUSEALTERNATEVIEW ) + 0;
  117. }
  118. };
  119. #define shaderStaticTest_portal_vs11 vsh_forgot_to_set_static_MAXTEXTURESTAGES + vsh_forgot_to_set_static_HASALPHAMASK + vsh_forgot_to_set_static_HASSTATICTEXTURE + vsh_forgot_to_set_static_USEALTERNATEVIEW + 0
  120. class portal_vs11_Dynamic_Index
  121. {
  122. private:
  123. int m_nSKINNING;
  124. #ifdef _DEBUG
  125. bool m_bSKINNING;
  126. #endif
  127. public:
  128. void SetSKINNING( int i )
  129. {
  130. Assert( i >= 0 && i <= 1 );
  131. m_nSKINNING = i;
  132. #ifdef _DEBUG
  133. m_bSKINNING = true;
  134. #endif
  135. }
  136. void SetSKINNING( bool i )
  137. {
  138. m_nSKINNING = i ? 1 : 0;
  139. #ifdef _DEBUG
  140. m_bSKINNING = true;
  141. #endif
  142. }
  143. private:
  144. int m_nADDSTATIC;
  145. #ifdef _DEBUG
  146. bool m_bADDSTATIC;
  147. #endif
  148. public:
  149. void SetADDSTATIC( int i )
  150. {
  151. Assert( i >= 0 && i <= 1 );
  152. m_nADDSTATIC = i;
  153. #ifdef _DEBUG
  154. m_bADDSTATIC = true;
  155. #endif
  156. }
  157. void SetADDSTATIC( bool i )
  158. {
  159. m_nADDSTATIC = i ? 1 : 0;
  160. #ifdef _DEBUG
  161. m_bADDSTATIC = true;
  162. #endif
  163. }
  164. public:
  165. portal_vs11_Dynamic_Index()
  166. {
  167. #ifdef _DEBUG
  168. m_bSKINNING = false;
  169. #endif // _DEBUG
  170. m_nSKINNING = 0;
  171. #ifdef _DEBUG
  172. m_bADDSTATIC = false;
  173. #endif // _DEBUG
  174. m_nADDSTATIC = 0;
  175. }
  176. int GetIndex()
  177. {
  178. // Asserts to make sure that we aren't using any skipped combinations.
  179. // Asserts to make sure that we are setting all of the combination vars.
  180. #ifdef _DEBUG
  181. bool bAllDynamicVarsDefined = m_bSKINNING && m_bADDSTATIC;
  182. Assert( bAllDynamicVarsDefined );
  183. #endif // _DEBUG
  184. return ( 1 * m_nSKINNING ) + ( 2 * m_nADDSTATIC ) + 0;
  185. }
  186. };
  187. #define shaderDynamicTest_portal_vs11 vsh_forgot_to_set_dynamic_SKINNING + vsh_forgot_to_set_dynamic_ADDSTATIC + 0