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

Function FileOffsetFromMpqOffset

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

Source from the content-addressed store, hash-verified

289}
290
291ULONGLONG FileOffsetFromMpqOffset(TMPQArchive * ha, ULONGLONG MpqOffset)
292{
293 if(ha->pHeader->wFormatVersion == MPQ_FORMAT_VERSION_1)
294 {
295 // For MPQ archive v1, any file offset is only 32-bit
296 return (ULONGLONG)((DWORD)ha->MpqPos + (DWORD)MpqOffset);
297 }
298 else
299 {
300 // For MPQ archive v2+, file offsets are full 64-bit
301 return ha->MpqPos + MpqOffset;
302 }
303}
304
305ULONGLONG CalculateRawSectorOffset(
306 TMPQFile * hf,

Callers 5

IsValidHashEntry1Function · 0.85
LoadHashTableFunction · 0.85
LoadBlockTableFunction · 0.85
VerifyMpqTablePositionsFunction · 0.85
CreateFileHandleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected