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.

200 lines
3.6 KiB

  1. class vertexlitgeneric_vs11_Static_Index
  2. {
  3. private:
  4. int m_nHALF_LAMBERT;
  5. #ifdef _DEBUG
  6. bool m_bHALF_LAMBERT;
  7. #endif
  8. public:
  9. void SetHALF_LAMBERT( int i )
  10. {
  11. Assert( i >= 0 && i <= 1 );
  12. m_nHALF_LAMBERT = i;
  13. #ifdef _DEBUG
  14. m_bHALF_LAMBERT = true;
  15. #endif
  16. }
  17. void SetHALF_LAMBERT( bool i )
  18. {
  19. m_nHALF_LAMBERT = i ? 1 : 0;
  20. #ifdef _DEBUG
  21. m_bHALF_LAMBERT = true;
  22. #endif
  23. }
  24. private:
  25. int m_nENVMAP;
  26. #ifdef _DEBUG
  27. bool m_bENVMAP;
  28. #endif
  29. public:
  30. void SetENVMAP( int i )
  31. {
  32. Assert( i >= 0 && i <= 1 );
  33. m_nENVMAP = i;
  34. #ifdef _DEBUG
  35. m_bENVMAP = true;
  36. #endif
  37. }
  38. void SetENVMAP( bool i )
  39. {
  40. m_nENVMAP = i ? 1 : 0;
  41. #ifdef _DEBUG
  42. m_bENVMAP = true;
  43. #endif
  44. }
  45. private:
  46. int m_nENVMAPCAMERASPACE;
  47. #ifdef _DEBUG
  48. bool m_bENVMAPCAMERASPACE;
  49. #endif
  50. public:
  51. void SetENVMAPCAMERASPACE( int i )
  52. {
  53. }
  54. void SetENVMAPCAMERASPACE( bool i )
  55. {
  56. }
  57. private:
  58. int m_nENVMAPSPHERE;
  59. #ifdef _DEBUG
  60. bool m_bENVMAPSPHERE;
  61. #endif
  62. public:
  63. void SetENVMAPSPHERE( int i )
  64. {
  65. Assert( i >= 0 && i <= 1 );
  66. m_nENVMAPSPHERE = i;
  67. #ifdef _DEBUG
  68. m_bENVMAPSPHERE = true;
  69. #endif
  70. }
  71. void SetENVMAPSPHERE( bool i )
  72. {
  73. m_nENVMAPSPHERE = i ? 1 : 0;
  74. #ifdef _DEBUG
  75. m_bENVMAPSPHERE = true;
  76. #endif
  77. }
  78. public:
  79. vertexlitgeneric_vs11_Static_Index()
  80. {
  81. #ifdef _DEBUG
  82. m_bHALF_LAMBERT = false;
  83. #endif // _DEBUG
  84. m_nHALF_LAMBERT = 0;
  85. #ifdef _DEBUG
  86. m_bENVMAP = false;
  87. #endif // _DEBUG
  88. m_nENVMAP = 0;
  89. #ifdef _DEBUG
  90. m_bENVMAPCAMERASPACE = true;
  91. #endif // _DEBUG
  92. m_nENVMAPCAMERASPACE = 0;
  93. #ifdef _DEBUG
  94. m_bENVMAPSPHERE = false;
  95. #endif // _DEBUG
  96. m_nENVMAPSPHERE = 0;
  97. }
  98. int GetIndex()
  99. {
  100. // Asserts to make sure that we aren't using any skipped combinations.
  101. // Asserts to make sure that we are setting all of the combination vars.
  102. #ifdef _DEBUG
  103. bool bAllStaticVarsDefined = m_bHALF_LAMBERT && m_bENVMAP && m_bENVMAPCAMERASPACE && m_bENVMAPSPHERE;
  104. Assert( bAllStaticVarsDefined );
  105. #endif // _DEBUG
  106. return ( 88 * m_nHALF_LAMBERT ) + ( 176 * m_nENVMAP ) + ( 352 * m_nENVMAPCAMERASPACE ) + ( 352 * m_nENVMAPSPHERE ) + 0;
  107. }
  108. };
  109. class vertexlitgeneric_vs11_Dynamic_Index
  110. {
  111. private:
  112. int m_nDOWATERFOG;
  113. #ifdef _DEBUG
  114. bool m_bDOWATERFOG;
  115. #endif
  116. public:
  117. void SetDOWATERFOG( int i )
  118. {
  119. Assert( i >= 0 && i <= 1 );
  120. m_nDOWATERFOG = i;
  121. #ifdef _DEBUG
  122. m_bDOWATERFOG = true;
  123. #endif
  124. }
  125. void SetDOWATERFOG( bool i )
  126. {
  127. m_nDOWATERFOG = i ? 1 : 0;
  128. #ifdef _DEBUG
  129. m_bDOWATERFOG = true;
  130. #endif
  131. }
  132. private:
  133. int m_nLIGHT_COMBO;
  134. #ifdef _DEBUG
  135. bool m_bLIGHT_COMBO;
  136. #endif
  137. public:
  138. void SetLIGHT_COMBO( int i )
  139. {
  140. Assert( i >= 0 && i <= 21 );
  141. m_nLIGHT_COMBO = i;
  142. #ifdef _DEBUG
  143. m_bLIGHT_COMBO = true;
  144. #endif
  145. }
  146. void SetLIGHT_COMBO( bool i )
  147. {
  148. m_nLIGHT_COMBO = i ? 1 : 0;
  149. #ifdef _DEBUG
  150. m_bLIGHT_COMBO = true;
  151. #endif
  152. }
  153. private:
  154. int m_nSKINNING;
  155. #ifdef _DEBUG
  156. bool m_bSKINNING;
  157. #endif
  158. public:
  159. void SetSKINNING( int i )
  160. {
  161. Assert( i >= 0 && i <= 1 );
  162. m_nSKINNING = i;
  163. #ifdef _DEBUG
  164. m_bSKINNING = true;
  165. #endif
  166. }
  167. void SetSKINNING( bool i )
  168. {
  169. m_nSKINNING = i ? 1 : 0;
  170. #ifdef _DEBUG
  171. m_bSKINNING = true;
  172. #endif
  173. }
  174. public:
  175. vertexlitgeneric_vs11_Dynamic_Index()
  176. {
  177. #ifdef _DEBUG
  178. m_bDOWATERFOG = false;
  179. #endif // _DEBUG
  180. m_nDOWATERFOG = 0;
  181. #ifdef _DEBUG
  182. m_bLIGHT_COMBO = false;
  183. #endif // _DEBUG
  184. m_nLIGHT_COMBO = 0;
  185. #ifdef _DEBUG
  186. m_bSKINNING = false;
  187. #endif // _DEBUG
  188. m_nSKINNING = 0;
  189. }
  190. int GetIndex()
  191. {
  192. // Asserts to make sure that we aren't using any skipped combinations.
  193. // Asserts to make sure that we are setting all of the combination vars.
  194. #ifdef _DEBUG
  195. bool bAllDynamicVarsDefined = m_bDOWATERFOG && m_bLIGHT_COMBO && m_bSKINNING;
  196. Assert( bAllDynamicVarsDefined );
  197. #endif // _DEBUG
  198. return ( 1 * m_nDOWATERFOG ) + ( 2 * m_nLIGHT_COMBO ) + ( 44 * m_nSKINNING ) + 0;
  199. }
  200. };