| 126 | } |
| 127 | |
| 128 | static void WriteAlphaBlock5(int alpha0, int alpha1, uint8_t const* indices, void* block) |
| 129 | { |
| 130 | // check the relative values of the endpoints |
| 131 | if (alpha0 > alpha1) |
| 132 | { |
| 133 | // swap the indices |
| 134 | uint8_t swapped[16]; |
| 135 | for (int i = 0; i < 16; ++i) |
| 136 | { |
| 137 | uint8_t index = indices[i]; |
| 138 | if (index == 0) |
| 139 | swapped[i] = 1; |
| 140 | else if (index == 1) |
| 141 | swapped[i] = 0; |
| 142 | else if (index <= 5) |
| 143 | swapped[i] = 7 - index; |
| 144 | else |
| 145 | swapped[i] = index; |
| 146 | } |
| 147 | |
| 148 | // write the block |
| 149 | WriteAlphaBlock(alpha1, alpha0, swapped, block); |
| 150 | } |
| 151 | else |
| 152 | { |
| 153 | // write the block |
| 154 | WriteAlphaBlock(alpha0, alpha1, indices, block); |
| 155 | } |
| 156 | } |
| 157 | |
| 158 | static void WriteAlphaBlock7(int alpha0, int alpha1, uint8_t const* indices, void* block) |
| 159 | { |
no test coverage detected