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.

161 lines
3.2 KiB

  1. class lightingonly_vs20_Static_Index
  2. {
  3. private:
  4. int m_nHALFLAMBERT;
  5. #ifdef _DEBUG
  6. bool m_bHALFLAMBERT;
  7. #endif
  8. public:
  9. void SetHALFLAMBERT( int i )
  10. {
  11. Assert( i >= 0 && i <= 1 );
  12. m_nHALFLAMBERT = i;
  13. #ifdef _DEBUG
  14. m_bHALFLAMBERT = true;
  15. #endif
  16. }
  17. void SetHALFLAMBERT( bool i )
  18. {
  19. m_nHALFLAMBERT = i ? 1 : 0;
  20. #ifdef _DEBUG
  21. m_bHALFLAMBERT = true;
  22. #endif
  23. }
  24. public:
  25. lightingonly_vs20_Static_Index()
  26. {
  27. #ifdef _DEBUG
  28. m_bHALFLAMBERT = false;
  29. #endif // _DEBUG
  30. m_nHALFLAMBERT = 0;
  31. }
  32. int GetIndex()
  33. {
  34. // Asserts to make sure that we aren't using any skipped combinations.
  35. // Asserts to make sure that we are setting all of the combination vars.
  36. #ifdef _DEBUG
  37. bool bAllStaticVarsDefined = m_bHALFLAMBERT;
  38. Assert( bAllStaticVarsDefined );
  39. #endif // _DEBUG
  40. return ( 32 * m_nHALFLAMBERT ) + 0;
  41. }
  42. };
  43. #define shaderStaticTest_lightingonly_vs20 vsh_forgot_to_set_static_HALFLAMBERT + 0
  44. class lightingonly_vs20_Dynamic_Index
  45. {
  46. private:
  47. int m_nDOWATERFOG;
  48. #ifdef _DEBUG
  49. bool m_bDOWATERFOG;
  50. #endif
  51. public:
  52. void SetDOWATERFOG( int i )
  53. {
  54. Assert( i >= 0 && i <= 1 );
  55. m_nDOWATERFOG = i;
  56. #ifdef _DEBUG
  57. m_bDOWATERFOG = true;
  58. #endif
  59. }
  60. void SetDOWATERFOG( bool i )
  61. {
  62. m_nDOWATERFOG = i ? 1 : 0;
  63. #ifdef _DEBUG
  64. m_bDOWATERFOG = true;
  65. #endif
  66. }
  67. private:
  68. int m_nNUM_BONES;
  69. #ifdef _DEBUG
  70. bool m_bNUM_BONES;
  71. #endif
  72. public:
  73. void SetNUM_BONES( int i )
  74. {
  75. Assert( i >= 0 && i <= 3 );
  76. m_nNUM_BONES = i;
  77. #ifdef _DEBUG
  78. m_bNUM_BONES = true;
  79. #endif
  80. }
  81. void SetNUM_BONES( bool i )
  82. {
  83. m_nNUM_BONES = i ? 1 : 0;
  84. #ifdef _DEBUG
  85. m_bNUM_BONES = true;
  86. #endif
  87. }
  88. private:
  89. int m_nAMBIENT_LIGHT;
  90. #ifdef _DEBUG
  91. bool m_bAMBIENT_LIGHT;
  92. #endif
  93. public:
  94. void SetAMBIENT_LIGHT( int i )
  95. {
  96. Assert( i >= 0 && i <= 1 );
  97. m_nAMBIENT_LIGHT = i;
  98. #ifdef _DEBUG
  99. m_bAMBIENT_LIGHT = true;
  100. #endif
  101. }
  102. void SetAMBIENT_LIGHT( bool i )
  103. {
  104. m_nAMBIENT_LIGHT = i ? 1 : 0;
  105. #ifdef _DEBUG
  106. m_bAMBIENT_LIGHT = true;
  107. #endif
  108. }
  109. private:
  110. int m_nSTATIC_LIGHT;
  111. #ifdef _DEBUG
  112. bool m_bSTATIC_LIGHT;
  113. #endif
  114. public:
  115. void SetSTATIC_LIGHT( int i )
  116. {
  117. Assert( i >= 0 && i <= 1 );
  118. m_nSTATIC_LIGHT = i;
  119. #ifdef _DEBUG
  120. m_bSTATIC_LIGHT = true;
  121. #endif
  122. }
  123. void SetSTATIC_LIGHT( bool i )
  124. {
  125. m_nSTATIC_LIGHT = i ? 1 : 0;
  126. #ifdef _DEBUG
  127. m_bSTATIC_LIGHT = true;
  128. #endif
  129. }
  130. public:
  131. lightingonly_vs20_Dynamic_Index()
  132. {
  133. #ifdef _DEBUG
  134. m_bDOWATERFOG = false;
  135. #endif // _DEBUG
  136. m_nDOWATERFOG = 0;
  137. #ifdef _DEBUG
  138. m_bNUM_BONES = false;
  139. #endif // _DEBUG
  140. m_nNUM_BONES = 0;
  141. #ifdef _DEBUG
  142. m_bAMBIENT_LIGHT = false;
  143. #endif // _DEBUG
  144. m_nAMBIENT_LIGHT = 0;
  145. #ifdef _DEBUG
  146. m_bSTATIC_LIGHT = false;
  147. #endif // _DEBUG
  148. m_nSTATIC_LIGHT = 0;
  149. }
  150. int GetIndex()
  151. {
  152. // Asserts to make sure that we aren't using any skipped combinations.
  153. // Asserts to make sure that we are setting all of the combination vars.
  154. #ifdef _DEBUG
  155. bool bAllDynamicVarsDefined = m_bDOWATERFOG && m_bNUM_BONES && m_bAMBIENT_LIGHT && m_bSTATIC_LIGHT;
  156. Assert( bAllDynamicVarsDefined );
  157. #endif // _DEBUG
  158. return ( 1 * m_nDOWATERFOG ) + ( 2 * m_nNUM_BONES ) + ( 8 * m_nAMBIENT_LIGHT ) + ( 16 * m_nSTATIC_LIGHT ) + 0;
  159. }
  160. };
  161. #define shaderDynamicTest_lightingonly_vs20 vsh_forgot_to_set_dynamic_DOWATERFOG + vsh_forgot_to_set_dynamic_NUM_BONES + vsh_forgot_to_set_dynamic_AMBIENT_LIGHT + vsh_forgot_to_set_dynamic_STATIC_LIGHT + 0