Counter Strike : Global Offensive Source Code
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.

199 lines
4.4 KiB

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