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 lightmappedreflective_ps20_Static_Index
  3. {
  4. private:
  5. int m_nBASETEXTURE;
  6. #ifdef _DEBUG
  7. bool m_bBASETEXTURE;
  8. #endif
  9. public:
  10. void SetBASETEXTURE( int i )
  11. {
  12. Assert( i >= 0 && i <= 1 );
  13. m_nBASETEXTURE = i;
  14. #ifdef _DEBUG
  15. m_bBASETEXTURE = true;
  16. #endif
  17. }
  18. void SetBASETEXTURE( bool i )
  19. {
  20. m_nBASETEXTURE = i ? 1 : 0;
  21. #ifdef _DEBUG
  22. m_bBASETEXTURE = true;
  23. #endif
  24. }
  25. private:
  26. int m_nREFLECT;
  27. #ifdef _DEBUG
  28. bool m_bREFLECT;
  29. #endif
  30. public:
  31. void SetREFLECT( int i )
  32. {
  33. Assert( i >= 0 && i <= 1 );
  34. m_nREFLECT = i;
  35. #ifdef _DEBUG
  36. m_bREFLECT = true;
  37. #endif
  38. }
  39. void SetREFLECT( bool i )
  40. {
  41. m_nREFLECT = i ? 1 : 0;
  42. #ifdef _DEBUG
  43. m_bREFLECT = true;
  44. #endif
  45. }
  46. private:
  47. int m_nREFRACT;
  48. #ifdef _DEBUG
  49. bool m_bREFRACT;
  50. #endif
  51. public:
  52. void SetREFRACT( int i )
  53. {
  54. Assert( i >= 0 && i <= 1 );
  55. m_nREFRACT = i;
  56. #ifdef _DEBUG
  57. m_bREFRACT = true;
  58. #endif
  59. }
  60. void SetREFRACT( bool i )
  61. {
  62. m_nREFRACT = i ? 1 : 0;
  63. #ifdef _DEBUG
  64. m_bREFRACT = true;
  65. #endif
  66. }
  67. private:
  68. int m_nENVMAPMASK;
  69. #ifdef _DEBUG
  70. bool m_bENVMAPMASK;
  71. #endif
  72. public:
  73. void SetENVMAPMASK( int i )
  74. {
  75. Assert( i >= 0 && i <= 1 );
  76. m_nENVMAPMASK = i;
  77. #ifdef _DEBUG
  78. m_bENVMAPMASK = true;
  79. #endif
  80. }
  81. void SetENVMAPMASK( bool i )
  82. {
  83. m_nENVMAPMASK = i ? 1 : 0;
  84. #ifdef _DEBUG
  85. m_bENVMAPMASK = true;
  86. #endif
  87. }
  88. public:
  89. lightmappedreflective_ps20_Static_Index( )
  90. {
  91. #ifdef _DEBUG
  92. m_bBASETEXTURE = false;
  93. #endif // _DEBUG
  94. m_nBASETEXTURE = 0;
  95. #ifdef _DEBUG
  96. m_bREFLECT = false;
  97. #endif // _DEBUG
  98. m_nREFLECT = 0;
  99. #ifdef _DEBUG
  100. m_bREFRACT = false;
  101. #endif // _DEBUG
  102. m_nREFRACT = 0;
  103. #ifdef _DEBUG
  104. m_bENVMAPMASK = false;
  105. #endif // _DEBUG
  106. m_nENVMAPMASK = 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_bBASETEXTURE && m_bREFLECT && m_bREFRACT && m_bENVMAPMASK;
  114. Assert( bAllStaticVarsDefined );
  115. #endif // _DEBUG
  116. return ( 2 * m_nBASETEXTURE ) + ( 4 * m_nREFLECT ) + ( 8 * m_nREFRACT ) + ( 16 * m_nENVMAPMASK ) + 0;
  117. }
  118. };
  119. #define shaderStaticTest_lightmappedreflective_ps20 psh_forgot_to_set_static_BASETEXTURE + psh_forgot_to_set_static_REFLECT + psh_forgot_to_set_static_REFRACT + psh_forgot_to_set_static_ENVMAPMASK + 0
  120. class lightmappedreflective_ps20_Dynamic_Index
  121. {
  122. private:
  123. int m_nPIXELFOGTYPE;
  124. #ifdef _DEBUG
  125. bool m_bPIXELFOGTYPE;
  126. #endif
  127. public:
  128. void SetPIXELFOGTYPE( int i )
  129. {
  130. Assert( i >= 0 && i <= 1 );
  131. m_nPIXELFOGTYPE = i;
  132. #ifdef _DEBUG
  133. m_bPIXELFOGTYPE = true;
  134. #endif
  135. }
  136. void SetPIXELFOGTYPE( bool i )
  137. {
  138. m_nPIXELFOGTYPE = i ? 1 : 0;
  139. #ifdef _DEBUG
  140. m_bPIXELFOGTYPE = true;
  141. #endif
  142. }
  143. public:
  144. lightmappedreflective_ps20_Dynamic_Index()
  145. {
  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_bPIXELFOGTYPE;
  157. Assert( bAllDynamicVarsDefined );
  158. #endif // _DEBUG
  159. return ( 1 * m_nPIXELFOGTYPE ) + 0;
  160. }
  161. };
  162. #define shaderDynamicTest_lightmappedreflective_ps20 psh_forgot_to_set_dynamic_PIXELFOGTYPE + 0