| 157 | // ColorAndPartPacker interface |
| 158 | public: |
| 159 | void packColor(uint32_t col, BitStream &bs) const override |
| 160 | { |
| 161 | uint32_t cache_idx=0; |
| 162 | uint32_t prev_val=0; |
| 163 | if(col && m_colors.find_index(col,cache_idx,prev_val,false)) |
| 164 | { |
| 165 | cache_idx+=1; |
| 166 | } |
| 167 | bs.StoreBits(1,(cache_idx||col==0)); |
| 168 | if(cache_idx||col==0) |
| 169 | { |
| 170 | bs.StorePackedBits(colorcachecount_bitlength,cache_idx); |
| 171 | } |
| 172 | else |
| 173 | { |
| 174 | bs.StoreBits(32,col); |
| 175 | } |
| 176 | |
| 177 | } |
| 178 | |
| 179 | void unpackColor(BitStream &bs, uint32_t &tgt)const override |
| 180 | { |
no test coverage detected