| 35 | namespace squish { |
| 36 | |
| 37 | static int FixFlags( int flags ) |
| 38 | { |
| 39 | // grab the flag bits |
| 40 | int method = flags & ( kDxt1 | kDxt3 | kDxt5 | kBc4 | kBc5 ); |
| 41 | int fit = flags & ( kColourIterativeClusterFit | kColourClusterFit | kColourRangeFit ); |
| 42 | int extra = flags & kWeightColourByAlpha; |
| 43 | |
| 44 | // set defaults |
| 45 | if ( method != kDxt3 |
| 46 | && method != kDxt5 |
| 47 | && method != kBc4 |
| 48 | && method != kBc5 ) |
| 49 | { |
| 50 | method = kDxt1; |
| 51 | } |
| 52 | if( fit != kColourRangeFit && fit != kColourIterativeClusterFit ) |
| 53 | fit = kColourClusterFit; |
| 54 | |
| 55 | // done |
| 56 | return method | fit | extra; |
| 57 | } |
| 58 | |
| 59 | void CompressMasked( u8 const* rgba, int mask, void* block, int flags, float* metric ) |
| 60 | { |
no outgoing calls
no test coverage detected