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.

137 lines
2.9 KiB

  1. #include "shaderlib/cshader.h"
  2. class vertexlit_lighting_only_ps20_Static_Index
  3. {
  4. private:
  5. int m_nDIFFUSELIGHTING;
  6. #ifdef _DEBUG
  7. bool m_bDIFFUSELIGHTING;
  8. #endif
  9. public:
  10. void SetDIFFUSELIGHTING( int i )
  11. {
  12. Assert( i >= 0 && i <= 1 );
  13. m_nDIFFUSELIGHTING = i;
  14. #ifdef _DEBUG
  15. m_bDIFFUSELIGHTING = true;
  16. #endif
  17. }
  18. void SetDIFFUSELIGHTING( bool i )
  19. {
  20. m_nDIFFUSELIGHTING = i ? 1 : 0;
  21. #ifdef _DEBUG
  22. m_bDIFFUSELIGHTING = true;
  23. #endif
  24. }
  25. private:
  26. int m_nHALFLAMBERT;
  27. #ifdef _DEBUG
  28. bool m_bHALFLAMBERT;
  29. #endif
  30. public:
  31. void SetHALFLAMBERT( int i )
  32. {
  33. Assert( i >= 0 && i <= 1 );
  34. m_nHALFLAMBERT = i;
  35. #ifdef _DEBUG
  36. m_bHALFLAMBERT = true;
  37. #endif
  38. }
  39. void SetHALFLAMBERT( bool i )
  40. {
  41. m_nHALFLAMBERT = i ? 1 : 0;
  42. #ifdef _DEBUG
  43. m_bHALFLAMBERT = true;
  44. #endif
  45. }
  46. public:
  47. vertexlit_lighting_only_ps20_Static_Index( )
  48. {
  49. #ifdef _DEBUG
  50. m_bDIFFUSELIGHTING = false;
  51. #endif // _DEBUG
  52. m_nDIFFUSELIGHTING = 0;
  53. #ifdef _DEBUG
  54. m_bHALFLAMBERT = false;
  55. #endif // _DEBUG
  56. m_nHALFLAMBERT = 0;
  57. }
  58. int GetIndex()
  59. {
  60. // Asserts to make sure that we aren't using any skipped combinations.
  61. // Asserts to make sure that we are setting all of the combination vars.
  62. #ifdef _DEBUG
  63. bool bAllStaticVarsDefined = m_bDIFFUSELIGHTING && m_bHALFLAMBERT;
  64. Assert( bAllStaticVarsDefined );
  65. #endif // _DEBUG
  66. return ( 6 * m_nDIFFUSELIGHTING ) + ( 12 * m_nHALFLAMBERT ) + 0;
  67. }
  68. };
  69. #define shaderStaticTest_vertexlit_lighting_only_ps20 psh_forgot_to_set_static_DIFFUSELIGHTING + psh_forgot_to_set_static_HALFLAMBERT + 0
  70. class vertexlit_lighting_only_ps20_Dynamic_Index
  71. {
  72. private:
  73. int m_nAMBIENT_LIGHT;
  74. #ifdef _DEBUG
  75. bool m_bAMBIENT_LIGHT;
  76. #endif
  77. public:
  78. void SetAMBIENT_LIGHT( int i )
  79. {
  80. Assert( i >= 0 && i <= 1 );
  81. m_nAMBIENT_LIGHT = i;
  82. #ifdef _DEBUG
  83. m_bAMBIENT_LIGHT = true;
  84. #endif
  85. }
  86. void SetAMBIENT_LIGHT( bool i )
  87. {
  88. m_nAMBIENT_LIGHT = i ? 1 : 0;
  89. #ifdef _DEBUG
  90. m_bAMBIENT_LIGHT = true;
  91. #endif
  92. }
  93. private:
  94. int m_nNUM_LIGHTS;
  95. #ifdef _DEBUG
  96. bool m_bNUM_LIGHTS;
  97. #endif
  98. public:
  99. void SetNUM_LIGHTS( int i )
  100. {
  101. Assert( i >= 0 && i <= 2 );
  102. m_nNUM_LIGHTS = i;
  103. #ifdef _DEBUG
  104. m_bNUM_LIGHTS = true;
  105. #endif
  106. }
  107. void SetNUM_LIGHTS( bool i )
  108. {
  109. m_nNUM_LIGHTS = i ? 1 : 0;
  110. #ifdef _DEBUG
  111. m_bNUM_LIGHTS = true;
  112. #endif
  113. }
  114. public:
  115. vertexlit_lighting_only_ps20_Dynamic_Index()
  116. {
  117. #ifdef _DEBUG
  118. m_bAMBIENT_LIGHT = false;
  119. #endif // _DEBUG
  120. m_nAMBIENT_LIGHT = 0;
  121. #ifdef _DEBUG
  122. m_bNUM_LIGHTS = false;
  123. #endif // _DEBUG
  124. m_nNUM_LIGHTS = 0;
  125. }
  126. int GetIndex()
  127. {
  128. // Asserts to make sure that we aren't using any skipped combinations.
  129. // Asserts to make sure that we are setting all of the combination vars.
  130. #ifdef _DEBUG
  131. bool bAllDynamicVarsDefined = m_bAMBIENT_LIGHT && m_bNUM_LIGHTS;
  132. Assert( bAllDynamicVarsDefined );
  133. #endif // _DEBUG
  134. return ( 1 * m_nAMBIENT_LIGHT ) + ( 2 * m_nNUM_LIGHTS ) + 0;
  135. }
  136. };
  137. #define shaderDynamicTest_vertexlit_lighting_only_ps20 psh_forgot_to_set_dynamic_AMBIENT_LIGHT + psh_forgot_to_set_dynamic_NUM_LIGHTS + 0