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.

225 lines
4.0 KiB

  1. class unlitgeneric_vs11_Static_Index
  2. {
  3. private:
  4. int m_nDETAIL;
  5. #ifdef _DEBUG
  6. bool m_bDETAIL;
  7. #endif
  8. public:
  9. void SetDETAIL( int i )
  10. {
  11. Assert( i >= 0 && i <= 1 );
  12. m_nDETAIL = i;
  13. #ifdef _DEBUG
  14. m_bDETAIL = true;
  15. #endif
  16. }
  17. void SetDETAIL( bool i )
  18. {
  19. m_nDETAIL = i ? 1 : 0;
  20. #ifdef _DEBUG
  21. m_bDETAIL = 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. private:
  79. int m_nVERTEXCOLOR;
  80. #ifdef _DEBUG
  81. bool m_bVERTEXCOLOR;
  82. #endif
  83. public:
  84. void SetVERTEXCOLOR( int i )
  85. {
  86. Assert( i >= 0 && i <= 1 );
  87. m_nVERTEXCOLOR = i;
  88. #ifdef _DEBUG
  89. m_bVERTEXCOLOR = true;
  90. #endif
  91. }
  92. void SetVERTEXCOLOR( bool i )
  93. {
  94. m_nVERTEXCOLOR = i ? 1 : 0;
  95. #ifdef _DEBUG
  96. m_bVERTEXCOLOR = true;
  97. #endif
  98. }
  99. private:
  100. int m_nSEPARATEDETAILUVS;
  101. #ifdef _DEBUG
  102. bool m_bSEPARATEDETAILUVS;
  103. #endif
  104. public:
  105. void SetSEPARATEDETAILUVS( int i )
  106. {
  107. Assert( i >= 0 && i <= 1 );
  108. m_nSEPARATEDETAILUVS = i;
  109. #ifdef _DEBUG
  110. m_bSEPARATEDETAILUVS = true;
  111. #endif
  112. }
  113. void SetSEPARATEDETAILUVS( bool i )
  114. {
  115. m_nSEPARATEDETAILUVS = i ? 1 : 0;
  116. #ifdef _DEBUG
  117. m_bSEPARATEDETAILUVS = true;
  118. #endif
  119. }
  120. public:
  121. unlitgeneric_vs11_Static_Index()
  122. {
  123. #ifdef _DEBUG
  124. m_bDETAIL = false;
  125. #endif // _DEBUG
  126. m_nDETAIL = 0;
  127. #ifdef _DEBUG
  128. m_bENVMAP = false;
  129. #endif // _DEBUG
  130. m_nENVMAP = 0;
  131. #ifdef _DEBUG
  132. m_bENVMAPCAMERASPACE = true;
  133. #endif // _DEBUG
  134. m_nENVMAPCAMERASPACE = 0;
  135. #ifdef _DEBUG
  136. m_bENVMAPSPHERE = false;
  137. #endif // _DEBUG
  138. m_nENVMAPSPHERE = 0;
  139. #ifdef _DEBUG
  140. m_bVERTEXCOLOR = false;
  141. #endif // _DEBUG
  142. m_nVERTEXCOLOR = 0;
  143. #ifdef _DEBUG
  144. m_bSEPARATEDETAILUVS = false;
  145. #endif // _DEBUG
  146. m_nSEPARATEDETAILUVS = 0;
  147. }
  148. int GetIndex()
  149. {
  150. // Asserts to make sure that we aren't using any skipped combinations.
  151. // Asserts to make sure that we are setting all of the combination vars.
  152. #ifdef _DEBUG
  153. bool bAllStaticVarsDefined = m_bDETAIL && m_bENVMAP && m_bENVMAPCAMERASPACE && m_bENVMAPSPHERE && m_bVERTEXCOLOR && m_bSEPARATEDETAILUVS;
  154. Assert( bAllStaticVarsDefined );
  155. #endif // _DEBUG
  156. return ( 4 * m_nDETAIL ) + ( 8 * m_nENVMAP ) + ( 16 * m_nENVMAPCAMERASPACE ) + ( 16 * m_nENVMAPSPHERE ) + ( 32 * m_nVERTEXCOLOR ) + ( 64 * m_nSEPARATEDETAILUVS ) + 0;
  157. }
  158. };
  159. class unlitgeneric_vs11_Dynamic_Index
  160. {
  161. private:
  162. int m_nDOWATERFOG;
  163. #ifdef _DEBUG
  164. bool m_bDOWATERFOG;
  165. #endif
  166. public:
  167. void SetDOWATERFOG( int i )
  168. {
  169. Assert( i >= 0 && i <= 1 );
  170. m_nDOWATERFOG = i;
  171. #ifdef _DEBUG
  172. m_bDOWATERFOG = true;
  173. #endif
  174. }
  175. void SetDOWATERFOG( bool i )
  176. {
  177. m_nDOWATERFOG = i ? 1 : 0;
  178. #ifdef _DEBUG
  179. m_bDOWATERFOG = true;
  180. #endif
  181. }
  182. private:
  183. int m_nSKINNING;
  184. #ifdef _DEBUG
  185. bool m_bSKINNING;
  186. #endif
  187. public:
  188. void SetSKINNING( int i )
  189. {
  190. Assert( i >= 0 && i <= 1 );
  191. m_nSKINNING = i;
  192. #ifdef _DEBUG
  193. m_bSKINNING = true;
  194. #endif
  195. }
  196. void SetSKINNING( bool i )
  197. {
  198. m_nSKINNING = i ? 1 : 0;
  199. #ifdef _DEBUG
  200. m_bSKINNING = true;
  201. #endif
  202. }
  203. public:
  204. unlitgeneric_vs11_Dynamic_Index()
  205. {
  206. #ifdef _DEBUG
  207. m_bDOWATERFOG = false;
  208. #endif // _DEBUG
  209. m_nDOWATERFOG = 0;
  210. #ifdef _DEBUG
  211. m_bSKINNING = false;
  212. #endif // _DEBUG
  213. m_nSKINNING = 0;
  214. }
  215. int GetIndex()
  216. {
  217. // Asserts to make sure that we aren't using any skipped combinations.
  218. // Asserts to make sure that we are setting all of the combination vars.
  219. #ifdef _DEBUG
  220. bool bAllDynamicVarsDefined = m_bDOWATERFOG && m_bSKINNING;
  221. Assert( bAllDynamicVarsDefined );
  222. #endif // _DEBUG
  223. return ( 1 * m_nDOWATERFOG ) + ( 2 * m_nSKINNING ) + 0;
  224. }
  225. };