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.

162 lines
3.2 KiB

  1. #include "shaderlib/cshader.h"
  2. class portal_ps20_Static_Index
  3. {
  4. private:
  5. int m_nHASALPHAMASK;
  6. #ifdef _DEBUG
  7. bool m_bHASALPHAMASK;
  8. #endif
  9. public:
  10. void SetHASALPHAMASK( int i )
  11. {
  12. Assert( i >= 0 && i <= 1 );
  13. m_nHASALPHAMASK = i;
  14. #ifdef _DEBUG
  15. m_bHASALPHAMASK = true;
  16. #endif
  17. }
  18. void SetHASALPHAMASK( bool i )
  19. {
  20. m_nHASALPHAMASK = i ? 1 : 0;
  21. #ifdef _DEBUG
  22. m_bHASALPHAMASK = true;
  23. #endif
  24. }
  25. private:
  26. int m_nHASSTATICTEXTURE;
  27. #ifdef _DEBUG
  28. bool m_bHASSTATICTEXTURE;
  29. #endif
  30. public:
  31. void SetHASSTATICTEXTURE( int i )
  32. {
  33. Assert( i >= 0 && i <= 1 );
  34. m_nHASSTATICTEXTURE = i;
  35. #ifdef _DEBUG
  36. m_bHASSTATICTEXTURE = true;
  37. #endif
  38. }
  39. void SetHASSTATICTEXTURE( bool i )
  40. {
  41. m_nHASSTATICTEXTURE = i ? 1 : 0;
  42. #ifdef _DEBUG
  43. m_bHASSTATICTEXTURE = true;
  44. #endif
  45. }
  46. public:
  47. portal_ps20_Static_Index( )
  48. {
  49. #ifdef _DEBUG
  50. m_bHASALPHAMASK = false;
  51. #endif // _DEBUG
  52. m_nHASALPHAMASK = 0;
  53. #ifdef _DEBUG
  54. m_bHASSTATICTEXTURE = false;
  55. #endif // _DEBUG
  56. m_nHASSTATICTEXTURE = 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_bHASALPHAMASK && m_bHASSTATICTEXTURE;
  64. Assert( bAllStaticVarsDefined );
  65. #endif // _DEBUG
  66. return ( 8 * m_nHASALPHAMASK ) + ( 16 * m_nHASSTATICTEXTURE ) + 0;
  67. }
  68. };
  69. #define shaderStaticTest_portal_ps20 psh_forgot_to_set_static_HASALPHAMASK + psh_forgot_to_set_static_HASSTATICTEXTURE + 0
  70. class portal_ps20_Dynamic_Index
  71. {
  72. private:
  73. int m_nADDSTATIC;
  74. #ifdef _DEBUG
  75. bool m_bADDSTATIC;
  76. #endif
  77. public:
  78. void SetADDSTATIC( int i )
  79. {
  80. Assert( i >= 0 && i <= 1 );
  81. m_nADDSTATIC = i;
  82. #ifdef _DEBUG
  83. m_bADDSTATIC = true;
  84. #endif
  85. }
  86. void SetADDSTATIC( bool i )
  87. {
  88. m_nADDSTATIC = i ? 1 : 0;
  89. #ifdef _DEBUG
  90. m_bADDSTATIC = true;
  91. #endif
  92. }
  93. private:
  94. int m_nHDRENABLED;
  95. #ifdef _DEBUG
  96. bool m_bHDRENABLED;
  97. #endif
  98. public:
  99. void SetHDRENABLED( int i )
  100. {
  101. Assert( i >= 0 && i <= 1 );
  102. m_nHDRENABLED = i;
  103. #ifdef _DEBUG
  104. m_bHDRENABLED = true;
  105. #endif
  106. }
  107. void SetHDRENABLED( bool i )
  108. {
  109. m_nHDRENABLED = i ? 1 : 0;
  110. #ifdef _DEBUG
  111. m_bHDRENABLED = true;
  112. #endif
  113. }
  114. private:
  115. int m_nPIXELFOGTYPE;
  116. #ifdef _DEBUG
  117. bool m_bPIXELFOGTYPE;
  118. #endif
  119. public:
  120. void SetPIXELFOGTYPE( int i )
  121. {
  122. Assert( i >= 0 && i <= 1 );
  123. m_nPIXELFOGTYPE = i;
  124. #ifdef _DEBUG
  125. m_bPIXELFOGTYPE = true;
  126. #endif
  127. }
  128. void SetPIXELFOGTYPE( bool i )
  129. {
  130. m_nPIXELFOGTYPE = i ? 1 : 0;
  131. #ifdef _DEBUG
  132. m_bPIXELFOGTYPE = true;
  133. #endif
  134. }
  135. public:
  136. portal_ps20_Dynamic_Index()
  137. {
  138. #ifdef _DEBUG
  139. m_bADDSTATIC = false;
  140. #endif // _DEBUG
  141. m_nADDSTATIC = 0;
  142. #ifdef _DEBUG
  143. m_bHDRENABLED = false;
  144. #endif // _DEBUG
  145. m_nHDRENABLED = 0;
  146. #ifdef _DEBUG
  147. m_bPIXELFOGTYPE = false;
  148. #endif // _DEBUG
  149. m_nPIXELFOGTYPE = 0;
  150. }
  151. int GetIndex()
  152. {
  153. // Asserts to make sure that we aren't using any skipped combinations.
  154. // Asserts to make sure that we are setting all of the combination vars.
  155. #ifdef _DEBUG
  156. bool bAllDynamicVarsDefined = m_bADDSTATIC && m_bHDRENABLED && m_bPIXELFOGTYPE;
  157. Assert( bAllDynamicVarsDefined );
  158. #endif // _DEBUG
  159. return ( 1 * m_nADDSTATIC ) + ( 2 * m_nHDRENABLED ) + ( 4 * m_nPIXELFOGTYPE ) + 0;
  160. }
  161. };
  162. #define shaderDynamicTest_portal_ps20 psh_forgot_to_set_dynamic_ADDSTATIC + psh_forgot_to_set_dynamic_HDRENABLED + psh_forgot_to_set_dynamic_PIXELFOGTYPE + 0