| 69 | |
| 70 | |
| 71 | bool Bitfield::Set( uint8 _idx ) |
| 72 | { |
| 73 | if (_idx > 0x1F) { |
| 74 | return false; |
| 75 | } |
| 76 | |
| 77 | if( !IsSet(_idx) ) |
| 78 | { |
| 79 | uint32 newSize = (_idx>>5)+1; |
| 80 | if( newSize > m_bits.size() ) |
| 81 | { |
| 82 | m_bits.resize( newSize, 0 ); |
| 83 | } |
| 84 | m_bits[_idx>>5] |= (1<<(_idx&0x1f)); |
| 85 | ++m_numSetBits; |
| 86 | } |
| 87 | return true; |
| 88 | } |
| 89 | |
| 90 | bool Bitfield::Clear( uint8 _idx ) |
| 91 | { |