MCPcopy Create free account
hub / github.com/diasurgical/devilution / TranslateHiBlockTable

Function TranslateHiBlockTable

3rdParty/StormLib/src/SBaseFileTable.cpp:925–948  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

923}
924
925static USHORT * TranslateHiBlockTable(
926 TMPQArchive * ha,
927 ULONGLONG * pcbTableSize)
928{
929 TFileEntry * pFileEntry = ha->pFileTable;
930 USHORT * pHiBlockTable;
931 USHORT * pHiBlock;
932 DWORD dwBlockTableSize = ha->pHeader->dwBlockTableSize;
933
934 // Allocate copy of the hash table
935 pHiBlockTable = pHiBlock = STORM_ALLOC(USHORT, dwBlockTableSize);
936 if(pHiBlockTable != NULL)
937 {
938 // Copy the block table
939 for(DWORD i = 0; i < dwBlockTableSize; i++)
940 pHiBlock[i] = (USHORT)(pFileEntry[i].ByteOffset >> 0x20);
941
942 // Give the size to the caller
943 if(pcbTableSize != NULL)
944 *pcbTableSize = (ULONGLONG)dwBlockTableSize * sizeof(USHORT);
945 }
946
947 return pHiBlockTable;
948}
949
950//-----------------------------------------------------------------------------
951// General EXT table functions

Callers 1

SaveMPQTablesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected