| 72 | } |
| 73 | |
| 74 | void DecompressAlphaDxt3( u8* rgba, void const* block ) |
| 75 | { |
| 76 | u8 const* bytes = reinterpret_cast< u8 const* >( block ); |
| 77 | |
| 78 | // unpack the alpha values pairwise |
| 79 | for( int i = 0; i < 8; ++i ) |
| 80 | { |
| 81 | // quantise down to 4 bits |
| 82 | u8 quant = bytes[i]; |
| 83 | |
| 84 | // unpack the values |
| 85 | u8 lo = quant & 0x0f; |
| 86 | u8 hi = quant & 0xf0; |
| 87 | |
| 88 | // convert back up to bytes |
| 89 | rgba[8*i + 3] = lo | ( lo << 4 ); |
| 90 | rgba[8*i + 7] = hi | ( hi >> 4 ); |
| 91 | } |
| 92 | } |
| 93 | |
| 94 | static void FixRange( int& min, int& max, int steps ) |
| 95 | { |