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.

173 lines
4.1 KiB

  1. // ALL SKIP STATEMENTS THAT AFFECT THIS SHADER!!!
  2. // ( $DOWATERFOG == 0 ) && ( $DOPIXELFOG && $HARDWAREFOGBLEND )
  3. // defined $LIGHTING_PREVIEW && defined $FASTPATH && $LIGHTING_PREVIEW && $FASTPATH
  4. #include "shaderlib/cshader.h"
  5. class vertexlitgeneric_flashlight_vs20_Static_Index
  6. {
  7. private:
  8. int m_nTEETH;
  9. #ifdef _DEBUG
  10. bool m_bTEETH;
  11. #endif
  12. public:
  13. void SetTEETH( int i )
  14. {
  15. Assert( i >= 0 && i <= 1 );
  16. m_nTEETH = i;
  17. #ifdef _DEBUG
  18. m_bTEETH = true;
  19. #endif
  20. }
  21. void SetTEETH( bool i )
  22. {
  23. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  24. m_nTEETH = i ? 1 : 0;
  25. #ifdef _DEBUG
  26. m_bTEETH = true;
  27. #endif
  28. }
  29. private:
  30. int m_nDOPIXELFOG;
  31. #ifdef _DEBUG
  32. bool m_bDOPIXELFOG;
  33. #endif
  34. public:
  35. void SetDOPIXELFOG( int i )
  36. {
  37. Assert( i >= 0 && i <= 1 );
  38. m_nDOPIXELFOG = i;
  39. #ifdef _DEBUG
  40. m_bDOPIXELFOG = true;
  41. #endif
  42. }
  43. void SetDOPIXELFOG( bool i )
  44. {
  45. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  46. m_nDOPIXELFOG = i ? 1 : 0;
  47. #ifdef _DEBUG
  48. m_bDOPIXELFOG = true;
  49. #endif
  50. }
  51. public:
  52. // CONSTRUCTOR
  53. vertexlitgeneric_flashlight_vs20_Static_Index( IShaderShadow *pShaderShadow, IMaterialVar **params )
  54. {
  55. #ifdef _DEBUG
  56. m_bTEETH = false;
  57. #endif // _DEBUG
  58. m_nTEETH = 0;
  59. #ifdef _DEBUG
  60. m_bDOPIXELFOG = true;
  61. #endif // _DEBUG
  62. m_nDOPIXELFOG = ( g_pHardwareConfig->SupportsPixelShaders_2_b() && !IS_FLAG_SET( MATERIAL_VAR_VERTEXFOG ) ) ? 1 : 0 ;
  63. }
  64. int GetIndex()
  65. {
  66. // Asserts to make sure that we aren't using any skipped combinations.
  67. // Asserts to make sure that we are setting all of the combination vars.
  68. #ifdef _DEBUG
  69. bool bAllStaticVarsDefined = m_bTEETH && m_bDOPIXELFOG;
  70. Assert( bAllStaticVarsDefined );
  71. #endif // _DEBUG
  72. return ( 4 * m_nTEETH ) + ( 8 * m_nDOPIXELFOG ) + 0;
  73. }
  74. };
  75. #define shaderStaticTest_vertexlitgeneric_flashlight_vs20 vsh_forgot_to_set_static_TEETH + 0
  76. class vertexlitgeneric_flashlight_vs20_Dynamic_Index
  77. {
  78. private:
  79. int m_nSKINNING;
  80. #ifdef _DEBUG
  81. bool m_bSKINNING;
  82. #endif
  83. public:
  84. void SetSKINNING( int i )
  85. {
  86. Assert( i >= 0 && i <= 1 );
  87. m_nSKINNING = i;
  88. #ifdef _DEBUG
  89. m_bSKINNING = true;
  90. #endif
  91. }
  92. void SetSKINNING( bool i )
  93. {
  94. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  95. m_nSKINNING = i ? 1 : 0;
  96. #ifdef _DEBUG
  97. m_bSKINNING = true;
  98. #endif
  99. }
  100. private:
  101. int m_nDOWATERFOG;
  102. #ifdef _DEBUG
  103. bool m_bDOWATERFOG;
  104. #endif
  105. public:
  106. void SetDOWATERFOG( int i )
  107. {
  108. Assert( i >= 0 && i <= 1 );
  109. m_nDOWATERFOG = i;
  110. #ifdef _DEBUG
  111. m_bDOWATERFOG = true;
  112. #endif
  113. }
  114. void SetDOWATERFOG( bool i )
  115. {
  116. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  117. m_nDOWATERFOG = i ? 1 : 0;
  118. #ifdef _DEBUG
  119. m_bDOWATERFOG = true;
  120. #endif
  121. }
  122. public:
  123. // CONSTRUCTOR
  124. vertexlitgeneric_flashlight_vs20_Dynamic_Index( IShaderDynamicAPI *pShaderAPI )
  125. {
  126. #ifdef _DEBUG
  127. m_bSKINNING = false;
  128. #endif // _DEBUG
  129. m_nSKINNING = 0;
  130. #ifdef _DEBUG
  131. m_bDOWATERFOG = true;
  132. #endif // _DEBUG
  133. m_nDOWATERFOG = ( pShaderAPI->GetSceneFogMode() == MATERIAL_FOG_LINEAR_BELOW_FOG_Z ) ;
  134. }
  135. int GetIndex()
  136. {
  137. // Asserts to make sure that we aren't using any skipped combinations.
  138. // Asserts to make sure that we are setting all of the combination vars.
  139. #ifdef _DEBUG
  140. bool bAllDynamicVarsDefined = m_bSKINNING && m_bDOWATERFOG;
  141. Assert( bAllDynamicVarsDefined );
  142. #endif // _DEBUG
  143. return ( 1 * m_nSKINNING ) + ( 2 * m_nDOWATERFOG ) + 0;
  144. }
  145. };
  146. #define shaderDynamicTest_vertexlitgeneric_flashlight_vs20 vsh_forgot_to_set_dynamic_SKINNING + 0
  147. static const ShaderComboInformation_t s_DynamicComboArray_vertexlitgeneric_flashlight_vs20[2] =
  148. {
  149. { "SKINNING", 0, 1 },
  150. { "DOWATERFOG", 0, 1 },
  151. };
  152. static const ShaderComboInformation_t s_StaticComboArray_vertexlitgeneric_flashlight_vs20[2] =
  153. {
  154. { "TEETH", 0, 1 },
  155. { "DOPIXELFOG", 0, 1 },
  156. };
  157. static const ShaderComboSemantics_t vertexlitgeneric_flashlight_vs20_combos =
  158. {
  159. "vertexlitgeneric_flashlight_vs20", s_DynamicComboArray_vertexlitgeneric_flashlight_vs20, 2, s_StaticComboArray_vertexlitgeneric_flashlight_vs20, 2
  160. };
  161. class ConstructMe_vertexlitgeneric_flashlight_vs20
  162. {
  163. public:
  164. ConstructMe_vertexlitgeneric_flashlight_vs20()
  165. {
  166. GetShaderDLL()->AddShaderComboInformation( &vertexlitgeneric_flashlight_vs20_combos );
  167. }
  168. };
  169. static ConstructMe_vertexlitgeneric_flashlight_vs20 s_ConstructMe_vertexlitgeneric_flashlight_vs20;