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.

134 lines
2.4 KiB

  1. class vortwarp_vs11_Static_Index
  2. {
  3. private:
  4. int m_nUNLIT;
  5. #ifdef _DEBUG
  6. bool m_bUNLIT;
  7. #endif
  8. public:
  9. void SetUNLIT( int i )
  10. {
  11. Assert( i >= 0 && i <= 1 );
  12. m_nUNLIT = i;
  13. #ifdef _DEBUG
  14. m_bUNLIT = true;
  15. #endif
  16. }
  17. void SetUNLIT( bool i )
  18. {
  19. m_nUNLIT = i ? 1 : 0;
  20. #ifdef _DEBUG
  21. m_bUNLIT = true;
  22. #endif
  23. }
  24. private:
  25. int m_nHALF_LAMBERT;
  26. #ifdef _DEBUG
  27. bool m_bHALF_LAMBERT;
  28. #endif
  29. public:
  30. void SetHALF_LAMBERT( int i )
  31. {
  32. Assert( i >= 0 && i <= 1 );
  33. m_nHALF_LAMBERT = i;
  34. #ifdef _DEBUG
  35. m_bHALF_LAMBERT = true;
  36. #endif
  37. }
  38. void SetHALF_LAMBERT( bool i )
  39. {
  40. m_nHALF_LAMBERT = i ? 1 : 0;
  41. #ifdef _DEBUG
  42. m_bHALF_LAMBERT = true;
  43. #endif
  44. }
  45. public:
  46. vortwarp_vs11_Static_Index()
  47. {
  48. #ifdef _DEBUG
  49. m_bUNLIT = false;
  50. #endif // _DEBUG
  51. m_nUNLIT = 0;
  52. #ifdef _DEBUG
  53. m_bHALF_LAMBERT = false;
  54. #endif // _DEBUG
  55. m_nHALF_LAMBERT = 0;
  56. }
  57. int GetIndex()
  58. {
  59. // Asserts to make sure that we aren't using any skipped combinations.
  60. // Asserts to make sure that we are setting all of the combination vars.
  61. #ifdef _DEBUG
  62. bool bAllStaticVarsDefined = m_bUNLIT && m_bHALF_LAMBERT;
  63. Assert( bAllStaticVarsDefined );
  64. #endif // _DEBUG
  65. return ( 44 * m_nUNLIT ) + ( 88 * m_nHALF_LAMBERT ) + 0;
  66. }
  67. };
  68. class vortwarp_vs11_Dynamic_Index
  69. {
  70. private:
  71. int m_nLIGHT_COMBO;
  72. #ifdef _DEBUG
  73. bool m_bLIGHT_COMBO;
  74. #endif
  75. public:
  76. void SetLIGHT_COMBO( int i )
  77. {
  78. Assert( i >= 0 && i <= 21 );
  79. m_nLIGHT_COMBO = i;
  80. #ifdef _DEBUG
  81. m_bLIGHT_COMBO = true;
  82. #endif
  83. }
  84. void SetLIGHT_COMBO( bool i )
  85. {
  86. m_nLIGHT_COMBO = i ? 1 : 0;
  87. #ifdef _DEBUG
  88. m_bLIGHT_COMBO = true;
  89. #endif
  90. }
  91. private:
  92. int m_nSKINNING;
  93. #ifdef _DEBUG
  94. bool m_bSKINNING;
  95. #endif
  96. public:
  97. void SetSKINNING( int i )
  98. {
  99. Assert( i >= 0 && i <= 1 );
  100. m_nSKINNING = i;
  101. #ifdef _DEBUG
  102. m_bSKINNING = true;
  103. #endif
  104. }
  105. void SetSKINNING( bool i )
  106. {
  107. m_nSKINNING = i ? 1 : 0;
  108. #ifdef _DEBUG
  109. m_bSKINNING = true;
  110. #endif
  111. }
  112. public:
  113. vortwarp_vs11_Dynamic_Index()
  114. {
  115. #ifdef _DEBUG
  116. m_bLIGHT_COMBO = false;
  117. #endif // _DEBUG
  118. m_nLIGHT_COMBO = 0;
  119. #ifdef _DEBUG
  120. m_bSKINNING = false;
  121. #endif // _DEBUG
  122. m_nSKINNING = 0;
  123. }
  124. int GetIndex()
  125. {
  126. // Asserts to make sure that we aren't using any skipped combinations.
  127. // Asserts to make sure that we are setting all of the combination vars.
  128. #ifdef _DEBUG
  129. bool bAllDynamicVarsDefined = m_bLIGHT_COMBO && m_bSKINNING;
  130. Assert( bAllDynamicVarsDefined );
  131. #endif // _DEBUG
  132. return ( 1 * m_nLIGHT_COMBO ) + ( 22 * m_nSKINNING ) + 0;
  133. }
  134. };