MCPcopy Create free account
hub / github.com/Scobalula/Greyhound / GetItem

Method GetItem

src/External/CascLib/src/CascRootFile_MNDX.cpp:600–620  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers 3

DrawItemMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected