| 598 | {} |
| 599 | |
| 600 | DWORD GetItem(DWORD EntryIndex) |
| 601 | { |
| 602 | DWORD dwItemIndex = (EntryIndex * BitsPerEntry) >> 0x05; |
| 603 | DWORD dwStartBit = (EntryIndex * BitsPerEntry) & 0x1F; |
| 604 | DWORD dwEndBit = dwStartBit + BitsPerEntry; |
| 605 | DWORD dwResult; |
| 606 | |
| 607 | // If the end bit index is greater than 32, |
| 608 | // we also need to load from the next 32-bit item |
| 609 | if(dwEndBit > 0x20) |
| 610 | { |
| 611 | dwResult = (ItemArray[dwItemIndex + 1] << (0x20 - dwStartBit)) | (ItemArray[dwItemIndex] >> dwStartBit); |
| 612 | } |
| 613 | else |
| 614 | { |
| 615 | dwResult = ItemArray[dwItemIndex] >> dwStartBit; |
| 616 | } |
| 617 | |
| 618 | // Now we also need to mask the result by the bit mask |
| 619 | return dwResult & EntryBitMask; |
| 620 | } |
| 621 | |
| 622 | DWORD LoadBitsFromStream(TByteStream & InStream) |
| 623 | { |
no outgoing calls
no test coverage detected